Revision 912:5e80956cc792 app/views/versions
| app/views/versions/_form.html.erb | ||
|---|---|---|
| 1 |
<%= back_url_hidden_field_tag %> |
|
| 2 |
<%= error_messages_for 'version' %> |
|
| 3 |
|
|
| 4 |
<div class="box"> |
|
| 5 |
<p><%= f.text_field :name, :size => 60, :required => true %></p> |
|
| 6 |
<p><%= f.text_field :description, :size => 60 %></p> |
|
| 7 |
<p><%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %></p>
|
|
| 8 |
<p><%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %></p> |
|
| 9 |
<p><%= f.text_field :effective_date, :size => 10 %><%= calendar_for('version_effective_date') %></p>
|
|
| 10 |
<p><%= f.select :sharing, @version.allowed_sharings.collect {|v| [format_version_sharing(v), v]} %></p>
|
|
| 11 |
|
|
| 12 |
<% @version.custom_field_values.each do |value| %> |
|
| 13 |
<p><%= custom_field_tag_with_label :version, value %></p> |
|
| 14 |
<% end %> |
|
| 15 |
|
|
| 16 |
</div> |
|
| app/views/versions/_form.rhtml | ||
|---|---|---|
| 1 |
<%= error_messages_for 'version' %> |
|
| 2 |
|
|
| 3 |
<div class="box"> |
|
| 4 |
<p><%= f.text_field :name, :size => 60, :required => true %></p> |
|
| 5 |
<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.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.select :sharing, @version.allowed_sharings.collect {|v| [format_version_sharing(v), v]} %></p>
|
|
| 10 |
|
|
| 11 |
<% @version.custom_field_values.each do |value| %> |
|
| 12 |
<p><%= custom_field_tag_with_label :version, value %></p> |
|
| 13 |
<% end %> |
|
| 14 |
|
|
| 15 |
</div> |
|
| app/views/versions/_issue_counts.html.erb | ||
|---|---|---|
| 1 |
<form id="status_by_form"> |
|
| 2 |
<fieldset> |
|
| 3 |
<legend> |
|
| 4 |
<%= l(:label_issues_by, |
|
| 5 |
select_tag('status_by',
|
|
| 6 |
status_by_options_for_select(criteria), |
|
| 7 |
:id => 'status_by_select', |
|
| 8 |
:onchange => remote_function(:url => status_by_version_path(version), |
|
| 9 |
:with => "Form.serialize('status_by_form')"))) %>
|
|
| 10 |
</legend> |
|
| 11 |
<% if counts.empty? %> |
|
| 12 |
<p><em><%= l(:label_no_data) %></em></p> |
|
| 13 |
<% else %> |
|
| 14 |
<table> |
|
| 15 |
<% counts.each do |count| %> |
|
| 16 |
<tr> |
|
| 17 |
<td width="130px" align="right" > |
|
| 18 |
<%= link_to h(count[:group]), {:controller => 'issues',
|
|
| 19 |
:action => 'index', |
|
| 20 |
:project_id => version.project, |
|
| 21 |
:set_filter => 1, |
|
| 22 |
:status_id => '*', |
|
| 23 |
:fixed_version_id => version}.merge("#{criteria}_id".to_sym => count[:group]) %>
|
|
| 24 |
</td> |
|
| 25 |
<td width="240px"> |
|
| 26 |
<%= progress_bar((count[:closed].to_f / count[:total])*100, |
|
| 27 |
:legend => "#{count[:closed]}/#{count[:total]}",
|
|
| 28 |
:width => "#{(count[:total].to_f / max * 200).floor}px;") %>
|
|
| 29 |
</td> |
|
| 30 |
</tr> |
|
| 31 |
<% end %> |
|
| 32 |
</table> |
|
| 33 |
<% end %> |
|
| 34 |
</fieldset> |
|
| 35 |
</form> |
|
| app/views/versions/_issue_counts.rhtml | ||
|---|---|---|
| 1 |
<form id="status_by_form"> |
|
| 2 |
<fieldset> |
|
| 3 |
<legend> |
|
| 4 |
<%= l(:label_issues_by, |
|
| 5 |
select_tag('status_by',
|
|
| 6 |
status_by_options_for_select(criteria), |
|
| 7 |
:id => 'status_by_select', |
|
| 8 |
:onchange => remote_function(:url => status_by_project_version_path(version.project, version), |
|
| 9 |
:with => "Form.serialize('status_by_form')"))) %>
|
|
| 10 |
</legend> |
|
| 11 |
<% if counts.empty? %> |
|
| 12 |
<p><em><%= l(:label_no_data) %></em></p> |
|
| 13 |
<% else %> |
|
| 14 |
<table> |
|
| 15 |
<% counts.each do |count| %> |
|
| 16 |
<tr> |
|
| 17 |
<td width="130px" align="right" > |
|
| 18 |
<%= link_to count[:group], {:controller => 'issues',
|
|
| 19 |
:action => 'index', |
|
| 20 |
:project_id => version.project, |
|
| 21 |
:set_filter => 1, |
|
| 22 |
:status_id => '*', |
|
| 23 |
:fixed_version_id => version}.merge("#{criteria}_id".to_sym => count[:group]) %>
|
|
| 24 |
</td> |
|
| 25 |
<td width="240px"> |
|
| 26 |
<%= progress_bar((count[:closed].to_f / count[:total])*100, |
|
| 27 |
:legend => "#{count[:closed]}/#{count[:total]}",
|
|
| 28 |
:width => "#{(count[:total].to_f / max * 200).floor}px;") %>
|
|
| 29 |
</td> |
|
| 30 |
</tr> |
|
| 31 |
<% end %> |
|
| 32 |
</table> |
|
| 33 |
<% end %> |
|
| 34 |
</fieldset> |
|
| 35 |
</form> |
|
| app/views/versions/_overview.html.erb | ||
|---|---|---|
| 1 |
<% if version.completed? %> |
|
| 2 |
<p><%= format_date(version.effective_date) %></p> |
|
| 3 |
<% elsif version.effective_date %> |
|
| 4 |
<p><strong><%= due_date_distance_in_words(version.effective_date) %></strong> (<%= format_date(version.effective_date) %>)</p> |
|
| 5 |
<% end %> |
|
| 6 |
|
|
| 7 |
<p><%=h version.description %></p> |
|
| 8 |
<ul> |
|
| 9 |
<% version.custom_values.each do |custom_value| %> |
|
| 10 |
<% if !custom_value.value.blank? %> |
|
| 11 |
<li><%=h custom_value.custom_field.name %>: <%=h show_value(custom_value) %></li> |
|
| 12 |
<% end %> |
|
| 13 |
<% end %> |
|
| 14 |
</ul> |
|
| 15 |
|
|
| 16 |
<% if version.fixed_issues.count > 0 %> |
|
| 17 |
<%= progress_bar([version.closed_pourcent, version.completed_pourcent], :width => '40em', :legend => ('%0.0f%' % version.completed_pourcent)) %>
|
|
| 18 |
<p class="progress-info"> |
|
| 19 |
<%= link_to_if(version.closed_issues_count > 0, l(:label_x_closed_issues_abbr, :count => version.closed_issues_count), :controller => 'issues', :action => 'index', :project_id => version.project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1) %> |
|
| 20 |
(<%= '%0.0f' % (version.closed_issues_count.to_f / version.fixed_issues.count * 100) %>%) |
|
| 21 |
  |
