Custom fields refactoring: most of code moved from controllers to models (using new module ActsAsCustomizable).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1592 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-06-27 20:13:56 +00:00
parent a4a8b6381e
commit ce6cf66f6c
24 changed files with 321 additions and 113 deletions
+6 -6
View File
@@ -17,8 +17,8 @@
<p><%= f.check_box :is_public %></p>
<%= wikitoolbar_for 'project_description' %>
<% for @custom_value in @custom_values %>
<p><%= custom_field_tag_with_label @custom_value %></p>
<% @project.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :project, value %></p>
<% end %>
</div>
@@ -34,15 +34,15 @@
</fieldset>
<% end %>
<% unless @custom_fields.empty? %>
<% unless @issue_custom_fields.empty? %>
<fieldset class="box"><legend><%=l(:label_custom_field_plural)%></legend>
<% for custom_field in @custom_fields %>
<% @issue_custom_fields.each do |custom_field| %>
<label class="floating">
<%= check_box_tag 'project[custom_field_ids][]', custom_field.id, ((@project.custom_fields.include? custom_field) or custom_field.is_for_all?), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>
<%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>
<%= custom_field.name %>
</label>
<% end %>
<%= hidden_field_tag 'project[custom_field_ids][]', '' %>
<%= hidden_field_tag 'project[issue_custom_field_ids][]', '' %>
</fieldset>
<% end %>
<!--[eoform:project]-->
+1 -1
View File
@@ -10,7 +10,7 @@
<% if @project.parent %>
<li><%=l(:field_parent)%>: <%= link_to h(@project.parent.name), :controller => 'projects', :action => 'show', :id => @project.parent %></li>
<% end %>
<% for custom_value in @custom_values %>
<% @project.custom_values.each do |custom_value| %>
<% if !custom_value.value.empty? %>
<li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
<% end %>