Project

General

Profile

Patch #1746 » add_project-custom-field_hide.patch

Mischa The Evil, 2008-08-05 04:53

View differences:

app/views/custom_fields/_form.rhtml (working copy)
<% when "ProjectCustomField" %>
<p><%= f.check_box :is_required %></p>
<p><%= f.check_box :hide %></p>
<% when "TimeEntryCustomField" %>
<p><%= f.check_box :is_required %></p>
app/views/custom_fields/list.rhtml (working copy)
<th width="30%"><%=l(:field_name)%></th>
<th><%=l(:field_field_format)%></th>
<th><%=l(:field_is_required)%></th>
<% if tab[:name] == 'ProjectCustomField' %>
<th><%=l(:field_hide)%></th>
<% end %>
<% if tab[:name] == 'IssueCustomField' %>
<th><%=l(:field_is_for_all)%></th>
<th><%=l(:label_used_by)%></th>
......
<td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td>
<td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td>
<td align="center"><%= image_tag 'true.png' if custom_field.is_required? %></td>
<% if tab[:name] == 'ProjectCustomField' %>
<td align="center"><%= image_tag 'true.png' if custom_field.hide? %></td>
<% end %>
<% if tab[:name] == 'IssueCustomField' %>
<td align="center"><%= image_tag 'true.png' if custom_field.is_for_all? %></td>
<td align="center"><%= custom_field.projects.count.to_s + ' ' + lwr(:label_project, custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td>
app/views/projects/show.rhtml (working copy)
<li><%=l(:field_parent)%>: <%= link_to h(@project.parent.name), :controller => 'projects', :action => 'show', :id => @project.parent %></li>
<% end %>
<% @project.custom_values.each do |custom_value| %>
<% if !custom_value.value.empty? %>
<% if !custom_value.value.empty? && !custom_value.custom_field.hide? %>
<li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
<% end %>
<% end %>
db/migrate/096_add_custom_field_hide.rb (revision 0)
class AddCustomFieldHide < ActiveRecord::Migration
def self.up
add_column :custom_fields, :hide, :boolean, :null => false, :default => false
end
def self.down
remove_column :custom_fields, :hide
end
end
lang/en.yml (working copy)
field_default_value: Default value
field_comments_sorting: Display comments
field_parent_title: Parent page
field_hide: Hide from Overview
setting_app_title: Application title
setting_app_subtitle: Application subtitle
(1-1/2)