OSDN Git Service

Display stats about objects that can be copied.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 25 Oct 2009 11:10:35 +0000 (11:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 25 Oct 2009 11:10:35 +0000 (11:10 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2975 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/projects_controller.rb
app/views/projects/copy.rhtml
public/stylesheets/application.css

index fa8f35f..6d8451c 100644 (file)
@@ -1,5 +1,5 @@
-# redMine - project management software
-# Copyright (C) 2006-2007  Jean-Philippe Lang
+# Redmine - project management software
+# Copyright (C) 2006-2009  Jean-Philippe Lang
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -94,8 +94,9 @@ class ProjectsController < ApplicationController
     @root_projects = Project.find(:all,
                                   :conditions => "parent_id IS NULL AND status = #{Project::STATUS_ACTIVE}",
                                   :order => 'name')
+    @source_project = Project.find(params[:id])
     if request.get?
-      @project = Project.copy_from(params[:id])
+      @project = Project.copy_from(@source_project)
       if @project
         @project.identifier = Project.next_identifier if Setting.sequential_project_identifiers?
       else
@@ -104,7 +105,7 @@ class ProjectsController < ApplicationController
     else
       @project = Project.new(params[:project])
       @project.enabled_module_names = params[:enabled_modules]
-      if @project.copy(params[:id], :only => params[:only])
+      if @project.copy(@source_project, :only => params[:only])
         @project.set_parent!(params[:project]['parent_id']) if User.current.admin? && params[:project].has_key?('parent_id')
         flash[:notice] = l(:notice_successful_create)
         redirect_to :controller => 'admin', :action => 'projects'
index d03e4d0..f88817c 100644 (file)
 </fieldset>
 
 <fieldset class="box"><legend><%= l(:button_copy) %></legend>
-  <label class="floating"><%= check_box_tag 'only[]', 'members', true %> <%= l(:label_member_plural) %></label>
-  <label class="floating"><%= check_box_tag 'only[]', 'versions', true %> <%= l(:label_version_plural) %></label>
-  <label class="floating"><%= check_box_tag 'only[]', 'issue_categories', true %> <%= l(:label_issue_category_plural) %></label>
-  <label class="floating"><%= check_box_tag 'only[]', 'issues', true %> <%= l(:label_issue_plural) %></label>
-  <label class="floating"><%= check_box_tag 'only[]', 'queries', true %> <%= l(:label_query_plural) %></label>
-  <label class="floating"><%= check_box_tag 'only[]', 'wiki', true %> <%= l(:label_wiki) %></label>
+  <label class="block"><%= check_box_tag 'only[]', 'members', true %> <%= l(:label_member_plural) %> (<%= @source_project.members.count %>)</label>
+  <label class="block"><%= check_box_tag 'only[]', 'versions', true %> <%= l(:label_version_plural) %> (<%= @source_project.versions.count %>)</label>
+  <label class="block"><%= check_box_tag 'only[]', 'issue_categories', true %> <%= l(:label_issue_category_plural) %> (<%= @source_project.issue_categories.count %>)</label>
+  <label class="block"><%= check_box_tag 'only[]', 'issues', true %> <%= l(:label_issue_plural) %> (<%= @source_project.issues.count %>)</label>
+  <label class="block"><%= check_box_tag 'only[]', 'queries', true %> <%= l(:label_query_plural) %> (<%= @source_project.queries.count %>)</label>
+  <label class="block"><%= check_box_tag 'only[]', 'wiki', true %> <%= l(:label_wiki_page_plural) %> (<%= @source_project.wiki.nil? ? 0 : @source_project.wiki.pages.count %>)</label>
   <%= hidden_field_tag 'only[]', '' %>
 </fieldset>
 
index 1ad81f0..a5e845d 100644 (file)
@@ -321,6 +321,15 @@ text-align: left;
 width: 270px;
 }
 
+.tabular label.block{
+font-weight: normal;
+margin-left: 0px;
+text-align: left;
+float: none;
+display: block;
+width: auto;
+}
+
 input#time_entry_comments { width: 90%;}
 
 #preview fieldset {margin-top: 1em; background: url(../images/draft.png)}