2013-03-22 49 views
0

我正在嘗試使用插件「默認選中」複選框。使用deface修改redmine視圖

我需要下面的檢查添加到管理平臺默認視圖

:checked => @issue.new_record? || @issue.is_private, 

默認視圖是

<%= f.check_box :is_private, :no_label => true %> 

我如何可以利用抹掉寶石,使這項工作?

回答

1

我設法使用污損

1你應該init.rb

源添加一些補丁污損修補一個觀點:https://github.com/jbbarth/redmine_organizations/blob/master/init.rb#L3

Rails.application.paths["app/overrides"] ||= [] 
Rails.application.paths["app/overrides"] << File.expand_path("../app/overrides", __FILE__) 

2創建覆蓋YOUR_PLUGIN /應用程序/覆蓋/問題/ show.rb代碼這樣的

Deface::Override.new(
    :virtual_path => "issues/show", 
    :name => "private_issue_check_box", 
    :replace => CSS_SELECTOR_FOR_CHECK_BOX, 
    :text => "<%= f.check_box :is_private, :no_label => true, :checked => @issue.new_record? || @issue.is_private %>", 
    :disabled => false)