rosa-build/app/views/roles/index.html.haml

51 lines
2.1 KiB
Plaintext
Raw Normal View History

2011-10-18 19:31:59 +01:00
.block
.secondary-navigation
%ul.wat-cf
%li.first.active= link_to t("layout.roles.list"), roles_path
%li= link_to t("layout.roles.new"), new_role_path
.content
%h2.title
= t("layout.roles.list_header")
.inner
.group
= button_to t("layout.roles.get_dump"), {:controller => :roles, :action => :get_dump},
{:style => 'float: left; margin-right: 30px'}
= form_tag url_for(:controller => :roles, :action => :load_from_dump), :multipart => true do
= label_tag :file, t("layout.roles.from_file") + ':'
= file_field_tag :file
= submit_tag t("layout.upload")
%br
-unless @roles.empty?
%table.table
%tr
%th.first ID
%th= t("activerecord.attributes.role.name")
%th= t("activerecord.attributes.role.to")
%th= t("activerecord.attributes.role.on")
%th= t("activerecord.attributes.role.use_default")
%th= t("activerecord.attributes.role.use_default_for_owner")
%th.last  
- @roles.each do |role|
%tr{:class => cycle("odd", "even")}
%td
= role.id
%td
= link_to role.name, role_path(role)
%td
= (role.to and role.to != '') ? role.to : 'All'
%td
= (role.on and role.on != '') ? role.on : 'System'
%td
= (role.use_default) ? t("layout.yes_") : t("layout.no_")
%td
= (role.use_default_for_owner) ? t("layout.yes_") : t("layout.no_")
%td.last
#{link_to t("layout.show"), role_path(role)} | #{link_to t("layout.edit"), edit_role_path(role)} | #{link_to t("layout.delete"), role_path(role), :method => :delete, :confirm => t("layout.roles.confirm_delete")}
.actions-bar.wat-cf
.actions
-else
.inner
%label.label Роли отсутствуют,
= link_to "создать новую роль", new_role_path
2011-10-18 19:31:59 +01:00
- content_for :sidebar, render(:partial => 'sidebar')