views cleaning

git-svn-id: http://redmine.rubyforge.org/svn/trunk@22 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2006-09-03 10:25:21 +00:00
parent 552d99d664
commit 893a433165
7 changed files with 24 additions and 16 deletions

View File

@ -115,6 +115,12 @@ module ApplicationHelper
options[:html].store :class, "tabular"
form_for(name, object, options.merge({ :builder => TabularFormBuilder, :lang => current_language}), &proc)
end
def check_all_links(form_name)
link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") +
" | " +
link_to_function(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
end
end
class TabularFormBuilder < ActionView::Helpers::FormBuilder

View File

@ -1,9 +1,10 @@
<h2><%=l(:field_mail_notification)%></h2>
<p><%=l(:text_select_mail_notifications)%></p>
<%= start_form_tag ({}, :id => 'mail_options_form')%>
<div class="box">
<p><%=l(:text_select_mail_notifications)%></p>
<% actions = @actions.group_by {|p| p.group_id } %>
<% actions.keys.sort.each do |group_id| %>
<fieldset style="margin-top: 6px;"><legend><strong><%= l(Permission::GROUPS[group_id]) %></strong></legend>
@ -15,11 +16,9 @@
</fieldset>
<% end %>
<br />
<p>
<a href="javascript:checkAll('mail_options_form', true)"><%=l(:button_check_all)%></a> |
<a href="javascript:checkAll('mail_options_form', false)"><%=l(:button_uncheck_all)%></a>
</p>
<p><%= check_all_links 'mail_options_form' %></p>
</div>
<%= submit_tag l(:button_save) %>
<%= end_form_tag %>
<%= end_form_tag %>

View File

@ -1,16 +1,15 @@
<h2><%=l(:label_change_log)%></h2>
<%= start_form_tag %>
<% @trackers.each do |tracker| %>
<%= check_box_tag "tracker_ids[]", tracker.id, (@selected_tracker_ids.include? tracker.id.to_s) %>
<%= tracker.name %>
<% end %>
&nbsp;&nbsp;<%= submit_tag l(:button_apply), :class => 'button-small' %>
<%= end_form_tag %>
<p>&nbsp;</p>
<%= end_form_tag %><br />
&nbsp;
<div class="box">
<% ver_id = nil
@fixed_issues.each do |issue| %>
<% unless ver_id == issue.fixed_version_id %>
@ -23,3 +22,4 @@
<li><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %> [<%= issue.tracker.name %>]: <%= issue.subject %></li>
<% end %>
</div>

View File

@ -1,5 +1,7 @@
<h2><%=l(:label_document_plural)%></h2>
<% if @documents.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
<% documents = @documents.group_by {|d| d.category } %>
<% documents.each do |category, docs| %>
<h3><%= category.name %></h3>

View File

@ -1,5 +1,7 @@
<h2><%=l(:label_news_plural)%></h2>
<% if @news.empty? %><p><i><%= l(:label_no_data) %></i></p><% end %>
<% for news in @news %>
<p>
<b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />

View File

@ -1,7 +1,7 @@
<h2><%=l(:label_overview)%></h2>
<div class="splitcontentleft">
<%= @project.description %>
<%= simple_format auto_link @project.description %>
<ul>
<li><%=l(:field_homepage)%>: <%= link_to @project.homepage, @project.homepage %></li>
<li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li>

View File

@ -14,8 +14,7 @@
<% end %>
</fieldset>
<% end %>
<br />
<a href="javascript:checkAll('role_form', true)"><%=l(:button_check_all)%></a> |
<a href="javascript:checkAll('role_form', false)"><%=l(:button_uncheck_all)%></a><br />
<br />
<%= check_all_links 'role_form' %>
<!--[eoform:role]-->
</div>