我正在尝试使用插件“默认选中”“私人问题”复选框。
我需要将以下检查添加到redmine默认视图
:checked => @issue.new_record? || @issue.is_private,
默认视图是
<%= f.check_box :is_private, :no_label => true %>
如何使用deface gem来完成这项工作?
答案 0 :(得分:1)
我设法使用deface
修补视图1你应该在init.rb
中添加一些deface补丁来源: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 / app / overrides / issues / 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)