|
| 22 |
<%= link_to_if(version.open_issues_count > 0, l(:label_x_open_issues_abbr, :count => version.open_issues_count), :controller => 'issues', :action => 'index', :project_id => version.project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1) %> |
|
| 23 |
(<%= '%0.0f' % (version.open_issues_count.to_f / version.fixed_issues.count * 100) %>%) |
|
| 24 |
</p> |
|
| 25 |
<% else %> |
|
| 26 |
<p><em><%= l(:label_roadmap_no_issues) %></em></p> |
|
| 27 |
<% end %> |
|
| app/views/versions/_overview.rhtml | ||
|---|---|---|
| 1 |
<% if version.completed? %> |
|
| 2 |
<p><%= format_date(version.effective_date) %></p> |
|
| 3 |
<% elsif version.effective_date %> |
|
| 4 |
<p><strong><%= due_date_distance_in_words(version.effective_date) %></strong> (<%= format_date(version.effective_date) %>)</p> |
|
| 5 |
<% end %> |
|
| 6 |
|
|
| 7 |
<p><%=h version.description %></p> |
|
| 8 |
<ul> |
|
| 9 |
<% version.custom_values.each do |custom_value| %> |
|
| 10 |
<% if !custom_value.value.blank? %> |
|
| 11 |
<li><%=h custom_value.custom_field.name %>: <%=h show_value(custom_value) %></li> |
|
| 12 |
<% end %> |
|
| 13 |
<% end %> |
|
| 14 |
</ul> |
|
| 15 |
|
|
| 16 |
<% if version.fixed_issues.count > 0 %> |
|
| 17 |
<%= progress_bar([version.closed_pourcent, version.completed_pourcent], :width => '40em', :legend => ('%0.0f%' % version.completed_pourcent)) %>
|
|
| 18 |
<p class="progress-info"> |
|
| 19 |
<%= link_to_if(version.closed_issues_count > 0, l(:label_x_closed_issues_abbr, :count => version.closed_issues_count), :controller => 'issues', :action => 'index', :project_id => version.project, :status_id => 'c', :fixed_version_id => version, :set_filter => 1) %> |
|
| 20 |
(<%= '%0.0f' % (version.closed_issues_count.to_f / version.fixed_issues.count * 100) %>%) |
|
| 21 |
  |
