Added showing of global_role to user list

This commit is contained in:
George Vinogradov 2011-10-29 02:36:02 +04:00
parent 2f5e77ba56
commit b55a99adfa
3 changed files with 14 additions and 2 deletions

View File

@ -24,7 +24,8 @@ class Project < ActiveRecord::Base
attr_readonly :unixname
scope :recent, order("name ASC")
scope :by_name, lambda { |name| {:conditions => ['name like ?', '%' + name + '%']} }
# scope :by_name, lambda { |name| {:conditions => ['name like ?', '%' + name + '%']} }
scope :by_name, lambda { |name| where('name like ?', '%' + name + '%') }
scope :by_visibilities, lambda {|v| {:conditions => ['visibility in (?)', v.join(',')]}}
scope :addable_to_repository, lambda { |repository_id| where("projects.id NOT IN (SELECT project_to_repositories.project_id FROM project_to_repositories WHERE (project_to_repositories.repository_id != #{ repository_id }))") }

View File

@ -12,6 +12,7 @@
%th.first ID
%th= t("activerecord.attributes.user.name")
%th= t("activerecord.attributes.user.email")
%th= t("activerecord.attributes.user.global_role")
%th.last &nbsp;
- @users.each do |user|
%tr{:class => cycle("odd", "even")}
@ -21,7 +22,16 @@
= link_to user.name, user_path(user)
%td
= user.email
%td
= user.global_role.name
%td.last
#{link_to t("layout.show"), user_path(user)} | #{link_to t("layout.edit"), edit_user_path(user)} | #{link_to t("layout.delete"), user_path(user), :method => :delete, :confirm => t("layout.users.confirm_delete")}
- if current_user.can_perform? 'users', 'show'
= link_to t("layout.show"), user_path(user)
\|
- if current_user.can_perform? 'users', 'edit'
#{link_to t("layout.edit"), edit_user_path(user)}
\|
- if current_user.can_perform? 'users', 'destroy'
#{link_to t("layout.delete"), user_path(user), :method => :delete, :confirm => t("layout.users.confirm_delete")}
.actions-bar.wat-cf
.actions= will_paginate @users, :param_name => :user_page

View File

@ -448,6 +448,7 @@ ru:
roles: Роли
created_at: Создан
updated_at: Обновлен
global_role: Роль в системе
build_list:
bs_id: Id