Merge pull request #334 from warpc/270-user_control

[Refs 270] Customize users admin menu
* moved Add button to sidebar;
* added translate to search label;
* changed translation to Admin.
This commit is contained in:
Vladimir Sharshov 2012-03-23 06:06:00 -07:00
commit da5863ba0f
5 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,7 @@
- content_for :sidebar do - content_for :sidebar do
.bordered.nopadding .bordered
- if can? :create, User.new
= link_to t("layout.users.new"), new_user_path, :class => 'button'
%h3= t("layout.users.filter_header") %h3= t("layout.users.filter_header")
%table %table
- t('layout.users.users_filter').each_key do |base| - t('layout.users.users_filter').each_key do |base|

View File

@ -1,9 +1,7 @@
%h3.fix= t("layout.users.list_header") %h3.fix= t("layout.users.list_header")
- if can? :create, User.new
= link_to t("layout.users.new"), new_user_path, :class => 'button'
- columns = [{:type => 'html'}, {:type => 'html'}, {:type => 'html'}, {:type => 'html', :sortable => false, :searchable => false}, {:type => nil, :sortable => false, :searchable => false, :class => 'buttons'}] - columns = [{:type => 'html'}, {:type => 'html'}, {:type => 'html'}, {:type => 'html', :sortable => false, :searchable => false}, {:type => nil, :sortable => false, :searchable => false, :class => 'buttons'}]
= raw datatable(columns, {:sort_by => "[0, 'asc']", :processing => t("layout.processing"), = raw datatable(columns, {:sort_by => "[0, 'asc']", :processing => t("layout.processing"), :search_label => t("layout.search.header"),
:pagination_labels => {:previous => t("datatables.previous_label"), :next => t("datatables.next_label")}, :pagination_labels => {:previous => t("datatables.previous_label"), :next => t("datatables.next_label")},
:empty_label => t("datatables.empty_label"), :empty_label => t("datatables.empty_label"),
:info_label => t("datatables.info_label"), :info_label => t("datatables.info_label"),

View File

@ -3,4 +3,4 @@
- if can? :index, base.to_s.classify.constantize - if can? :index, base.to_s.classify.constantize
%li= link_to title, send(:"#{base}_path"), :class => controller_name == base.to_s ? 'active' : '' %li= link_to title, send(:"#{base}_path"), :class => controller_name == base.to_s ? 'active' : ''
- if current_user.admin? && which_menu == 'top_menu' - if current_user.admin? && which_menu == 'top_menu'
%li= link_to 'Admin', users_path, :class => t('admins_menu').has_key?(controller_name.to_sym) ? 'active' : '' %li= link_to t('admins_menu_header'), users_path, :class => t('admins_menu').has_key?(controller_name.to_sym) ? 'active' : ''

View File

@ -33,6 +33,7 @@ en:
wiki: Wiki wiki: Wiki
platform_menu: platform_menu:
settings: Settings settings: Settings
admins_menu_header: Admin
admins_menu: admins_menu:
users: Пользователи users: Пользователи
event_logs: Лог событий event_logs: Лог событий

View File

@ -33,6 +33,7 @@ ru:
wiki: Вики wiki: Вики
platform_menu: platform_menu:
settings: Настройки settings: Настройки
admins_menu_header: Центр управления
admins_menu: admins_menu:
users: Пользователи users: Пользователи
event_logs: Лог событий event_logs: Лог событий