就是去點它的子分頁會出現 404 Not Found 的問題,
這個已經有人 report 了:
http://github.com/mszczytowski/redmine_charts/issues#issue/18
下面的修正方法來自這個連結:
http://www.redmine.org/boards/3/topics/5863#message-8844
1 2 3 4 5 6 7 8 9 10 |
--- a/app/controllers/charts_controller.rb +++ b/app/controllers/charts_controller.rb @@ -237,6 +237,7 @@ class ChartsController < ApplicationController # Finds current project or raises 404 def find_project @project = Project.find(params[:project_id]) + @project_id = params[:project_id] rescue ActiveRecord::RecordNotFound render_404 end |
1 2 3 4 5 6 7 8 9 10 11 |
--- a/app/helpers/charts_helper.rb +++ b/app/helpers/charts_helper.rb @@ -13,7 +13,7 @@ module ChartsHelper if controller.controller_name == controller_name res << separator << link_name else - res << separator << link_to(link_name, :controller => controller_name) + res << separator << link_to(link_name, :controller => controller_name, :project_id => @project) end end res |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
--- a/app/views/charts/index.rhtml +++ b/app/views/charts/index.rhtml @@ -18,6 +18,7 @@ <% form_tag '#', :method => :get do %> <%= hidden_field_tag :page, @page %> + <%= hidden_field_tag :project_id, @project_id %> <% if @show_conditions %> <% if @sub_project_condition %> @@ -62,4 +63,4 @@ </div> <% end %> -</div> \ No newline at end of file +</div> |
接下來應該還會發現每按一次 show 的按鈕就會讓上面的「Show xxx weeks」多一行的狀況,
這個在上面提供 patch 的頁面往下翻一點就會看到解決方案,
也有人 report 這個 issue 給作者了:
http://github.com/mszczytowski/redmine_charts/issues#issue/19
修正的方法就是去 redmine_charts/app/helpers/charts_helper.rb 這個檔案找到:
1 2 |
def show_date_condition(range_steps, range_in, range_offset) res = l(:charts_show_last) << " " |
把它改成
1 2 3 |
def show_date_condition(range_steps, range_in, range_offset) res = "" res << l(:charts_show_last) << " " |
就搞定了。