# HG changeset patch # User Chris Cannam # Date 1295451299 0 # Node ID bf38a7365edfa6d3634c11223558e36bdb429d9e # Parent cede720e8f534fd88cb89c1fecea7166a8f615fe# Parent 6a2f8e88344ebf1e36bec0534350af0ed440e182 Merge fixes for bug #51 and bug #35 from branch "cannam-pre-20110113-merge" diff -r cede720e8f53 -r bf38a7365edf app/controllers/members_controller.rb --- a/app/controllers/members_controller.rb Mon Dec 20 22:15:06 2010 +0000 +++ b/app/controllers/members_controller.rb Wed Jan 19 15:34:59 2011 +0000 @@ -94,6 +94,7 @@ def autocomplete_for_member @principals = Principal.active.like(params[:q]).find(:all, :limit => 100) - @project.principals + logger.debug "Query for #{params[:q]} returned #{@principals.size} results" render :layout => false end diff -r cede720e8f53 -r bf38a7365edf app/controllers/projects_controller.rb --- a/app/controllers/projects_controller.rb Mon Dec 20 22:15:06 2010 +0000 +++ b/app/controllers/projects_controller.rb Wed Jan 19 15:34:59 2011 +0000 @@ -45,12 +45,22 @@ helper :repositories include RepositoriesHelper include ProjectsHelper - + # Lists visible projects def index respond_to do |format| format.html { - @projects = Project.visible.find(:all, :order => 'lft') + sort_init 'lft' + sort_update %w(lft title created_on updated_on) + @limit = per_page_option + @project_count = Project.visible.count + @project_pages = Paginator.new self, @project_count, @limit, params['page'] + @offset ||= @project_pages.current.offset + @projects = Project.visible.all(:offset => @offset, :limit => @limit, :order => sort_clause) + if User.current.logged? + @user_projects = User.current.projects.sort_by(&:lft) + end + render :template => 'projects/index.rhtml', :layout => !request.xhr? } format.xml { @projects = Project.visible.find(:all, :order => 'lft') diff -r cede720e8f53 -r bf38a7365edf app/helpers/application_helper.rb --- a/app/helpers/application_helper.rb Mon Dec 20 22:15:06 2010 +0000 +++ b/app/helpers/application_helper.rb Wed Jan 19 15:34:59 2011 +0000 @@ -273,7 +273,7 @@ def principals_check_box_tags(name, principals) s = '' principals.sort.each do |principal| - s << "\n" + s << "\n" end s end diff -r cede720e8f53 -r bf38a7365edf app/helpers/projects_helper.rb --- a/app/helpers/projects_helper.rb Mon Dec 20 22:15:06 2010 +0000 +++ b/app/helpers/projects_helper.rb Wed Jan 19 15:34:59 2011 +0000 @@ -121,7 +121,12 @@ classes = (ancestors.empty? ? 'root' : 'child') s << "
" << l("label_managers") << " | " + s << sort_header_tag('created_on', :default_order => 'desc') + s << sort_header_tag('updated_on', :default_order => 'desc') - if projects.any? - ancestors = [] - original_project = @project - projects.each do |project| - # set the project environment to please macros. + s << "|||
---|---|---|---|
" << link_to_project(project, {}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}") << " | " + s << ""
+
+ u = project.users_by_role
+ if u
+ u.keys.each do |r|
+ if r.allowed_to?(:edit_project)
+ mgrs = []
+ u[r].sort.each do |m|
+ mgrs << link_to_user(m)
+ end
+ if mgrs.size < 3
+ s << ' " +
- link_to_project(project, {}, :class => "project #{User.current.member_of?(project) ? 'my-project' : nil}")
- s << " \n"
- ancestors << project
- else
- t = TRUE
- end
- end
+ s << "#{textilizable(project.short_description, :project => project)} " unless project.description.blank?
- s << " | "
+ s << "" << format_date(project.created_on) << " | " + s << "" << format_date(project.updated_on) << " | " - s << ("\n" * ancestors.size) - @project = original_project + s << "
" + s << textilizable(project.short_description, :project => project) unless project.description.blank? + s << " | " + s << "" + s << " |
<%= pagination_links_full @project_pages, @project_count %>
<% other_formats_links do |f| %> diff -r cede720e8f53 -r bf38a7365edf app/views/projects/settings/_members.rhtml --- a/app/views/projects/settings/_members.rhtml Mon Dec 20 22:15:06 2010 +0000 +++ b/app/views/projects/settings/_members.rhtml Wed Jan 19 15:34:59 2011 +0000 @@ -50,7 +50,7 @@ -<% principals = Principal.active.find(:all, :limit => 10, :order => 'type, login, lastname ASC') - @project.principals %> +<% principals = Principal.active.find(:all, :limit => 100, :order => 'type, login, lastname ASC') - @project.principals %><%= l(:label_role_plural) %>: diff -r cede720e8f53 -r bf38a7365edf app/views/projects/settings/_repository.rhtml --- a/app/views/projects/settings/_repository.rhtml Mon Dec 20 22:15:06 2010 +0000 +++ b/app/views/projects/settings/_repository.rhtml Wed Jan 19 15:34:59 2011 +0000 @@ -7,7 +7,7 @@
<%= label_tag('repository_scm', l(:label_scm)) %><%= scm_select_tag(@repository) %>
<%= repository_field_tags(f, @repository) if @repository %> diff -r cede720e8f53 -r bf38a7365edf config/locales/en-GB.yml --- a/config/locales/en-GB.yml Mon Dec 20 22:15:06 2010 +0000 +++ b/config/locales/en-GB.yml Wed Jan 19 15:34:59 2011 +0000 @@ -237,6 +237,7 @@ field_role: Role field_homepage: Homepage field_is_public: Public + field_is_private: Private field_parent: Subproject of field_is_in_roadmap: Issues displayed in roadmap field_login: Login @@ -430,6 +431,7 @@ other: "{{count}} projects" label_project_all: All Projects label_project_latest: Latest projects + label_managers: Managed by label_issue: Issue label_issue_new: New issue label_issue_plural: Issues @@ -841,6 +843,7 @@ text_tip_issue_end_day: task ending this day text_tip_issue_begin_end_day: task beginning and ending this day text_project_identifier_info: 'Only lower case letters (a-z), numbers and dashes are allowed.