|
| 22 |
<%= link_to_if(version.open_issues_count > 0, l(:label_x_open_issues_abbr, :count => version.open_issues_count), :controller => 'issues', :action => 'index', :project_id => version.project, :status_id => 'o', :fixed_version_id => version, :set_filter => 1) %> |
|
| 23 |
(<%= '%0.0f' % (version.open_issues_count.to_f / version.fixed_issues.count * 100) %>%) |
|
| 24 |
</p> |
|
| 25 |
<% else %> |
|
| 26 |
<p><em><%= l(:label_roadmap_no_issues) %></em></p> |
|
| 27 |
<% end %> |
|
| app/views/versions/edit.html.erb | ||
|---|---|---|
| 1 |
<h2><%=l(:label_version)%></h2> |
|
| 2 |
|
|
| 3 |
<% labelled_tabular_form_for @version do |f| %> |
|
| 4 |
<%= render :partial => 'form', :locals => { :f => f } %>
|
|
| 5 |
<%= submit_tag l(:button_save) %> |
|
| 6 |
<% end %> |
|
| 7 |
|
|
| app/views/versions/edit.rhtml | ||
|---|---|---|
| 1 |
<h2><%=l(:label_version)%></h2> |
|
| 2 |
|
|
| 3 |
<% labelled_tabular_form_for :version, @version, :url => project_version_path(@project, @version), :html => {:method => :put} do |f| %>
|
|
| 4 |
<%= render :partial => 'form', :locals => { :f => f } %>
|
|
| 5 |
<%= submit_tag l(:button_save) %> |
|
| 6 |
<% end %> |
|
| 7 |
|
|
| app/views/versions/index.api.rsb | ||
|---|---|---|
| 1 |
api.array :versions, api_meta(:total_count => @versions.size) do |
|
| 2 |
@versions.each do |version| |
|
| 3 |
api.version do |
|
| 4 |
api.id version.id |
|
| 5 |
api.project(:id => version.project_id, :name => version.project.name) unless version.project.nil? |
|
| 6 |
|
|
| 7 |
api.name version.name |
|
| 8 |
api.description version.description |
|
| 9 |
api.status version.status |
|
| 10 |
api.due_date version.effective_date |
|
| 11 |
|
|
| 12 |
render_api_custom_values version.custom_field_values, api |
|
| 13 |
|
|
| 14 |
api.created_on version.created_on |
|
| 15 |
api.updated_on version.updated_on |
|
| 16 |
end |
|
| 17 |
end |
|
| 18 |
end |
|
| app/views/versions/index.html.erb | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to l(:label_version_new), new_project_version_path(@project), :class => 'icon icon-add' if User.current.allowed_to?(:manage_versions, @project) %> |
|
| 3 |
</div> |
|
| 4 |
|
|
| 1 | 5 |
<h2><%=l(:label_roadmap)%></h2> |
| 2 | 6 |
|
| 3 | 7 |
<% if @versions.empty? %> |
| 4 | 8 |
<p class="nodata"><%= l(:label_no_data) %></p> |
| 5 | 9 |
<% else %> |
| 6 | 10 |
<div id="roadmap"> |
| 7 |
<% @versions.each do |version| %>
|
|
| 8 |
<h3 class="version"><%= tag 'a', :name => version.name %><%= link_to_version version %></h3>
|
|
| 11 |
<% @versions.each do |version| %> |
|
| 12 |
<h3 class="version"><%= tag 'a', :name => h(version.name) %><%= link_to_version version %></h3>
|
|
| 9 | 13 |
<%= render :partial => 'versions/overview', :locals => {:version => version} %>
|
| 10 | 14 |
<%= render(:partial => "wiki/content", :locals => {:content => version.wiki_page.content}) if version.wiki_page %>
|
| 11 | 15 |
|
| 12 | 16 |
<% if (issues = @issues_by_version[version]) && issues.size > 0 %> |
| 13 |
<% form_tag({}) do -%>
|
|
| 17 |
<% form_tag({}) do -%>
|
|
| 14 | 18 |
<table class="list related-issues"> |
| 15 | 19 |
<caption><%= l(:label_related_issues) %></caption> |
| 16 |
<%- issues.each do |issue| -%>
|
|
| 20 |
<% issues.each do |issue| -%> |
|
| 17 | 21 |
<tr class="hascontextmenu"> |
| 18 | 22 |
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id %></td> |
| 19 | 23 |
<td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td> |
| 20 | 24 |
</tr> |
| 21 |
<%- end -%>
|
|
| 25 |
<% end -%> |
|
| 22 | 26 |
</table> |
| 23 | 27 |
<% end %> |
| 24 | 28 |
<% end %> |
| ... | ... | |
| 37 | 41 |
<br /> |
| 38 | 42 |
<label for="completed"><%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %></label> |
| 39 | 43 |
<% if @project.descendants.active.any? %> |
| 40 |
<%= hidden_field_tag 'with_subprojects', 0 %>
|
|
| 44 |
<%= hidden_field_tag 'with_subprojects', 0 %>
|
|
| 41 | 45 |
<br /><label><%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%></label> |
| 42 | 46 |
<% end %> |
| 43 | 47 |
<p><%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %></p> |
| app/views/versions/new.html.erb | ||
|---|---|---|
| 1 | 1 |
<h2><%=l(:label_version_new)%></h2> |
| 2 | 2 |
|
| 3 |
<% labelled_tabular_form_for :version, @version, :url => project_versions_path(@project) do |f| %>
|
|
| 3 |
<% labelled_tabular_form_for @version, :url => project_versions_path(@project) do |f| %> |
|
| 4 | 4 |
<%= render :partial => 'versions/form', :locals => { :f => f } %>
|
| 5 | 5 |
<%= submit_tag l(:button_create) %> |
| 6 | 6 |
<% end %> |
| app/views/versions/show.api.rsb | ||
|---|---|---|
| 1 |
api.version do |
|
| 2 |
api.id @version.id |
|
| 3 |
api.project(:id => @version.project_id, :name => @version.project.name) unless @version.project.nil? |
|
| 4 |
|
|
| 5 |
api.name @version.name |
|
| 6 |
api.description @version.description |
|
| 7 |
api.status @version.status |
|
| 8 |
api.due_date @version.effective_date |
|
| 9 |
|
|
| 10 |
render_api_custom_values @version.custom_field_values, api |
|
| 11 |
|
|
| 12 |
api.created_on @version.created_on |
|
| 13 |
api.updated_on @version.updated_on |
|
| 14 |
end |
|
| app/views/versions/show.html.erb | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 2 |
<%= link_to(l(:button_edit), edit_version_path(@version), :class => 'icon icon-edit') if User.current.allowed_to?(:manage_versions, @version.project) %> |
|
| 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(l(:button_delete), version_path(@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') if User.current.allowed_to?(:manage_versions, @version.project) %> |
|
| 6 |
<%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
|
|
| 7 |
</div> |
|
| 8 |
|
|
| 9 |
<h2><%= h(@version.name) %></h2> |
|
| 10 |
|
|
| 11 |
<div id="roadmap"> |
|
| 12 |
<%= render :partial => 'versions/overview', :locals => {:version => @version} %>
|
|
| 13 |
<%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %>
|
|
| 14 |
|
|
| 15 |
<div id="version-summary"> |
|
| 16 |
<% if @version.estimated_hours > 0 || User.current.allowed_to?(:view_time_entries, @project) %> |
|
| 17 |
<fieldset><legend><%= l(:label_time_tracking) %></legend> |
|
| 18 |
<table> |
|
| 19 |
<tr> |
|
| 20 |
<td width="130px" align="right"><%= l(:field_estimated_hours) %></td> |
|
| 21 |
<td width="240px" class="total-hours"width="130px" align="right"><%= html_hours(l_hours(@version.estimated_hours)) %></td> |
|
| 22 |
</tr> |
|
| 23 |
<% if User.current.allowed_to?(:view_time_entries, @project) %> |
|
| 24 |
<tr> |
|
| 25 |
<td width="130px" align="right"><%= l(:label_spent_time) %></td> |
|
| 26 |
<td width="240px" class="total-hours"><%= html_hours(l_hours(@version.spent_hours)) %></td> |
|
| 27 |
</tr> |
|
| 28 |
<% end %> |
|
| 29 |
</table> |
|
| 30 |
</fieldset> |
|
| 31 |
<% end %> |
|
| 32 |
|
|
| 33 |
<div id="status_by"> |
|
| 34 |
<%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.count > 0 %> |
|
| 35 |
</div> |
|
| 36 |
</div> |
|
| 37 |
|
|
| 38 |
<% if @issues.present? %> |
|
| 39 |
<% form_tag({}) do -%>
|
|
| 40 |
<table class="list related-issues"> |
|
| 41 |
<caption><%= l(:label_related_issues) %></caption> |
|
| 42 |
<%- @issues.each do |issue| -%> |
|
| 43 |
<tr class="hascontextmenu"> |
|
| 44 |
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id %></td> |
|
| 45 |
<td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td> |
|
| 46 |
</tr> |
|
| 47 |
<% end %> |
|
| 48 |
</table> |
|
| 49 |
<% end %> |
|
| 50 |
<%= context_menu issues_context_menu_path %> |
|
| 51 |
<% end %> |
|
| 52 |
</div> |
|
| 53 |
|
|
| 54 |
<%= call_hook :view_versions_show_bottom, :version => @version %> |
|
| 55 |
|
|
| 56 |
<% html_title @version.name %> |
|
| app/views/versions/show.rhtml | ||
|---|---|---|
| 1 |
<div class="contextual"> |
|
| 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? %>
|
|
| 4 |
<%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
|
|
| 5 |
</div> |
|
| 6 |
|
|
| 7 |
<h2><%= h(@version.name) %></h2> |
|
| 8 |
|
|
| 9 |
<div id="roadmap"> |
|
| 10 |
<%= render :partial => 'versions/overview', :locals => {:version => @version} %>
|
|
| 11 |
<%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %>
|
|
| 12 |
|
|
| 13 |
<div id="version-summary"> |
|
| 14 |
<% if @version.estimated_hours > 0 || User.current.allowed_to?(:view_time_entries, @project) %> |
|
| 15 |
<fieldset><legend><%= l(:label_time_tracking) %></legend> |
|
| 16 |
<table> |
|
| 17 |
<tr> |
|
| 18 |
<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> |
|
| 20 |
</tr> |
|
| 21 |
<% if User.current.allowed_to?(:view_time_entries, @project) %> |
|
| 22 |
<tr> |
|
| 23 |
<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> |
|
| 25 |
</tr> |
|
| 26 |
<% end %> |
|
| 27 |
</table> |
|
| 28 |
</fieldset> |
|
| 29 |
<% end %> |
|
| 30 |
|
|
| 31 |
<div id="status_by"> |
|
| 32 |
<%= render_issue_status_by(@version, params[:status_by]) if @version.fixed_issues.count > 0 %> |
|
| 33 |
</div> |
|
| 34 |
</div> |
|
| 35 |
|
|
| 36 |
<% if @issues.present? %> |
|
| 37 |
<% form_tag({}) do -%>
|
|
| 38 |
<table class="list related-issues"> |
|
| 39 |
<caption><%= l(:label_related_issues) %></caption> |
|
| 40 |
<%- @issues.each do |issue| -%> |
|
| 41 |
<tr class="hascontextmenu"> |
|
| 42 |
<td class="checkbox"><%= check_box_tag 'ids[]', issue.id %></td> |
|
| 43 |
<td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td> |
|
| 44 |
</tr> |
|
| 45 |
<% end %> |
|
| 46 |
</table> |
|
| 47 |
<% end %> |
|
| 48 |
<%= context_menu issues_context_menu_path %> |
|
| 49 |
<% end %> |
|
| 50 |
</div> |
|
| 51 |
|
|
| 52 |
<%= call_hook :view_versions_show_bottom, :version => @version %> |
|
| 53 |
|
|
| 54 |
<% html_title @version.name %> |
|
Also available in: Unified diff