Project

General

Profile

Patch #1746 » add_project-custom-field_hide-r2641.patch

Patch based on trunk @ r2641 - Mischa The Evil, 2009-03-29 21:48

View differences:

app/views/custom_fields/_form.rhtml (working copy)
90 90

  
91 91
<% when "ProjectCustomField" %>
92 92
    <p><%= f.check_box :is_required %></p>
93
    <p><%= f.check_box :hide %></p>
93 94

  
94 95
<% when "TimeEntryCustomField" %>
95 96
    <p><%= f.check_box :is_required %></p>
app/views/custom_fields/index.rhtml (working copy)
20 20
	<th width="30%"><%=l(:field_name)%></th>
21 21
	<th><%=l(:field_field_format)%></th>
22 22
	<th><%=l(:field_is_required)%></th>
23
	<% if tab[:name] == 'ProjectCustomField' %>
24
	<th><%=l(:field_hide)%></th>
25
	<% end %>
23 26
	<% if tab[:name] == 'IssueCustomField' %>
24 27
	<th><%=l(:field_is_for_all)%></th>
25 28
	<th><%=l(:label_used_by)%></th>
......
33 36
	<td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td>
34 37
	<td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td>
35 38
	<td align="center"><%= image_tag 'true.png' if custom_field.is_required? %></td>
39
	<% if tab[:name] == 'ProjectCustomField' %>
40
	<td align="center"><%= image_tag 'true.png' if custom_field.hide? %></td>
41
	<% end %>
36 42
	<% if tab[:name] == 'IssueCustomField' %>
37 43
	<td align="center"><%= image_tag 'true.png' if custom_field.is_for_all? %></td>
38 44
	<td align="center"><%= l(:label_x_projects, :count => custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td>
app/views/projects/show.rhtml (working copy)
9 9
	    <%= @subprojects.collect{|p| link_to(h(p), :action => 'show', :id => p)}.join(", ") %></li>
10 10
  <% end %>
11 11
	<% @project.custom_values.each do |custom_value| %>
12
	<% if !custom_value.value.empty? %>
12
	<% if !custom_value.value.empty? && !custom_value.custom_field.hide? %>
13 13
	   <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li>
14 14
	<% end %>
15 15
	<% end %>
config/locales/en.yml (working copy)
242 242
  field_watcher: Watcher
243 243
  field_identity_url: OpenID URL
244 244
  field_content: Content
245
  field_hide: Hide from overview
245 246
  
246 247
  setting_app_title: Application title
247 248
  setting_app_subtitle: Application subtitle
db/migrate/20090329181700_add_custom_field_hide.rb (revision 0)
1
class AddCustomFieldHide < ActiveRecord::Migration
2
  def self.up
3
    add_column :custom_fields, :hide, :boolean, :null => false, :default => false
4
  end
5

  
6
  def self.down
7
    remove_column :custom_fields, :hide
8
  end
9
end
(2-2/2)