lib/zen/package/users/lib/users/view/admin/access-rules/index.xhtml in zen-0.2.7 vs lib/zen/package/users/lib/users/view/admin/access-rules/index.xhtml in zen-0.2.8

- old
+ new

@@ -1,24 +1,23 @@ <article> <header> <h1>#{get_breadcrumbs}</h1> </header> - - <form method="post" action="#{@form_delete_url}"> + + <form method="post" action="#{Users::Controller::AccessRules.r(:delete)}"> <input type="hidden" name="csrf_token" value="#{get_csrf_token}" /> - - <?r if @access_rules and !@access_rules.empty? ?> - - <table class="table"> + + <?r if !@access_rules.empty? ?> + <table> <thead> <tr> <?r if user_authorized?([:delete]) ?> - <th> + <th class="no_sort"> <input type="checkbox" /> </th> <?r end ?> - + <th>#{lang('access_rules.labels.id')}</th> <th>#{lang('access_rules.labels.package')}</th> <th>#{lang('access_rules.labels.controller')}</th> <th>#{lang('access_rules.labels.create')}</th> <th>#{lang('access_rules.labels.read')}</th> @@ -31,32 +30,36 @@ <tbody> <?r @access_rules.each do |rule| ?> <tr> <?r if user_authorized?([:delete]) ?> <td> - <input type="checkbox" name="access_rule_ids[]" value="#{rule.id}" /> + <input type="checkbox" name="access_rule_ids[]" + value="#{rule.id}" /> </td> <?r end ?> - + <td>#{rule.id}</td> <td>#{rule.package}</td> - <?r if user_authorized?([:update]) ?> <td> - #{anchor_to( - @form_controllers[rule.package].key(rule.controller), - Users::Controller::AccessRules.r(:edit, rule.id) - )} + #{ + if user_authorized?([:update]) + Users::Controller::AccessRules.a( + @form_controllers[rule.package].key(rule.controller), + :edit, + rule.id + ) + else + @form_controllers[rule.package].key(rule.controller) + end + } </td> - <?r else ?> - <td>#{@form_controllers[rule.package].key(rule.controller)}</td> - <?r end ?> - - <td>#{@boolean_hash.invert[rule.create_access]}</td> - <td>#{@boolean_hash.invert[rule.read_access]}</td> - <td>#{@boolean_hash.invert[rule.update_access]}</td> - <td>#{@boolean_hash.invert[rule.delete_access]}</td> + + <td>#{@boolean_hash[rule.create_access]}</td> + <td>#{@boolean_hash[rule.read_access]}</td> + <td>#{@boolean_hash[rule.update_access]}</td> + <td>#{@boolean_hash[rule.delete_access]}</td> <td> <?r if !rule.user_id.nil? ?> #{rule.user.name} <?r end ?> </td> @@ -67,29 +70,33 @@ </td> </tr> <?r end ?> </tbody> </table> - + + #{ + if @access_rules.respond_to?(:navigation) \ + and @access_rules.page_count > 1 + @access_rules.navigation + end + } + <?r else ?> <p>#{lang('access_rules.messages.no_rules')}</p> <?r end ?> - - <div class="clearfix"> - - <?r if user_authorized?([:create]) ?> - <div class="button"> - #{anchor_to( - lang('access_rules.buttons.new'), - Users::Controller::AccessRules.r(:new) - )} - </div> - <?r end ?> - - <?r if user_authorized?([:delete]) and @access_rules and !@access_rules.empty? ?> - <div class="button"> - <input type="submit" value="#{lang('access_rules.buttons.delete')}" /> - </div> - <?r end ?> + + <?r if user_authorized?([:create]) ?> + <div class="button"> + #{Users::Controller::AccessRules.a( + lang('access_rules.buttons.new'), :new + )} </div> + <?r end ?> + + <?r if user_authorized?([:delete]) and !@access_rules.empty? ?> + <div class="button"> + <input type="submit" + value="#{lang('access_rules.buttons.delete')}" /> + </div> + <?r end ?> </form> </article>