##// END OF EJS Templates
Various changes on views. On project summary, members are now grouped by role and subprojects are listed inline....
Jean-Philippe Lang -
r431:183ede84fd80
parent child
Show More
@@ -83,7 +83,7 class ProjectsController < ApplicationController
83 83 # Show @project
84 84 def show
85 85 @custom_values = @project.custom_values.find(:all, :include => :custom_field)
86 @members = @project.members.find(:all, :include => [:user, :role], :order => 'position')
86 @members_by_role = @project.members.find(:all, :include => [:user, :role], :order => 'position').group_by {|m| m.role}
87 87 @subprojects = @project.children if @project.children.size > 0
88 88 @news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
89 89 @trackers = Tracker.find(:all, :order => 'position')
@@ -28,7 +28,7 class RolesController < ApplicationController
28 28 end
29 29
30 30 def list
31 @role_pages, @roles = paginate :roles, :per_page => 10, :order => "position"
31 @role_pages, @roles = paginate :roles, :per_page => 25, :order => "position"
32 32 render :action => "list", :layout => false if request.xhr?
33 33 end
34 34
@@ -101,7 +101,7 class RolesController < ApplicationController
101 101 end
102 102
103 103 def report
104 @roles = Role.find :all
104 @roles = Role.find(:all, :order => 'position')
105 105 @permissions = Permission.find :all, :conditions => ["is_public=?", false], :order => 'sort'
106 106 if request.post?
107 107 @roles.each do |role|
@@ -26,6 +26,10 class Role < ActiveRecord::Base
26 26 validates_uniqueness_of :name
27 27 validates_format_of :name, :with => /^[\w\s\'\-]*$/i
28 28
29 def <=>(role)
30 position <=> role.position
31 end
32
29 33 private
30 34 def check_integrity
31 35 raise "Can't delete role" if Member.find(:first, :conditions =>["role_id=?", self.id])
@@ -141,7 +141,11 class User < ActiveRecord::Base
141 141 token = Token.find_by_value(key)
142 142 token && token.user.active? ? token.user : nil
143 143 end
144
144
145 def <=>(user)
146 lastname <=> user.lastname
147 end
148
145 149 private
146 150 # Return password digest
147 151 def self.hash_password(clear_password)
@@ -11,7 +11,7
11 11 <td style="width:15%"><b><%=l(:field_priority)%> :</b></td><td style="width:35%"><%= @issue.priority.name %></td>
12 12 </tr>
13 13 <tr>
14 <td><b><%=l(:field_assigned_to)%> :</b></td><td><%= @issue.assigned_to ? @issue.assigned_to.name : "-" %></td>
14 <td><b><%=l(:field_assigned_to)%> :</b></td><td><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
15 15 <td><b><%=l(:field_category)%> :</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td>
16 16 </tr>
17 17 <tr>
@@ -5,7 +5,7
5 5 <h2><%=l(:label_overview)%></h2>
6 6
7 7 <div class="splitcontentleft">
8 <%= simple_format(auto_link(h(@project.description))) %>
8 <%= textilizable @project.description %>
9 9 <ul>
10 10 <% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %>
11 11 <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
@@ -40,17 +40,15
40 40 <div class="splitcontentright">
41 41 <div class="box">
42 42 <h3 class="icon22 icon22-users"><%=l(:label_member_plural)%></h3>
43 <% for member in @members %>
44 <%= link_to_user member.user %> (<%= member.role.name %>)<br />
43 <% @members_by_role.keys.sort.each do |role| %>
44 <%= role.name %>: <%= @members_by_role[role].collect(&:user).sort.collect{|u| link_to_user u}.join(", ") %><br />
45 45 <% end %>
46 46 </div>
47 47
48 48 <% if @subprojects %>
49 49 <div class="box">
50 50 <h3 class="icon22 icon22-projects"><%=l(:label_subproject_plural)%></h3>
51 <% for subproject in @subprojects %>
52 <%= link_to subproject.name, :action => 'show', :id => subproject %><br />
53 <% end %>
51 <%= @subprojects.collect{|p| link_to(p.name, :action => 'show', :id => p)}.join(", ") %>
54 52 </div>
55 53 <% end %>
56 54
General Comments 0
You need to be logged in to leave comments. Login now