Project

General

Profile

Patch #25491 » 25491-list-of-role-members-v3.diff

Go MAEDA, 2017-05-01 07:47

View differences:

app/controllers/roles_controller.rb (working copy)
redirect_to roles_path
end
def members
@role = Role.find(params[:id])
@projects_members = Member.joins(:roles, :user).where(
:roles => {:id => @role}
).group(:users, :id).group_by(&:project)
end
def permissions
@roles = Role.sorted.to_a
@permissions = Redmine::AccessControl.permissions.select { |p| !p.public? }
app/models/time_entry_query.rb (working copy)
def default_totalable_names
[:hours]
end
def default_sort_criteria
[['spent_on', 'desc']]
end
app/models/user.rb (working copy)
def delete_autologin_token(value)
Token.where(:user_id => id, :action => 'autologin', :value => value).delete_all
end
# Returns true if token is a valid session token for the user whose id is user_id
def self.verify_session_token(user_id, token)
return false if user_id.blank? || token.blank?
app/views/roles/index.html.erb (working copy)
<td class="name"><%= content_tag(role.builtin? ? 'em' : 'span', link_to(role.name, edit_role_path(role))) %></td>
<td class="buttons">
<%= reorder_handle(role) unless role.builtin? %>
<%= link_to l(:label_member_plural), {:controller => 'roles', :action => 'members', :id => role.id}, :class => 'icon icon-user' unless role.builtin? %>
<%= link_to l(:button_copy), new_role_path(:copy => role), :class => 'icon icon-copy' %>
<%= delete_link role_path(role) unless role.builtin? %>
</td>
......
<%= javascript_tag do %>
$(function() { $("table.roles tbody").positionedItems({items: ".givable"}); });
<% end %>
<% end %>
app/views/roles/members.html.erb (working copy)
<%= title [l(:label_role_plural), roles_path], @role.name, l(:label_member_plural) %>
<% if @projects_members.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% else %>
<% @projects_members.each do |project, members| next if members.count == 0 %>
<h3><%= project.name %></h3>
<div class="box tabular" id="members_list">
<div class="splitcontent">
<ul>
<% members.each do |member| next if member.nil? or member.user.nil? %>
<li><%= link_to_user(member.user) %></li>
<% end %>
</ul>
</div>
</div>
<% end %>
<% end %>
config/locales/ja.yml (working copy)
field_port: ポート
field_account: アカウント
field_base_dn: ベースDN
field_attr_login: ログイン名属性
field_attr_firstname: 名前属性
field_attr_lastname: 苗字属性
field_attr_mail: メール属性
field_attr_login: ログインIDの属性
field_attr_firstname: 名の属性
field_attr_lastname: 姓の属性
field_attr_mail: メールアドレスの属性
field_onthefly: あわせてユーザーを作成
field_start_date: 開始日
field_done_ratio: 進捗率
config/routes.rb (working copy)
match 'permissions', :via => [:get, :post]
end
end
get '/roles/:id/members', :to => 'roles#members'
resources :enumerations, :except => :show
match 'enumerations/:type', :to => 'enumerations#index', :via => :get
public/stylesheets/application.css (working copy)
.contextual>*:not(:first-child), .buttons>.icon:not(:first-child) { margin-left: 5px; }
#members_list ul {
-moz-column-count: 3;
-webkit-column-count: 3;
column-count: 3;
list-style-position: inside;
}
img.gravatar {
vertical-align: middle;
border-radius: 20%;
(7-7/7)