Various changes on views. On project summary, members are now grouped by role and subprojects are listed inline.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@434 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
bd9a44c225
commit
183ede84fd
@ -83,7 +83,7 @@ class ProjectsController < ApplicationController
|
|||||||
# Show @project
|
# Show @project
|
||||||
def show
|
def show
|
||||||
@custom_values = @project.custom_values.find(:all, :include => :custom_field)
|
@custom_values = @project.custom_values.find(:all, :include => :custom_field)
|
||||||
@members = @project.members.find(:all, :include => [:user, :role], :order => 'position')
|
@members_by_role = @project.members.find(:all, :include => [:user, :role], :order => 'position').group_by {|m| m.role}
|
||||||
@subprojects = @project.children if @project.children.size > 0
|
@subprojects = @project.children if @project.children.size > 0
|
||||||
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
|
@news = @project.news.find(:all, :limit => 5, :include => [ :author, :project ], :order => "#{News.table_name}.created_on DESC")
|
||||||
@trackers = Tracker.find(:all, :order => 'position')
|
@trackers = Tracker.find(:all, :order => 'position')
|
||||||
|
@ -28,7 +28,7 @@ class RolesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def list
|
def list
|
||||||
@role_pages, @roles = paginate :roles, :per_page => 10, :order => "position"
|
@role_pages, @roles = paginate :roles, :per_page => 25, :order => "position"
|
||||||
render :action => "list", :layout => false if request.xhr?
|
render :action => "list", :layout => false if request.xhr?
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ class RolesController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def report
|
def report
|
||||||
@roles = Role.find :all
|
@roles = Role.find(:all, :order => 'position')
|
||||||
@permissions = Permission.find :all, :conditions => ["is_public=?", false], :order => 'sort'
|
@permissions = Permission.find :all, :conditions => ["is_public=?", false], :order => 'sort'
|
||||||
if request.post?
|
if request.post?
|
||||||
@roles.each do |role|
|
@roles.each do |role|
|
||||||
|
@ -26,6 +26,10 @@ class Role < ActiveRecord::Base
|
|||||||
validates_uniqueness_of :name
|
validates_uniqueness_of :name
|
||||||
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
|
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
|
||||||
|
|
||||||
|
def <=>(role)
|
||||||
|
position <=> role.position
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def check_integrity
|
def check_integrity
|
||||||
raise "Can't delete role" if Member.find(:first, :conditions =>["role_id=?", self.id])
|
raise "Can't delete role" if Member.find(:first, :conditions =>["role_id=?", self.id])
|
||||||
|
@ -141,7 +141,11 @@ class User < ActiveRecord::Base
|
|||||||
token = Token.find_by_value(key)
|
token = Token.find_by_value(key)
|
||||||
token && token.user.active? ? token.user : nil
|
token && token.user.active? ? token.user : nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def <=>(user)
|
||||||
|
lastname <=> user.lastname
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
# Return password digest
|
# Return password digest
|
||||||
def self.hash_password(clear_password)
|
def self.hash_password(clear_password)
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<td style="width:15%"><b><%=l(:field_priority)%> :</b></td><td style="width:35%"><%= @issue.priority.name %></td>
|
<td style="width:15%"><b><%=l(:field_priority)%> :</b></td><td style="width:35%"><%= @issue.priority.name %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b><%=l(:field_assigned_to)%> :</b></td><td><%= @issue.assigned_to ? @issue.assigned_to.name : "-" %></td>
|
<td><b><%=l(:field_assigned_to)%> :</b></td><td><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
|
||||||
<td><b><%=l(:field_category)%> :</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td>
|
<td><b><%=l(:field_category)%> :</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<h2><%=l(:label_overview)%></h2>
|
<h2><%=l(:label_overview)%></h2>
|
||||||
|
|
||||||
<div class="splitcontentleft">
|
<div class="splitcontentleft">
|
||||||
<%= simple_format(auto_link(h(@project.description))) %>
|
<%= textilizable @project.description %>
|
||||||
<ul>
|
<ul>
|
||||||
<% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %>
|
<% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %>
|
||||||
<li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
|
<li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>
|
||||||
@ -40,17 +40,15 @@
|
|||||||
<div class="splitcontentright">
|
<div class="splitcontentright">
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3 class="icon22 icon22-users"><%=l(:label_member_plural)%></h3>
|
<h3 class="icon22 icon22-users"><%=l(:label_member_plural)%></h3>
|
||||||
<% for member in @members %>
|
<% @members_by_role.keys.sort.each do |role| %>
|
||||||
<%= link_to_user member.user %> (<%= member.role.name %>)<br />
|
<%= role.name %>: <%= @members_by_role[role].collect(&:user).sort.collect{|u| link_to_user u}.join(", ") %><br />
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if @subprojects %>
|
<% if @subprojects %>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3 class="icon22 icon22-projects"><%=l(:label_subproject_plural)%></h3>
|
<h3 class="icon22 icon22-projects"><%=l(:label_subproject_plural)%></h3>
|
||||||
<% for subproject in @subprojects %>
|
<%= @subprojects.collect{|p| link_to(p.name, :action => 'show', :id => p)}.join(", ") %>
|
||||||
<%= link_to subproject.name, :action => 'show', :id => subproject %><br />
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user