@@ -1,159 +1,159 | |||||
1 | # redMine - project management software |
|
1 | # redMine - project management software | |
2 | # Copyright (C) 2006 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006 Jean-Philippe Lang | |
3 | # |
|
3 | # | |
4 | # This program is free software; you can redistribute it and/or |
|
4 | # This program is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU General Public License |
|
5 | # modify it under the terms of the GNU General Public License | |
6 | # as published by the Free Software Foundation; either version 2 |
|
6 | # as published by the Free Software Foundation; either version 2 | |
7 | # of the License, or (at your option) any later version. |
|
7 | # of the License, or (at your option) any later version. | |
8 | # |
|
8 | # | |
9 | # This program is distributed in the hope that it will be useful, |
|
9 | # This program is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | # GNU General Public License for more details. |
|
12 | # GNU General Public License for more details. | |
13 | # |
|
13 | # | |
14 | # You should have received a copy of the GNU General Public License |
|
14 | # You should have received a copy of the GNU General Public License | |
15 | # along with this program; if not, write to the Free Software |
|
15 | # along with this program; if not, write to the Free Software | |
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
17 |
|
17 | |||
18 | class VersionsController < ApplicationController |
|
18 | class VersionsController < ApplicationController | |
19 | menu_item :roadmap |
|
19 | menu_item :roadmap | |
20 | model_object Version |
|
20 | model_object Version | |
21 | before_filter :find_model_object, :except => [:index, :new, :create, :close_completed] |
|
21 | before_filter :find_model_object, :except => [:index, :new, :create, :close_completed] | |
22 | before_filter :find_project_from_association, :except => [:index, :new, :create, :close_completed] |
|
22 | before_filter :find_project_from_association, :except => [:index, :new, :create, :close_completed] | |
23 | before_filter :find_project, :only => [:index, :new, :create, :close_completed] |
|
23 | before_filter :find_project, :only => [:index, :new, :create, :close_completed] | |
24 | before_filter :authorize |
|
24 | before_filter :authorize | |
25 |
|
25 | |||
26 | helper :custom_fields |
|
26 | helper :custom_fields | |
27 | helper :projects |
|
27 | helper :projects | |
28 |
|
28 | |||
29 | def index |
|
29 | def index | |
30 | @trackers = @project.trackers.find(:all, :order => 'position') |
|
30 | @trackers = @project.trackers.find(:all, :order => 'position') | |
31 | retrieve_selected_tracker_ids(@trackers, @trackers.select {|t| t.is_in_roadmap?}) |
|
31 | retrieve_selected_tracker_ids(@trackers, @trackers.select {|t| t.is_in_roadmap?}) | |
32 | @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1') |
|
32 | @with_subprojects = params[:with_subprojects].nil? ? Setting.display_subprojects_issues? : (params[:with_subprojects] == '1') | |
33 | project_ids = @with_subprojects ? @project.self_and_descendants.collect(&:id) : [@project.id] |
|
33 | project_ids = @with_subprojects ? @project.self_and_descendants.collect(&:id) : [@project.id] | |
34 |
|
34 | |||
35 | @versions = @project.shared_versions || [] |
|
35 | @versions = @project.shared_versions || [] | |
36 | @versions += @project.rolled_up_versions.visible if @with_subprojects |
|
36 | @versions += @project.rolled_up_versions.visible if @with_subprojects | |
37 | @versions = @versions.uniq.sort |
|
37 | @versions = @versions.uniq.sort | |
38 | @versions.reject! {|version| version.closed? || version.completed? } unless params[:completed] |
|
38 | @versions.reject! {|version| version.closed? || version.completed? } unless params[:completed] | |
39 |
|
39 | |||
40 | @issues_by_version = {} |
|
40 | @issues_by_version = {} | |
41 | unless @selected_tracker_ids.empty? |
|
41 | unless @selected_tracker_ids.empty? | |
42 | @versions.each do |version| |
|
42 | @versions.each do |version| | |
43 | issues = version.fixed_issues.visible.find(:all, |
|
43 | issues = version.fixed_issues.visible.find(:all, | |
44 | :include => [:project, :status, :tracker, :priority], |
|
44 | :include => [:project, :status, :tracker, :priority], | |
45 | :conditions => {:tracker_id => @selected_tracker_ids, :project_id => project_ids}, |
|
45 | :conditions => {:tracker_id => @selected_tracker_ids, :project_id => project_ids}, | |
46 | :order => "#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id") |
|
46 | :order => "#{Project.table_name}.lft, #{Tracker.table_name}.position, #{Issue.table_name}.id") | |
47 | @issues_by_version[version] = issues |
|
47 | @issues_by_version[version] = issues | |
48 | end |
|
48 | end | |
49 | end |
|
49 | end | |
50 | @versions.reject! {|version| !project_ids.include?(version.project_id) && @issues_by_version[version].blank?} |
|
50 | @versions.reject! {|version| !project_ids.include?(version.project_id) && @issues_by_version[version].blank?} | |
51 | end |
|
51 | end | |
52 |
|
52 | |||
53 | def show |
|
53 | def show | |
54 | @issues = @version.fixed_issues.visible.find(:all, |
|
54 | @issues = @version.fixed_issues.visible.find(:all, | |
55 | :include => [:status, :tracker, :priority], |
|
55 | :include => [:status, :tracker, :priority], | |
56 | :order => "#{Tracker.table_name}.position, #{Issue.table_name}.id") |
|
56 | :order => "#{Tracker.table_name}.position, #{Issue.table_name}.id") | |
57 | end |
|
57 | end | |
58 |
|
58 | |||
59 | def new |
|
59 | def new | |
60 | @version = @project.versions.build |
|
60 | @version = @project.versions.build | |
61 | if params[:version] |
|
61 | if params[:version] | |
62 | attributes = params[:version].dup |
|
62 | attributes = params[:version].dup | |
63 | attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing']) |
|
63 | attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing']) | |
64 | @version.attributes = attributes |
|
64 | @version.attributes = attributes | |
65 | end |
|
65 | end | |
66 | end |
|
66 | end | |
67 |
|
67 | |||
68 | def create |
|
68 | def create | |
69 | # TODO: refactor with code above in #new |
|
69 | # TODO: refactor with code above in #new | |
70 | @version = @project.versions.build |
|
70 | @version = @project.versions.build | |
71 | if params[:version] |
|
71 | if params[:version] | |
72 | attributes = params[:version].dup |
|
72 | attributes = params[:version].dup | |
73 | attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing']) |
|
73 | attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing']) | |
74 | @version.attributes = attributes |
|
74 | @version.attributes = attributes | |
75 | end |
|
75 | end | |
76 |
|
76 | |||
77 | if request.post? |
|
77 | if request.post? | |
78 | if @version.save |
|
78 | if @version.save | |
79 | respond_to do |format| |
|
79 | respond_to do |format| | |
80 | format.html do |
|
80 | format.html do | |
81 | flash[:notice] = l(:notice_successful_create) |
|
81 | flash[:notice] = l(:notice_successful_create) | |
82 |
redirect_t |
|
82 | redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project | |
83 | end |
|
83 | end | |
84 | format.js do |
|
84 | format.js do | |
85 | # IE doesn't support the replace_html rjs method for select box options |
|
85 | # IE doesn't support the replace_html rjs method for select box options | |
86 | render(:update) {|page| page.replace "issue_fixed_version_id", |
|
86 | render(:update) {|page| page.replace "issue_fixed_version_id", | |
87 | content_tag('select', '<option></option>' + version_options_for_select(@project.shared_versions.open, @version), :id => 'issue_fixed_version_id', :name => 'issue[fixed_version_id]') |
|
87 | content_tag('select', '<option></option>' + version_options_for_select(@project.shared_versions.open, @version), :id => 'issue_fixed_version_id', :name => 'issue[fixed_version_id]') | |
88 | } |
|
88 | } | |
89 | end |
|
89 | end | |
90 | end |
|
90 | end | |
91 | else |
|
91 | else | |
92 | respond_to do |format| |
|
92 | respond_to do |format| | |
93 | format.html { render :action => 'new' } |
|
93 | format.html { render :action => 'new' } | |
94 | format.js do |
|
94 | format.js do | |
95 | render(:update) {|page| page.alert(@version.errors.full_messages.join('\n')) } |
|
95 | render(:update) {|page| page.alert(@version.errors.full_messages.join('\n')) } | |
96 | end |
|
96 | end | |
97 | end |
|
97 | end | |
98 | end |
|
98 | end | |
99 | end |
|
99 | end | |
100 | end |
|
100 | end | |
101 |
|
101 | |||
102 | def edit |
|
102 | def edit | |
103 | end |
|
103 | end | |
104 |
|
104 | |||
105 | def update |
|
105 | def update | |
106 | if request.put? && params[:version] |
|
106 | if request.put? && params[:version] | |
107 | attributes = params[:version].dup |
|
107 | attributes = params[:version].dup | |
108 | attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing']) |
|
108 | attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing']) | |
109 | if @version.update_attributes(attributes) |
|
109 | if @version.update_attributes(attributes) | |
110 | flash[:notice] = l(:notice_successful_update) |
|
110 | flash[:notice] = l(:notice_successful_update) | |
111 |
redirect_t |
|
111 | redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project | |
112 | else |
|
112 | else | |
113 | respond_to do |format| |
|
113 | respond_to do |format| | |
114 | format.html { render :action => 'edit' } |
|
114 | format.html { render :action => 'edit' } | |
115 | end |
|
115 | end | |
116 | end |
|
116 | end | |
117 | end |
|
117 | end | |
118 | end |
|
118 | end | |
119 |
|
119 | |||
120 | def close_completed |
|
120 | def close_completed | |
121 | if request.put? |
|
121 | if request.put? | |
122 | @project.close_completed_versions |
|
122 | @project.close_completed_versions | |
123 | end |
|
123 | end | |
124 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project |
|
124 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project | |
125 | end |
|
125 | end | |
126 |
|
126 | |||
127 | def destroy |
|
127 | def destroy | |
128 | if @version.fixed_issues.empty? |
|
128 | if @version.fixed_issues.empty? | |
129 | @version.destroy |
|
129 | @version.destroy | |
130 |
redirect_t |
|
130 | redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project | |
131 | else |
|
131 | else | |
132 | flash[:error] = l(:notice_unable_delete_version) |
|
132 | flash[:error] = l(:notice_unable_delete_version) | |
133 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project |
|
133 | redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project | |
134 | end |
|
134 | end | |
135 | end |
|
135 | end | |
136 |
|
136 | |||
137 | def status_by |
|
137 | def status_by | |
138 | respond_to do |format| |
|
138 | respond_to do |format| | |
139 | format.html { render :action => 'show' } |
|
139 | format.html { render :action => 'show' } | |
140 | format.js { render(:update) {|page| page.replace_html 'status_by', render_issue_status_by(@version, params[:status_by])} } |
|
140 | format.js { render(:update) {|page| page.replace_html 'status_by', render_issue_status_by(@version, params[:status_by])} } | |
141 | end |
|
141 | end | |
142 | end |
|
142 | end | |
143 |
|
143 | |||
144 | private |
|
144 | private | |
145 | def find_project |
|
145 | def find_project | |
146 | @project = Project.find(params[:project_id]) |
|
146 | @project = Project.find(params[:project_id]) | |
147 | rescue ActiveRecord::RecordNotFound |
|
147 | rescue ActiveRecord::RecordNotFound | |
148 | render_404 |
|
148 | render_404 | |
149 | end |
|
149 | end | |
150 |
|
150 | |||
151 | def retrieve_selected_tracker_ids(selectable_trackers, default_trackers=nil) |
|
151 | def retrieve_selected_tracker_ids(selectable_trackers, default_trackers=nil) | |
152 | if ids = params[:tracker_ids] |
|
152 | if ids = params[:tracker_ids] | |
153 | @selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s } |
|
153 | @selected_tracker_ids = (ids.is_a? Array) ? ids.collect { |id| id.to_i.to_s } : ids.split('/').collect { |id| id.to_i.to_s } | |
154 | else |
|
154 | else | |
155 | @selected_tracker_ids = (default_trackers || selectable_trackers).collect {|t| t.id.to_s } |
|
155 | @selected_tracker_ids = (default_trackers || selectable_trackers).collect {|t| t.id.to_s } | |
156 | end |
|
156 | end | |
157 | end |
|
157 | end | |
158 |
|
158 | |||
159 | end |
|
159 | end |
@@ -1,15 +1,16 | |||||
|
1 | <%= back_url_hidden_field_tag %> | |||
1 | <%= error_messages_for 'version' %> |
|
2 | <%= error_messages_for 'version' %> | |
2 |
|
3 | |||
3 | <div class="box"> |
|
4 | <div class="box"> | |
4 | <p><%= f.text_field :name, :size => 60, :required => true %></p> |
|
5 | <p><%= f.text_field :name, :size => 60, :required => true %></p> | |
5 | <p><%= f.text_field :description, :size => 60 %></p> |
|
6 | <p><%= f.text_field :description, :size => 60 %></p> | |
6 | <p><%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %></p> |
|
7 | <p><%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %></p> | |
7 | <p><%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %></p> |
|
8 | <p><%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %></p> | |
8 | <p><%= f.text_field :effective_date, :size => 10 %><%= calendar_for('version_effective_date') %></p> |
|
9 | <p><%= f.text_field :effective_date, :size => 10 %><%= calendar_for('version_effective_date') %></p> | |
9 | <p><%= f.select :sharing, @version.allowed_sharings.collect {|v| [format_version_sharing(v), v]} %></p> |
|
10 | <p><%= f.select :sharing, @version.allowed_sharings.collect {|v| [format_version_sharing(v), v]} %></p> | |
10 |
|
11 | |||
11 | <% @version.custom_field_values.each do |value| %> |
|
12 | <% @version.custom_field_values.each do |value| %> | |
12 | <p><%= custom_field_tag_with_label :version, value %></p> |
|
13 | <p><%= custom_field_tag_with_label :version, value %></p> | |
13 | <% end %> |
|
14 | <% end %> | |
14 |
|
15 | |||
15 | </div> |
|
16 | </div> |
@@ -1,54 +1,58 | |||||
|
1 | <div class="contextual"> | |||
|
2 | <%= link_to l(:label_version_new), {:controller => 'versions', :action => 'new'}, :class => 'icon icon-add' if User.current.allowed_to?(:manage_versions, @project) %> | |||
|
3 | </div> | |||
|
4 | ||||
1 | <h2><%=l(:label_roadmap)%></h2> |
|
5 | <h2><%=l(:label_roadmap)%></h2> | |
2 |
|
6 | |||
3 | <% if @versions.empty? %> |
|
7 | <% if @versions.empty? %> | |
4 | <p class="nodata"><%= l(:label_no_data) %></p> |
|
8 | <p class="nodata"><%= l(:label_no_data) %></p> | |
5 | <% else %> |
|
9 | <% else %> | |
6 | <div id="roadmap"> |
|
10 | <div id="roadmap"> | |
7 | <% @versions.each do |version| %> |
|
11 | <% @versions.each do |version| %> | |
8 | <h3 class="version"><%= tag 'a', :name => version.name %><%= link_to_version version %></h3> |
|
12 | <h3 class="version"><%= tag 'a', :name => version.name %><%= link_to_version version %></h3> | |
9 | <%= render :partial => 'versions/overview', :locals => {:version => version} %> |
|
13 | <%= render :partial => 'versions/overview', :locals => {:version => version} %> | |
10 | <%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %> |
|
14 | <%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %> | |
11 |
|
15 | |||
12 | <% if (issues = @issues_by_version[version]) && issues.size > 0 %> |
|
16 | <% if (issues = @issues_by_version[version]) && issues.size > 0 %> | |
13 | <% form_tag({}) do -%> |
|
17 | <% form_tag({}) do -%> | |
14 | <table class="list related-issues"> |
|
18 | <table class="list related-issues"> | |
15 | <caption><%= l(:label_related_issues) %></caption> |
|
19 | <caption><%= l(:label_related_issues) %></caption> | |
16 | <%- issues.each do |issue| -%> |
|
20 | <%- issues.each do |issue| -%> | |
17 | <tr class="hascontextmenu"> |
|
21 | <tr class="hascontextmenu"> | |
18 | <td class="checkbox"><%= check_box_tag 'ids[]', issue.id %></td> |
|
22 | <td class="checkbox"><%= check_box_tag 'ids[]', issue.id %></td> | |
19 | <td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td> |
|
23 | <td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td> | |
20 | </tr> |
|
24 | </tr> | |
21 | <%- end -%> |
|
25 | <%- end -%> | |
22 | </table> |
|
26 | </table> | |
23 | <% end %> |
|
27 | <% end %> | |
24 | <% end %> |
|
28 | <% end %> | |
25 | <%= call_hook :view_projects_roadmap_version_bottom, :version => version %> |
|
29 | <%= call_hook :view_projects_roadmap_version_bottom, :version => version %> | |
26 | <% end %> |
|
30 | <% end %> | |
27 | </div> |
|
31 | </div> | |
28 | <% end %> |
|
32 | <% end %> | |
29 |
|
33 | |||
30 | <% content_for :sidebar do %> |
|
34 | <% content_for :sidebar do %> | |
31 | <% form_tag({}, :method => :get) do %> |
|
35 | <% form_tag({}, :method => :get) do %> | |
32 | <h3><%= l(:label_roadmap) %></h3> |
|
36 | <h3><%= l(:label_roadmap) %></h3> | |
33 | <% @trackers.each do |tracker| %> |
|
37 | <% @trackers.each do |tracker| %> | |
34 | <label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s), :id => nil %> |
|
38 | <label><%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s), :id => nil %> | |
35 | <%=h tracker.name %></label><br /> |
|
39 | <%=h tracker.name %></label><br /> | |
36 | <% end %> |
|
40 | <% end %> | |
37 | <br /> |
|
41 | <br /> | |
38 | <label for="completed"><%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %></label> |
|
42 | <label for="completed"><%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %></label> | |
39 | <% if @project.descendants.active.any? %> |
|
43 | <% if @project.descendants.active.any? %> | |
40 | <%= hidden_field_tag 'with_subprojects', 0 %> |
|
44 | <%= hidden_field_tag 'with_subprojects', 0 %> | |
41 | <br /><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label> |
|
45 | <br /><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label> | |
42 | <% end %> |
|
46 | <% end %> | |
43 | <p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p> |
|
47 | <p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p> | |
44 | <% end %> |
|
48 | <% end %> | |
45 |
|
49 | |||
46 | <h3><%= l(:label_version_plural) %></h3> |
|
50 | <h3><%= l(:label_version_plural) %></h3> | |
47 | <% @versions.each do |version| %> |
|
51 | <% @versions.each do |version| %> | |
48 | <%= link_to format_version_name(version), "##{version.name}" %><br /> |
|
52 | <%= link_to format_version_name(version), "##{version.name}" %><br /> | |
49 | <% end %> |
|
53 | <% end %> | |
50 | <% end %> |
|
54 | <% end %> | |
51 |
|
55 | |||
52 | <% html_title(l(:label_roadmap)) %> |
|
56 | <% html_title(l(:label_roadmap)) %> | |
53 |
|
57 | |||
54 | <%= context_menu issues_context_menu_path %> |
|
58 | <%= context_menu issues_context_menu_path %> |
@@ -1,54 +1,56 | |||||
1 | <div class="contextual"> |
|
1 | <div class="contextual"> | |
2 | <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => @version}, :class => 'icon icon-edit' %> |
|
2 | <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => @version}, :class => 'icon icon-edit' %> | |
3 | <%= link_to_if_authorized(l(:button_edit_associated_wikipage, :page_title => @version.wiki_page_title), {:controller => 'wiki', :action => 'edit', :project_id => @version.project, :id => Wiki.titleize(@version.wiki_page_title)}, :class => 'icon icon-edit') unless @version.wiki_page_title.blank? || @version.project.wiki.nil? %> |
|
3 | <%= link_to_if_authorized(l(:button_edit_associated_wikipage, :page_title => @version.wiki_page_title), {:controller => 'wiki', :action => 'edit', :project_id => @version.project, :id => Wiki.titleize(@version.wiki_page_title)}, :class => 'icon icon-edit') unless @version.wiki_page_title.blank? || @version.project.wiki.nil? %> | |
|
4 | <%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => @version, :back_url => url_for(:controller => 'versions', :action => 'index', :project_id => @version.project)}, | |||
|
5 | :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %> | |||
4 | <%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %> |
|
6 | <%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %> | |
5 | </div> |
|
7 | </div> | |
6 |
|
8 | |||
7 | <h2><%= h(@version.name) %></h2> |
|
9 | <h2><%= h(@version.name) %></h2> | |
8 |
|
10 | |||
9 | <div id="roadmap"> |
|
11 | <div id="roadmap"> | |
10 | <%= render :partial => 'versions/overview', :locals => {:version => @version} %> |
|
12 | <%= render :partial => 'versions/overview', :locals => {:version => @version} %> | |
11 | <%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %> |
|
13 | <%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %> | |
12 |
|
14 | |||
13 | <div id="version-summary"> |
|
15 | <div id="version-summary"> | |
14 | <% if @version.estimated_hours > 0 || User.current.allowed_to?(:view_time_entries, @project) %> |
|
16 | <% if @version.estimated_hours > 0 || User.current.allowed_to?(:view_time_entries, @project) %> | |
15 | <fieldset><legend><%= l(:label_time_tracking) %></legend> |
|
17 | <fieldset><legend><%= l(:label_time_tracking) %></legend> | |
16 | <table> |
|
18 | <table> | |
17 | <tr> |
|
19 | <tr> | |
18 | <td width="130px" align="right"><%= l(:field_estimated_hours) %></td> |
|
20 | <td width="130px" align="right"><%= l(:field_estimated_hours) %></td> | |
19 | <td width="240px" class="total-hours"width="130px" align="right"><%= html_hours(l_hours(@version.estimated_hours)) %></td> |
|
21 | <td width="240px" class="total-hours"width="130px" align="right"><%= html_hours(l_hours(@version.estimated_hours)) %></td> | |
20 | </tr> |
|
22 | </tr> | |
21 | <% if User.current.allowed_to?(:view_time_entries, @project) %> |
|
23 | <% if User.current.allowed_to?(:view_time_entries, @project) %> | |
22 | <tr> |
|
24 | <tr> | |
23 | <td width="130px" align="right"><%= l(:label_spent_time) %></td> |
|
25 | <td width="130px" align="right"><%= l(:label_spent_time) %></td> | |
24 | <td width="240px" class="total-hours"><%= html_hours(l_hours(@version.spent_hours)) %></td> |
|
26 | <td width="240px" class="total-hours"><%= html_hours(l_hours(@version.spent_hours)) %></td> | |
25 | </tr> |
|
27 | </tr> | |
26 | <% end %> |
|
28 | <% end %> | |
27 | </table> |
|
29 | </table> | |
28 | </fieldset> |
|
30 | </fieldset> | |
29 | <% end %> |
|
31 | <% end %> | |
30 |
|
32 | |||
31 | <div id="status_by"> |
|
33 | <div id="status_by"> | |
32 | <%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.count > 0 %> |
|
34 | <%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.count > 0 %> | |
33 | </div> |
|
35 | </div> | |
34 | </div> |
|
36 | </div> | |
35 |
|
37 | |||
36 | <% if @issues.present? %> |
|
38 | <% if @issues.present? %> | |
37 | <% form_tag({}) do -%> |
|
39 | <% form_tag({}) do -%> | |
38 | <table class="list related-issues"> |
|
40 | <table class="list related-issues"> | |
39 | <caption><%= l(:label_related_issues) %></caption> |
|
41 | <caption><%= l(:label_related_issues) %></caption> | |
40 | <%- @issues.each do |issue| -%> |
|
42 | <%- @issues.each do |issue| -%> | |
41 | <tr class="hascontextmenu"> |
|
43 | <tr class="hascontextmenu"> | |
42 | <td class="checkbox"><%= check_box_tag 'ids[]', issue.id %></td> |
|
44 | <td class="checkbox"><%= check_box_tag 'ids[]', issue.id %></td> | |
43 | <td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td> |
|
45 | <td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td> | |
44 | </tr> |
|
46 | </tr> | |
45 | <% end %> |
|
47 | <% end %> | |
46 | </table> |
|
48 | </table> | |
47 | <% end %> |
|
49 | <% end %> | |
48 | <%= context_menu issues_context_menu_path %> |
|
50 | <%= context_menu issues_context_menu_path %> | |
49 | <% end %> |
|
51 | <% end %> | |
50 | </div> |
|
52 | </div> | |
51 |
|
53 | |||
52 | <%= call_hook :view_versions_show_bottom, :version => @version %> |
|
54 | <%= call_hook :view_versions_show_bottom, :version => @version %> | |
53 |
|
55 | |||
54 | <% html_title @version.name %> |
|
56 | <% html_title @version.name %> |
General Comments 0
You need to be logged in to leave comments.
Login now