Adds an helper for displaying the 'checked' image.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3600 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2010-03-17 20:46:22 +00:00
parent 388805ad58
commit f741ca7269
7 changed files with 15 additions and 9 deletions

View File

@ -687,6 +687,12 @@ module ApplicationHelper
content_tag('p', legend, :class => 'pourcent') content_tag('p', legend, :class => 'pourcent')
end end
def checked_image(checked=true)
if checked
image_tag 'toggle_check.png'
end
end
def context_menu(url) def context_menu(url)
unless @context_menu_included unless @context_menu_included
content_for :header_tags do content_for :header_tags do

View File

@ -29,7 +29,7 @@
<tr class="<%= cycle("odd", "even") %> <%= css_project_classes(project) %>"> <tr class="<%= cycle("odd", "even") %> <%= css_project_classes(project) %>">
<td class="name" style="padding-left: <%= level %>em;"><%= project.active? ? link_to(h(project.name), :controller => 'projects', :action => 'settings', :id => project) : h(project.name) %></td> <td class="name" style="padding-left: <%= level %>em;"><%= project.active? ? link_to(h(project.name), :controller => 'projects', :action => 'settings', :id => project) : h(project.name) %></td>
<td><%= textilizable project.short_description, :project => project %></td> <td><%= textilizable project.short_description, :project => project %></td>
<td align="center"><%= image_tag 'true.png' if project.is_public? %></td> <td align="center"><%= checked_image project.is_public? %></td>
<td align="center"><%= format_date(project.created_on) %></td> <td align="center"><%= format_date(project.created_on) %></td>
<td class="buttons"> <td class="buttons">
<%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') if project.active? %> <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') if project.active? %>

View File

@ -15,9 +15,9 @@
<tr class="<%= cycle("odd", "even") %>"> <tr class="<%= cycle("odd", "even") %>">
<td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td> <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"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td>
<td align="center"><%= image_tag 'true.png' if custom_field.is_required? %></td> <td align="center"><%= checked_image custom_field.is_required? %></td>
<% if tab[:name] == 'IssueCustomField' %> <% if tab[:name] == 'IssueCustomField' %>
<td align="center"><%= image_tag 'true.png' if custom_field.is_for_all? %></td> <td align="center"><%= checked_image custom_field.is_for_all? %></td>
<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> <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>
<% end %> <% end %>
<td align="center" style="width:15%;"><%= reorder_links('custom_field', {:action => 'edit', :id => custom_field}) %></td> <td align="center" style="width:15%;"><%= reorder_links('custom_field', {:action => 'edit', :id => custom_field}) %></td>

View File

@ -16,8 +16,8 @@
<% enumerations.each do |enumeration| %> <% enumerations.each do |enumeration| %>
<tr class="<%= cycle('odd', 'even') %>"> <tr class="<%= cycle('odd', 'even') %>">
<td><%= link_to h(enumeration), :action => 'edit', :id => enumeration %></td> <td><%= link_to h(enumeration), :action => 'edit', :id => enumeration %></td>
<td class="center" style="width:15%;"><%= image_tag('true.png') if enumeration.is_default? %></td> <td class="center" style="width:15%;"><%= checked_image enumeration.is_default? %></td>
<td class="center" style="width:15%;"><%= image_tag('true.png') if enumeration.active? %></td> <td class="center" style="width:15%;"><%= checked_image enumeration.active? %></td>
<td style="width:15%;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}) %></td> <td style="width:15%;"><%= reorder_links('enumeration', {:action => 'update', :id => enumeration}) %></td>
<td class="buttons"> <td class="buttons">
<%= link_to l(:button_delete), { :action => 'destroy', :id => enumeration }, <%= link_to l(:button_delete), { :action => 'destroy', :id => enumeration },

View File

@ -23,8 +23,8 @@
<% if Issue.use_status_for_done_ratio? %> <% if Issue.use_status_for_done_ratio? %>
<td align="center"><%= h status.default_done_ratio %></td> <td align="center"><%= h status.default_done_ratio %></td>
<% end %> <% end %>
<td align="center"><%= image_tag 'true.png' if status.is_default? %></td> <td align="center"><%= checked_image status.is_default? %></td>
<td align="center"><%= image_tag 'true.png' if status.is_closed? %></td> <td align="center"><%= checked_image status.is_closed? %></td>
<td align="center" style="width:15%;"><%= reorder_links('issue_status', {:action => 'update', :id => status}) %></td> <td align="center" style="width:15%;"><%= reorder_links('issue_status', {:action => 'update', :id => status}) %></td>
<td class="buttons"> <td class="buttons">
<%= link_to(l(:button_delete), { :action => 'destroy', :id => status }, <%= link_to(l(:button_delete), { :action => 'destroy', :id => status },

View File

@ -17,7 +17,7 @@
<%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %> <%= ff.hidden_field :parent_id, :value => enumeration.id unless enumeration.project %>
<%= h(enumeration) %> <%= h(enumeration) %>
</td> </td>
<td align="center" style="width:15%;"><%= image_tag('true.png') unless enumeration.project %></td> <td align="center" style="width:15%;"><%= checked_image !enumeration.project %></td>
<% enumeration.custom_field_values.each do |value| %> <% enumeration.custom_field_values.each do |value| %>
<td align="center"> <td align="center">
<%= custom_field_tag "enumerations[#{enumeration.id}]", value %> <%= custom_field_tag "enumerations[#{enumeration.id}]", value %>

View File

@ -34,7 +34,7 @@
<td class="firstname"><%= h(user.firstname) %></td> <td class="firstname"><%= h(user.firstname) %></td>
<td class="lastname"><%= h(user.lastname) %></td> <td class="lastname"><%= h(user.lastname) %></td>
<td class="email"><%= mail_to(h(user.mail)) %></td> <td class="email"><%= mail_to(h(user.mail)) %></td>
<td align="center"><%= image_tag('true.png') if user.admin? %></td> <td align="center"><%= checked_image user.admin? %></td>
<td class="created_on" align="center"><%= format_time(user.created_on) %></td> <td class="created_on" align="center"><%= format_time(user.created_on) %></td>
<td class="last_login_on" align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td> <td class="last_login_on" align="center"><%= format_time(user.last_login_on) unless user.last_login_on.nil? %></td>
<td><small><%= change_status_link(user) %></small></td> <td><small><%= change_status_link(user) %></small></td>