From: Jean-Philippe Lang Date: Mon, 7 May 2007 16:54:26 +0000 (+0000) Subject: Added an option to see all versions in the roadmap view (including completed ones). X-Git-Tag: 0.5.1~77 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8e24c6458da011009685bf2bdb9b28e21e1f9249;p=redmine.git Added an option to see all versions in the roadmap view (including completed ones). On calendar and gantt, versions are now clickable and link to the corresponding entry in the roadmap. Since calendar and gantt are now cached, don't forget to empty your cache before restarting the application. git-svn-id: http://redmine.rubyforge.org/svn/trunk@516 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index ca6ea8d8e..971d0acd3 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -448,10 +448,11 @@ class ProjectsController < ApplicationController def roadmap @trackers = Tracker.find(:all, :conditions => ["is_in_roadmap=?", true], :order => 'position') - retrieve_selected_tracker_ids(@trackers) + retrieve_selected_tracker_ids(@trackers) + conditions = ("1" == params[:completed] ? nil : [ "#{Version.table_name}.effective_date > ?", Date.today]) @versions = @project.versions.find(:all, - :conditions => [ "#{Version.table_name}.effective_date>?", Date.today], + :conditions => conditions, :order => "#{Version.table_name}.effective_date ASC" ) end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index c7e80b0a0..74805ba53 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -16,4 +16,13 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. module ProjectsHelper + def link_to_version(version, options = {}) + return '' unless version && version.is_a?(Version) + link_to version.name, {:controller => 'projects', + :action => 'roadmap', + :id => version.project_id, + :completed => (version.completed? ? 1 : nil), + :anchor => version.name + }, options + end end diff --git a/app/models/version.rb b/app/models/version.rb index ddae037a6..463ca3354 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -33,6 +33,10 @@ class Version < ActiveRecord::Base effective_date end + def completed? + effective_date && effective_date <= Date.today + end + private def check_integrity raise "Can't delete version" if self.fixed_issues.find(:first) diff --git a/app/views/projects/calendar.rhtml b/app/views/projects/calendar.rhtml index 2a53831fe..48fdaf64d 100644 --- a/app/views/projects/calendar.rhtml +++ b/app/views/projects/calendar.rhtml @@ -74,7 +74,7 @@ while day <= @date_to <% else %> - <%= image_tag('milestone.png') %> <%= "#{l(:label_version)}: #{i.name}" %> + <%= link_to_version i, :class => "icon icon-package" %> <% end %> <% end %> diff --git a/app/views/projects/changelog.rhtml b/app/views/projects/changelog.rhtml index 51724f149..f42f32c42 100644 --- a/app/views/projects/changelog.rhtml +++ b/app/views/projects/changelog.rhtml @@ -1,14 +1,12 @@

<%=l(:label_change_log)%>

-
-
<% form_tag do %> -

<%=l(:label_tracker_plural)%>

+

<%=l(:label_tracker_plural)%>
<% @trackers.each do |tracker| %> <%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %> <%= tracker.name %>
-<% end %> +<% end %>

<%= submit_tag l(:button_apply), :class => 'button-small' %>

<% end %>
@@ -27,4 +25,3 @@ end %>
  • <%= link_to_issue issue %>: <%=h issue.subject %>
  • <% end %> -
    \ No newline at end of file diff --git a/app/views/projects/gantt.rhtml b/app/views/projects/gantt.rhtml index 317fd993d..ccc9a019a 100644 --- a/app/views/projects/gantt.rhtml +++ b/app/views/projects/gantt.rhtml @@ -90,7 +90,7 @@ top = headers_height + 8 <%= link_to_issue i %><%= " (#{i.project.name})" unless @project && @project == i.project %>: <%=h i.subject %> <% else %> - <%= "#{l(:label_version)}: #{i.name}" %> + <%= link_to_version i, :class => "icon icon-package" %> <% end %> <% top = top + 20 diff --git a/app/views/projects/roadmap.rhtml b/app/views/projects/roadmap.rhtml index e1449dcfa..ab591a830 100644 --- a/app/views/projects/roadmap.rhtml +++ b/app/views/projects/roadmap.rhtml @@ -1,14 +1,13 @@

    <%=l(:label_roadmap)%>

    -
    - -
    +
    <% form_tag do %> -

    <%=l(:label_tracker_plural)%>

    +

    <%=l(:label_tracker_plural)%>
    <% @trackers.each do |tracker| %> <%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %> <%= tracker.name %>
    -<% end %> +<% end %>

    +

    <%= submit_tag l(:button_apply), :class => 'button-small' %>

    <% end %>
    @@ -16,13 +15,17 @@ <% if @versions.empty? %>

    <%= l(:label_no_data) %>

    <% end %> <% @versions.each do |version| %> -

    <%= version.name %>

    +

    <%= version.name %>

    + <% if version.completed? %> +

    <%= format_date(version.effective_date) %>

    + <% else %> +

    <%=l(:label_roadmap_due_in)%> <%= distance_of_time_in_words Time.now, version.effective_date %> (<%= format_date(version.effective_date) %>)

    + <% end %>

    <%=h version.description %>

    -

    <%=l(:label_roadmap_due_in)%> <%= distance_of_time_in_words Time.now, version.effective_date %> (<%= format_date(version.effective_date) %>)

    <% issues = version.fixed_issues.find(:all, - :include => :status, + :include => [:status, :tracker], :conditions => ["tracker_id in (#{@selected_tracker_ids.join(',')})"], - :order => "position") + :order => "#{Tracker.table_name}.position") total = issues.size complete = issues.inject(0) {|c,i| i.status.is_closed? ? c + 1 : c } @@ -56,4 +59,3 @@ <% end %> <% end %> -
    diff --git a/lang/bg.yml b/lang/bg.yml index 1e348cb75..3db6cc891 100644 --- a/lang/bg.yml +++ b/lang/bg.yml @@ -383,6 +383,7 @@ label_start_to_start: start to start label_start_to_end: start to end label_stay_logged_in: Stay logged in label_disabled: disabled +label_show_completed_versions: Show completed versions button_login: Вход button_submit: Изпращане diff --git a/lang/de.yml b/lang/de.yml index 1fc529bad..bb43bf393 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -383,6 +383,7 @@ label_start_to_start: start to start label_start_to_end: start to end label_stay_logged_in: Stay logged in label_disabled: disabled +label_show_completed_versions: Show completed versions button_login: Einloggen button_submit: OK diff --git a/lang/en.yml b/lang/en.yml index 1800b5d33..ef56872e5 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -383,6 +383,7 @@ label_start_to_start: start to start label_start_to_end: start to end label_stay_logged_in: Stay logged in label_disabled: disabled +label_show_completed_versions: Show completed versions button_login: Login button_submit: Submit diff --git a/lang/es.yml b/lang/es.yml index 3a66e0bcf..dce15514f 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -383,6 +383,7 @@ label_start_to_start: start to start label_start_to_end: start to end label_stay_logged_in: Stay logged in label_disabled: disabled +label_show_completed_versions: Show completed versions button_login: Conexión button_submit: Someter diff --git a/lang/fr.yml b/lang/fr.yml index bd1973b4d..e332f1c6d 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -383,6 +383,7 @@ label_start_to_start: début à début label_start_to_end: début à fin label_stay_logged_in: Rester connecté label_disabled: désactivé +label_show_completed_versions: Voire les versions passées button_login: Connexion button_submit: Soumettre diff --git a/lang/it.yml b/lang/it.yml index c1e964548..4d100a2e8 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -383,6 +383,7 @@ label_start_to_start: start to start label_start_to_end: start to end label_stay_logged_in: Stay logged in label_disabled: disabled +label_show_completed_versions: Show completed versions button_login: Login button_submit: Invia diff --git a/lang/ja.yml b/lang/ja.yml index 955799494..ac5e48ee1 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -384,6 +384,7 @@ label_start_to_start: start to start label_start_to_end: start to end label_stay_logged_in: Stay logged in label_disabled: disabled +label_show_completed_versions: Show completed versions button_login: ログイン button_submit: 変更 diff --git a/lang/pt.yml b/lang/pt.yml index 3c6debfbe..33da15fe0 100644 --- a/lang/pt.yml +++ b/lang/pt.yml @@ -383,6 +383,7 @@ label_start_to_start: start to start label_start_to_end: start to end label_stay_logged_in: Stay logged in label_disabled: disabled +label_show_completed_versions: Show completed versions button_login: Login button_submit: Enviar diff --git a/lang/zh.yml b/lang/zh.yml index f9f2a75a7..894aa1f46 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -386,6 +386,7 @@ label_start_to_start: start to start label_start_to_end: start to end label_stay_logged_in: Stay logged in label_disabled: disabled +label_show_completed_versions: Show completed versions button_login: 登录 button_submit: 提交 diff --git a/public/images/arrow_bw.png b/public/images/arrow_bw.png index 52dfc96f0..2af9e2cd4 100644 Binary files a/public/images/arrow_bw.png and b/public/images/arrow_bw.png differ diff --git a/public/images/arrow_from.png b/public/images/arrow_from.png index 4d5eeb9ea..7d94ad185 100644 Binary files a/public/images/arrow_from.png and b/public/images/arrow_from.png differ diff --git a/public/images/arrow_to.png b/public/images/arrow_to.png index 4f969716f..f021e98c9 100644 Binary files a/public/images/arrow_to.png and b/public/images/arrow_to.png differ