diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-09-02 13:33:23 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-09-02 13:33:23 +0000 |
commit | 552d99d664b6c67d021e0b04fb5c6bde3a23c8ce (patch) | |
tree | c765cbb35f725f86590aabd29cb042579cca4b46 /redmine/app | |
parent | 54aeec7b5fcf61e9fe27aafe4e72cf5bbd085ee2 (diff) | |
download | redmine-552d99d664b6c67d021e0b04fb5c6bde3a23c8ce.tar.gz redmine-552d99d664b6c67d021e0b04fb5c6bde3a23c8ce.zip |
tables and forms redesign,
added form builder for several views
git-svn-id: http://redmine.rubyforge.org/svn/trunk@21 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'redmine/app')
59 files changed, 301 insertions, 386 deletions
diff --git a/redmine/app/helpers/application_helper.rb b/redmine/app/helpers/application_helper.rb index d45cf9b97..7a82bcd3a 100644 --- a/redmine/app/helpers/application_helper.rb +++ b/redmine/app/helpers/application_helper.rb @@ -104,4 +104,47 @@ module ApplicationHelper def lang_options_for_select
(GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }).collect {|lang| [ l_lang_name(lang.to_s, lang), lang.to_s]}
end
+
+ def label_tag_for(name, option_tags = nil, options = {})
+ label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "")
+ content_tag("label", label_text)
+ end
+
+ def labelled_tabular_form_for(name, object, options, &proc)
+ options[:html] ||= {}
+ options[:html].store :class, "tabular"
+ form_for(name, object, options.merge({ :builder => TabularFormBuilder, :lang => current_language}), &proc)
+ end
end +
+class TabularFormBuilder < ActionView::Helpers::FormBuilder
+ include GLoc
+
+ def initialize(object_name, object, template, options, proc)
+ set_language_if_valid options.delete(:lang)
+ @object_name, @object, @template, @options, @proc = object_name, object, template, options, proc
+ end
+
+ (field_helpers - %w(radio_button) + %w(date_select)).each do |selector|
+ src = <<-END_SRC
+ def #{selector}(field, options = {})
+ label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "")
+ label = @template.content_tag("label", label_text,
+ :class => (@object.errors[field] ? "error" : nil),
+ :for => (@object_name.to_s + "_" + field.to_s))
+ label + super
+ end
+ END_SRC
+ class_eval src, __FILE__, __LINE__
+ end
+
+ def select(field, choices, options = {})
+ label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "")
+ label = @template.content_tag("label", label_text,
+ :class => (@object.errors[field] ? "error" : nil),
+ :for => (@object_name.to_s + "_" + field.to_s))
+ label + super
+ end
+
+end
+
diff --git a/redmine/app/helpers/custom_fields_helper.rb b/redmine/app/helpers/custom_fields_helper.rb index bc5a15e9a..eb4d47a83 100644 --- a/redmine/app/helpers/custom_fields_helper.rb +++ b/redmine/app/helpers/custom_fields_helper.rb @@ -39,18 +39,13 @@ module CustomFieldsHelper def custom_field_label_tag(custom_value)
content_tag "label", custom_value.custom_field.name +
(custom_value.custom_field.is_required? ? " <span class=\"required\">*</span>" : ""),
- :for => "custom_fields_#{custom_value.custom_field.id}"
+ :for => "custom_fields_#{custom_value.custom_field.id}",
+ :class => (custom_value.errors.empty? ? nil : "error" )
end
# Return custom field tag with its label tag
def custom_field_tag_with_label(custom_value)
- case custom_value.custom_field.field_format
- when "bool"
- # label is displayed inline after the checkbox
- custom_field_tag(custom_value) + " " + custom_field_label_tag(custom_value)
- else
- custom_field_label_tag(custom_value) + "<br />" + custom_field_tag(custom_value)
- end
+ custom_field_label_tag(custom_value) + custom_field_tag(custom_value)
end
# Return a string used to display a custom value
diff --git a/redmine/app/views/account/login.rhtml b/redmine/app/views/account/login.rhtml index 2c806b421..74c075516 100644 --- a/redmine/app/views/account/login.rhtml +++ b/redmine/app/views/account/login.rhtml @@ -2,24 +2,17 @@ <div class="box login">
<h2><%= image_tag 'login' %> <%=l(:label_please_login)%></h2> -<%= start_form_tag :action=> "login" %>
-<table cellpadding="4">
- <tr>
- <td><label for="login"><%=l(:field_login)%>:</label></td>
- <td><%= text_field_tag 'login', nil, :size => 25 %></td>
- </tr>
- <tr>
- <td><label for="password"><%=l(:field_password)%>:</label></td>
- <td><%= password_field_tag 'password', nil, :size => 25 %></td>
- </tr>
-</table>
+<%= start_form_tag({:action=> "login"}, :class => "tabular") %>
+<p><label for="login"><%=l(:field_login)%>:</label>
+<%= text_field_tag 'login', nil, :size => 25 %></p>
-
- -<p><center><input type="submit" name="login" value="<%=l(:button_login)%> »" class="primary" /></center></p> +<p><label for="password"><%=l(:field_password)%>:</label>
+<%= password_field_tag 'password', nil, :size => 25 %></p>
+
+<p><center><input type="submit" name="login" value="<%=l(:button_login)%> »" class="primary" /></center> <%= end_form_tag %>
-<br />
-<% unless $RDM_SELF_REGISTRATION == false %><%= link_to l(:label_register), :action => 'register' %> |<% end %>
-<%= link_to l(:label_password_lost), :action => 'lost_password' %> +
+<br><% unless $RDM_SELF_REGISTRATION == false %><%= link_to l(:label_register), :action => 'register' %> |<% end %>
+<%= link_to l(:label_password_lost), :action => 'lost_password' %></p> </div>
</center>
\ No newline at end of file diff --git a/redmine/app/views/account/lost_password.rhtml b/redmine/app/views/account/lost_password.rhtml index cd392f243..3f32e7153 100644 --- a/redmine/app/views/account/lost_password.rhtml +++ b/redmine/app/views/account/lost_password.rhtml @@ -2,9 +2,9 @@ <div class="box login">
<h2><%=l(:label_password_lost)%></h2>
-<%= start_form_tag %>
+<%= start_form_tag({:action=> "lost_password"}, :class => "tabular") %>
-<p><label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label><br/>
+<p><label for="mail"><%=l(:field_mail)%> <span class="required">*</span></label>
<%= text_field_tag 'mail', nil, :size => 40 %></p>
<p><center><%= submit_tag l(:button_submit) %></center></p>
diff --git a/redmine/app/views/account/my_account.rhtml b/redmine/app/views/account/my_account.rhtml index e401ef3eb..9f561e8b1 100644 --- a/redmine/app/views/account/my_account.rhtml +++ b/redmine/app/views/account/my_account.rhtml @@ -6,52 +6,49 @@ <%= error_messages_for 'user' %> -<div class="splitcontentleft">
<div class="box">
<h3><%=l(:label_information_plural)%></h3>
- <%= start_form_tag :action => 'my_account' %> + <%= start_form_tag({:action => 'my_account'}, :class => "tabular") %> <!--[form:user]--> - <p><label for="user_firstname"><%=l(:field_firstname)%> <span class="required">*</span></label><br/> + <p><label for="user_firstname"><%=l(:field_firstname)%> <span class="required">*</span></label> <%= text_field 'user', 'firstname' %></p> - <p><label for="user_lastname"><%=l(:field_lastname)%> <span class="required">*</span></label><br/> + <p><label for="user_lastname"><%=l(:field_lastname)%> <span class="required">*</span></label> <%= text_field 'user', 'lastname' %></p> - <p><label for="user_mail"><%=l(:field_mail)%> <span class="required">*</span></label><br/> + <p><label for="user_mail"><%=l(:field_mail)%> <span class="required">*</span></label> <%= text_field 'user', 'mail', :size => 40 %></p>
- <p><label for="user_language"><%=l(:field_language)%></label><br/> + <p><label for="user_language"><%=l(:field_language)%></label> <%= select("user", "language", lang_options_for_select) %></p> <!--[eoform:user]-->
- <p><%= check_box 'user', 'mail_notification' %> <label for="user_mail_notification"><%=l(:field_mail_notification)%></label></p>
+ <p><label for="user_mail_notification"><%=l(:field_mail_notification)%></label> + <%= check_box 'user', 'mail_notification' %></p>
<center><%= submit_tag l(:button_save) %></center> <%= end_form_tag %>
</div>
-</div>
-
-<div class="splitcontentright"> + <% unless @user.auth_source_id %>
<div class="box">
<h3><%=l(:field_password)%></h3>
- <%= start_form_tag :action => 'change_password' %> + <%= start_form_tag({:action => 'change_password'}, :class => "tabular") %> - <p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label><br/> + <p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label> <%= password_field_tag 'password', nil, :size => 25 %></p> - <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label><br/> + <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label> <%= password_field_tag 'new_password', nil, :size => 25 %></p>
- <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label><br/> + <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label> <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p>
<center><%= submit_tag l(:button_save) %></center> <%= end_form_tag %>
</div> <% end %>
-</div>
\ No newline at end of file diff --git a/redmine/app/views/account/password_recovery.rhtml b/redmine/app/views/account/password_recovery.rhtml index b4f73d28c..39a8071a9 100644 --- a/redmine/app/views/account/password_recovery.rhtml +++ b/redmine/app/views/account/password_recovery.rhtml @@ -6,12 +6,12 @@ <%= error_messages_for 'user' %> - <%= start_form_tag :token => @token.value %> + <%= start_form_tag({:token => @token.value}, :class => "tabular") %> - <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label><br/> + <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label> <%= password_field_tag 'new_password', nil, :size => 25 %></p>
- <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label><br/> + <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label> <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p>
<p><center><%= submit_tag l(:button_save) %></center></p> diff --git a/redmine/app/views/account/register.rhtml b/redmine/app/views/account/register.rhtml index 74a5c74c0..b34aff79c 100644 --- a/redmine/app/views/account/register.rhtml +++ b/redmine/app/views/account/register.rhtml @@ -1,36 +1,37 @@ <h2><%=l(:label_register)%></h2> -<%= start_form_tag %> +<%= start_form_tag({:action => 'register'}, :class => "tabular") %> <%= error_messages_for 'user' %> <div class="box"> <!--[form:user]--> -<p><label for="user_login"><%=l(:field_login)%></label> <span class="required">*</span><br/> +<p><label for="user_login"><%=l(:field_login)%> <span class="required">*</span></label> <%= text_field 'user', 'login', :size => 25 %></p> -<p><label for="password"><%=l(:field_password)%></label> <span class="required">*</span><br/> +<p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label> <%= password_field_tag 'password', nil, :size => 25 %></p> -<p><label for="password_confirmation"><%=l(:field_password_confirmation)%></label> <span class="required">*</span><br/> +<p><label for="password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label> <%= password_field_tag 'password_confirmation', nil, :size => 25 %></p> -<p><label for="user_firstname"><%=l(:field_firstname)%></label> <span class="required">*</span><br/> +<p><label for="user_firstname"><%=l(:field_firstname)%> <span class="required">*</span></label> <%= text_field 'user', 'firstname' %></p> -<p><label for="user_lastname"><%=l(:field_lastname)%></label> <span class="required">*</span><br/> +<p><label for="user_lastname"><%=l(:field_lastname)%> <span class="required">*</span></label> <%= text_field 'user', 'lastname' %></p> -<p><label for="user_mail"><%=l(:field_mail)%></label> <span class="required">*</span><br/> +<p><label for="user_mail"><%=l(:field_mail)%> <span class="required">*</span></label> <%= text_field 'user', 'mail' %></p>
-<p><label for="user_language"><%=l(:field_language)%></label><br/> +<p><label for="user_language"><%=l(:field_language)%></label> <%= select("user", "language", lang_options_for_select) %></p>
<% for @custom_value in @custom_values %> <p><%= custom_field_tag_with_label @custom_value %></p> <% end %>
-<p><%= check_box 'user', 'mail_notification' %> <label for="user_mail_notification"><%=l(:field_mail_notification)%></label></p>
+<p><label for="user_mail_notification"><%=l(:field_mail_notification)%></label> +<%= check_box 'user', 'mail_notification' %></p>
<!--[eoform:user]--> </div> diff --git a/redmine/app/views/admin/projects.rhtml b/redmine/app/views/admin/projects.rhtml index 68552fb90..39e4d9bf7 100644 --- a/redmine/app/views/admin/projects.rhtml +++ b/redmine/app/views/admin/projects.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_project_plural)%></h2> -<table width="100%" cellspacing="1" cellpadding="2" class="listTableContent"> +<table class="listTableContent"> <tr class="ListHead"> <%= sort_header_tag('name', :caption => l(:label_project)) %>
<th><%=l(:field_description)%></th>
@@ -17,10 +17,8 @@ <td align="center"><%= image_tag 'true' if project.is_public? %> <td align="center"><%= project.projects_count %>
<td align="center"><%= format_date(project.created_on) %>
- <td align="center">
- <%= start_form_tag({:controller => 'projects', :action => 'destroy', :id => project}) %>
- <%= submit_tag l(:button_delete), :class => "button-small" %>
- <%= end_form_tag %>
+ <td align="center"> + <%= button_to l(:button_delete), { :controller => 'projects', :action => 'destroy', :id => project }, :class => "button-small" %>
</td>
</tr> <% end %> diff --git a/redmine/app/views/auth_sources/_form.rhtml b/redmine/app/views/auth_sources/_form.rhtml index 4bb3c3335..b6365dce5 100644 --- a/redmine/app/views/auth_sources/_form.rhtml +++ b/redmine/app/views/auth_sources/_form.rhtml @@ -2,48 +2,44 @@ <div class="box"> <!--[form:auth_source]--> -<p><label for="auth_source_name"><%=l(:field_name)%></label> <span class="required">*</span><br/> +<p><label for="auth_source_name"><%=l(:field_name)%> <span class="required">*</span></label> <%= text_field 'auth_source', 'name' %></p> -<p><label for="auth_source_host"><%=l(:field_host)%></label> <span class="required">*</span><br/> +<p><label for="auth_source_host"><%=l(:field_host)%> <span class="required">*</span></label> <%= text_field 'auth_source', 'host' %></p> -<p><label for="auth_source_port"><%=l(:field_port)%></label> <span class="required">*</span><br/> +<p><label for="auth_source_port"><%=l(:field_port)%> <span class="required">*</span></label> <%= text_field 'auth_source', 'port', :size => 6 %></p> -<p><label for="auth_source_account"><%=l(:field_account)%></label><br/> +<p><label for="auth_source_account"><%=l(:field_account)%></label> <%= text_field 'auth_source', 'account' %></p> -<p><label for="auth_source_account_password"><%=l(:field_password)%></label><br/> +<p><label for="auth_source_account_password"><%=l(:field_password)%></label> <%= password_field 'auth_source', 'account_password' %></p> -<p><label for="auth_source_base_dn"><%=l(:field_base_dn)%></label> <span class="required">*</span><br/> +<p><label for="auth_source_base_dn"><%=l(:field_base_dn)%> <span class="required">*</span></label> <%= text_field 'auth_source', 'base_dn', :size => 60 %></p> +</div> -<p><%= check_box 'auth_source', 'onthefly_register' %> -<label for="auth_source_onthefly_register"><%=l(:field_onthefly)%></label></p> +<div class="box"> +<p><label for="auth_source_onthefly_register"><%=l(:field_onthefly)%></label> +<%= check_box 'auth_source', 'onthefly_register' %></p> +<p> <fieldset><legend><%=l(:label_attribute_plural)%></legend> -<div style="float:left;margin-right:10px;"> -<p><label for="auth_source_attr_login"><%=l(:field_login)%></label> <span class="required">*</span><br/> +<p><label for="auth_source_attr_login"><%=l(:field_login)%> <span class="required">*</span></label> <%= text_field 'auth_source', 'attr_login', :size => 20 %></p> -</div> -<div style="float:left;margin-right:10px;"> -<p><label for="auth_source_attr_firstname"><%=l(:field_firstname)%></label><br/> +<p><label for="auth_source_attr_firstname"><%=l(:field_firstname)%></label> <%= text_field 'auth_source', 'attr_firstname', :size => 20 %></p> -</div> -<div style="float:left;margin-right:10px;"> -<p><label for="auth_source_attr_lastname"><%=l(:field_lastname)%></label><br/> +<p><label for="auth_source_attr_lastname"><%=l(:field_lastname)%></label> <%= text_field 'auth_source', 'attr_lastname', :size => 20 %></p> -</div> -<div> -<p><label for="auth_source_attr_mail"><%=l(:field_mail)%></label><br/> +<p><label for="auth_source_attr_mail"><%=l(:field_mail)%></label> <%= text_field 'auth_source', 'attr_mail', :size => 20 %></p> -</div> </fieldset> - -<!--[eoform:auth_source]--> +</p> </div> +<!--[eoform:auth_source]--> + diff --git a/redmine/app/views/auth_sources/edit.rhtml b/redmine/app/views/auth_sources/edit.rhtml index 7e4ee01ce..149463e7f 100644 --- a/redmine/app/views/auth_sources/edit.rhtml +++ b/redmine/app/views/auth_sources/edit.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_auth_source)%> (<%= @auth_source.auth_method_name %>)</h2> -<%= start_form_tag :action => 'update', :id => @auth_source %> +<%= start_form_tag({:action => 'update', :id => @auth_source}, :class => "tabular") %> <%= render :partial => 'form' %> <%= submit_tag l(:button_save) %> <%= end_form_tag %> diff --git a/redmine/app/views/auth_sources/list.rhtml b/redmine/app/views/auth_sources/list.rhtml index cbaa9c3eb..1c27ddaf7 100644 --- a/redmine/app/views/auth_sources/list.rhtml +++ b/redmine/app/views/auth_sources/list.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_auth_source_plural)%></h2> -<table border="0" cellspacing="1" cellpadding="2" class="listTableContent"> +<table class="listTableContent"> <tr class="ListHead"> <td><%=l(:field_name)%></td> <td><%=l(:field_type)%></td> @@ -18,9 +18,7 @@ <%= link_to l(:button_test), :action => 'test_connection', :id => source %> </td> <td align="center"> - <%= start_form_tag :action => 'destroy', :id => source %> - <%= submit_tag l(:button_delete), :class => "button-small" %> - <%= end_form_tag %> + <%= button_to l(:button_delete), { :action => 'destroy', :id => source }, :confirm => l(:text_are_you_sure), :class => "button-small" %> </td> </tr> <% end %> diff --git a/redmine/app/views/auth_sources/new.rhtml b/redmine/app/views/auth_sources/new.rhtml index 7cb81dab0..29d66327b 100644 --- a/redmine/app/views/auth_sources/new.rhtml +++ b/redmine/app/views/auth_sources/new.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_auth_source_new)%> (<%= @auth_source.auth_method_name %>)</h2> -<%= start_form_tag :action => 'create' %> +<%= start_form_tag({:action => 'create'}, :class => "tabular") %> <%= render :partial => 'form' %> <%= submit_tag l(:button_create) %> <%= end_form_tag %> diff --git a/redmine/app/views/custom_fields/_form.rhtml b/redmine/app/views/custom_fields/_form.rhtml index 00e36dd36..f7f968e33 100644 --- a/redmine/app/views/custom_fields/_form.rhtml +++ b/redmine/app/views/custom_fields/_form.rhtml @@ -2,21 +2,21 @@ <!--[form:custom_field]--> <div class="box"> -<p><label for="custom_field_name"><%=l(:field_name)%></label> <span class="required">*</span><br/> +<p><label for="custom_field_name"><%=l(:field_name)%><span class="required"> *</span></label> <%= text_field 'custom_field', 'name' %></p> -<p><label for="custom_field_typ"><%=l(:field_field_format)%></label><br/> +<p><label for="custom_field_field_format"><%=l(:field_field_format)%></label> <%= select("custom_field", "field_format", custom_field_formats_for_select) %></p>
-<p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label> (<%=l(:text_min_max_length_info)%>)<br/> +<p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label> <%= text_field 'custom_field', 'min_length', :size => 5 %> - -<%= text_field 'custom_field', 'max_length', :size => 5 %></p>
+<%= text_field 'custom_field', 'max_length', :size => 5 %><br>(<%=l(:text_min_max_length_info)%>)</p>
-<p><label for="custom_field_regexp"><%=l(:field_regexp)%></label> (<%=l(:text_regexp_info)%>)<br/> -<%= text_field 'custom_field', 'regexp', :size => 50 %></p>
+<p><label for="custom_field_regexp"><%=l(:field_regexp)%></label> +<%= text_field 'custom_field', 'regexp', :size => 50 %><br>(<%=l(:text_regexp_info)%>)</p>
-<p><label for="custom_field_possible_values"><%=l(:field_possible_values)%></label> (<%=l(:text_possible_values_info)%>)<br/> -<%= text_area 'custom_field', 'possible_values', :rows => 5, :cols => 60 %></p> +<p><label for="custom_field_possible_values"><%=l(:field_possible_values)%></label> +<%= text_area 'custom_field', 'possible_values', :rows => 5, :cols => 60 %><br>(<%=l(:text_possible_values_info)%>)</p> </div>
<!--[eoform:custom_field]--> @@ -34,20 +34,19 @@ <% end %></fieldset>
-<p><%= check_box 'custom_field', 'is_required' %> -<label for="custom_field_is_required"><%=l(:field_is_required)%></label></p> +<p><label for="custom_field_is_required"><%=l(:field_is_required)%></label> +<%= check_box 'custom_field', 'is_required' %></p> -<p><%= check_box 'custom_field', 'is_for_all' %> -<label for="custom_field_is_for_all"><%=l(:field_is_for_all)%></label></p> +<p><label for="custom_field_is_for_all"><%=l(:field_is_for_all)%></label> +<%= check_box 'custom_field', 'is_for_all' %></p> <% when "UserCustomField" %> -<p><%= check_box 'custom_field', 'is_required' %> -<label for="custom_field_is_required"><%=l(:field_is_required)%></label></p> +<p><label for="custom_field_is_required"><%=l(:field_is_required)%></label> +<%= check_box 'custom_field', 'is_required' %></p> <% when "ProjectCustomField" %> -<p><%= check_box 'custom_field', 'is_required' %> -<label for="custom_field_is_required"><%=l(:field_is_required)%></label></p> - +<p><label for="custom_field_is_required"><%=l(:field_is_required)%></label> +<%= check_box 'custom_field', 'is_required' %></p> <% end %> </div> diff --git a/redmine/app/views/custom_fields/edit.rhtml b/redmine/app/views/custom_fields/edit.rhtml index c9473fd04..201047a8d 100644 --- a/redmine/app/views/custom_fields/edit.rhtml +++ b/redmine/app/views/custom_fields/edit.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_custom_field)%> (<%=l(@custom_field.type_name)%>)</h2> -<%= start_form_tag :action => 'edit', :id => @custom_field %> +<%= start_form_tag({:action => 'edit', :id => @custom_field}, :class => "tabular") %> <%= render :partial => 'form', :locals => { :type => @custom_field.type } %> <%= submit_tag l(:button_save) %> <%= end_form_tag %> diff --git a/redmine/app/views/custom_fields/list.rhtml b/redmine/app/views/custom_fields/list.rhtml index 7f45f7a89..858590c49 100644 --- a/redmine/app/views/custom_fields/list.rhtml +++ b/redmine/app/views/custom_fields/list.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_custom_field_plural)%></h2> -<table border="0" cellspacing="1" cellpadding="2" class="listTableContent">
+<table class="listTableContent">
<tr class="ListHead"> <th><%=l(:field_name)%></th> <th><%=l(:field_type)%></th>
@@ -19,9 +19,8 @@ <td align="center"><%= image_tag 'true' 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> <td align="center"> - <%= start_form_tag :action => 'destroy', :id => custom_field %>
- <%= submit_tag l(:button_delete), :class => "button-small" %>
- <%= end_form_tag %> </td> + <%= button_to l(:button_delete), { :action => 'destroy', :id => custom_field }, :confirm => l(:text_are_you_sure), :class => "button-small" %> + </td> </tr> <% end %> </table>
diff --git a/redmine/app/views/custom_fields/new.rhtml b/redmine/app/views/custom_fields/new.rhtml index 1605ada2b..3b215dc9f 100644 --- a/redmine/app/views/custom_fields/new.rhtml +++ b/redmine/app/views/custom_fields/new.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_custom_field_new)%> (<%=l(@custom_field.type_name)%>)</h2> -<%= start_form_tag :action => 'new' %> +<%= start_form_tag({:action => 'new'}, :class => "tabular") %> <%= render :partial => 'form', :locals => { :type => @custom_field.type } %> <%= hidden_field_tag 'type', @custom_field.type %> <%= submit_tag l(:button_save) %> diff --git a/redmine/app/views/documents/_form.rhtml b/redmine/app/views/documents/_form.rhtml index ae56cdd46..724bcbaa2 100644 --- a/redmine/app/views/documents/_form.rhtml +++ b/redmine/app/views/documents/_form.rhtml @@ -1,15 +1,15 @@ <%= error_messages_for 'document' %> - +<div class="box"> <!--[form:document]--> -<p><label for="document_category_id"><%=l(:field_category)%></label><br />
+<p><label for="document_category_id"><%=l(:field_category)%></label>
<select name="document[category_id]">
<%= options_from_collection_for_select @categories, "id", "name", @document.category_id %> </select></p>
-<p><label for="document_title"><%=l(:field_title)%> <span class="required">*</span></label><br /> +<p><label for="document_title"><%=l(:field_title)%> <span class="required">*</span></label> <%= text_field 'document', 'title', :size => 60 %></p> -<p><label for="document_description"><%=l(:field_description)%></label><br /> +<p><label for="document_description"><%=l(:field_description)%></label> <%= text_area 'document', 'description', :cols => 60, :rows => 5 %></p> <!--[eoform:document]--> - +</div>
\ No newline at end of file diff --git a/redmine/app/views/documents/edit.rhtml b/redmine/app/views/documents/edit.rhtml index 059c99d9b..3db4bcc6a 100644 --- a/redmine/app/views/documents/edit.rhtml +++ b/redmine/app/views/documents/edit.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_document)%></h2> -<%= start_form_tag :action => 'edit', :id => @document %> +<%= start_form_tag({:action => 'edit', :id => @document}, :class => "tabular") %> <%= render :partial => 'form' %> <%= submit_tag l(:button_save) %> <%= end_form_tag %> diff --git a/redmine/app/views/enumerations/_form.rhtml b/redmine/app/views/enumerations/_form.rhtml index 280eebfbd..637605939 100644 --- a/redmine/app/views/enumerations/_form.rhtml +++ b/redmine/app/views/enumerations/_form.rhtml @@ -1,9 +1,9 @@ <%= error_messages_for 'enumeration' %> - +<div class="box"> <!--[form:optvalue]--> <%= hidden_field 'enumeration', 'opt' %> -<p><label for="enumeration_name"><%=l(:field_name)%></label><br/> +<p><label for="enumeration_name"><%=l(:field_name)%></label> <%= text_field 'enumeration', 'name' %></p> <!--[eoform:optvalue]--> - +</div>
\ No newline at end of file diff --git a/redmine/app/views/enumerations/edit.rhtml b/redmine/app/views/enumerations/edit.rhtml index 5c26414eb..3002b5936 100644 --- a/redmine/app/views/enumerations/edit.rhtml +++ b/redmine/app/views/enumerations/edit.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_enumerations)%></h2> -<%= start_form_tag :action => 'update', :id => @enumeration %> +<%= start_form_tag({:action => 'update', :id => @enumeration}, :class => "tabular") %> <%= render :partial => 'form' %> <%= submit_tag l(:button_save) %> <%= end_form_tag %> diff --git a/redmine/app/views/enumerations/new.rhtml b/redmine/app/views/enumerations/new.rhtml index 87ede016c..aa0e68173 100644 --- a/redmine/app/views/enumerations/new.rhtml +++ b/redmine/app/views/enumerations/new.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_enumeration_new)%></h2> -<%= start_form_tag :action => 'create' %> +<%= start_form_tag({:action => 'create'}, :class => "tabular") %> <%= render :partial => 'form' %> <%= submit_tag l(:button_create) %> <%= end_form_tag %> diff --git a/redmine/app/views/issue_categories/_form.rhtml b/redmine/app/views/issue_categories/_form.rhtml index fdf0cfda8..765b8f53d 100644 --- a/redmine/app/views/issue_categories/_form.rhtml +++ b/redmine/app/views/issue_categories/_form.rhtml @@ -1,7 +1,7 @@ <%= error_messages_for 'issue_category' %> <!--[form:issue_category]--> -<p><label for="issue_category_name"><%l(:field_name)%></label><br/> +<p><label for="issue_category_name"><%l(:field_name)%></label> <%= text_field 'issue_category', 'name' %></p> <!--[eoform:issue_category]--> diff --git a/redmine/app/views/issue_categories/edit.rhtml b/redmine/app/views/issue_categories/edit.rhtml index 087dd7c1b..053facbf7 100644 --- a/redmine/app/views/issue_categories/edit.rhtml +++ b/redmine/app/views/issue_categories/edit.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_issue_category)%></h2> -<%= start_form_tag :action => 'edit', :id => @category %> +<%= start_form_tag({:action => 'edit', :id => @category}, :class => "tabular") %> <%= render :partial => 'form' %> <%= submit_tag l(:button_save) %> <%= end_form_tag %> diff --git a/redmine/app/views/issue_statuses/_form.rhtml b/redmine/app/views/issue_statuses/_form.rhtml index 237466a3e..f3b1cf2ca 100644 --- a/redmine/app/views/issue_statuses/_form.rhtml +++ b/redmine/app/views/issue_statuses/_form.rhtml @@ -1,17 +1,18 @@ <%= error_messages_for 'issue_status' %> +<div class="box"> <!--[form:issue_status]--> -<p><label for="issue_status_name"><%=l(:field_name)%></label> <span class="required">*</span><br/> +<p><label for="issue_status_name"><%=l(:field_name)%><span class="required"> *</span></label> <%= text_field 'issue_status', 'name' %></p> -<p><%= check_box 'issue_status', 'is_closed' %>
-<label for="issue_status_is_closed"><%=l(:field_is_closed)%></label></p>
+<p><label for="issue_status_is_closed"><%=l(:field_is_closed)%></label> +<%= check_box 'issue_status', 'is_closed' %></p>
-<p><%= check_box 'issue_status', 'is_default' %>
-<label for="issue_status_is_default"><%=l(:field_is_default)%></label></p>
+<p><label for="issue_status_is_default"><%=l(:field_is_default)%></label> +<%= check_box 'issue_status', 'is_default' %></p>
-<p><label for="issue_status_html_color"><%=l(:field_html_color)%></label> -#<%= text_field 'issue_status', 'html_color', :maxlength => 6 %> <span class="required">*</span></p>
+<p><label for="issue_status_html_color"><%=l(:field_html_color)%><span class="required"> *</span></label> +#<%= text_field 'issue_status', 'html_color', :maxlength => 6 %></p>
<!--[eoform:issue_status]--> - +</div>
\ No newline at end of file diff --git a/redmine/app/views/issue_statuses/edit.rhtml b/redmine/app/views/issue_statuses/edit.rhtml index 140a40d94..80f856a2a 100644 --- a/redmine/app/views/issue_statuses/edit.rhtml +++ b/redmine/app/views/issue_statuses/edit.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_issue_status)%></h2> -<%= start_form_tag :action => 'update', :id => @issue_status %> +<%= start_form_tag({:action => 'update', :id => @issue_status}, :class => "tabular") %> <%= render :partial => 'form' %> <%= submit_tag l(:button_save) %> <%= end_form_tag %> diff --git a/redmine/app/views/issue_statuses/list.rhtml b/redmine/app/views/issue_statuses/list.rhtml index ce7f8469c..023863437 100644 --- a/redmine/app/views/issue_statuses/list.rhtml +++ b/redmine/app/views/issue_statuses/list.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_issue_status_plural)%></h2> -<table border="0" cellspacing="1" cellpadding="2" class="listTableContent"> +<table class="listTableContent"> <tr class="ListHead"> <th><%=l(:field_status)%></th>
<th><%=l(:field_is_default)%></th>
@@ -14,11 +14,9 @@ <td><%= link_to status.name, :action => 'edit', :id => status %></td>
<td align="center"><%= image_tag 'true' if status.is_default? %></td>
<td align="center"><%= image_tag 'true' if status.is_closed? %></td> - <td bgcolor="#<%= status.html_color %>"> </td>
- <td align="center">
- <%= start_form_tag :action => 'destroy', :id => status %>
- <%= submit_tag l(:button_delete), :class => "button-small" %>
- <%= end_form_tag %> + <td><div style="background-color:#<%= status.html_color %>"> </div></td>
+ <td align="center"> + <%= button_to l(:button_delete), { :action => 'destroy', :id => status }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
</td> </tr> <% end %> diff --git a/redmine/app/views/issue_statuses/new.rhtml b/redmine/app/views/issue_statuses/new.rhtml index 1dc61eb85..2dacb1e21 100644 --- a/redmine/app/views/issue_statuses/new.rhtml +++ b/redmine/app/views/issue_statuses/new.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_issue_status_new)%></h2> -<%= start_form_tag :action => 'create' %> +<%= start_form_tag({:action => 'create'}, :class => "tabular") %> <%= render :partial => 'form' %> <%= submit_tag l(:button_create) %> <%= end_form_tag %> diff --git a/redmine/app/views/issues/_list_simple.rhtml b/redmine/app/views/issues/_list_simple.rhtml index bcc05d1e8..bbf193bfd 100644 --- a/redmine/app/views/issues/_list_simple.rhtml +++ b/redmine/app/views/issues/_list_simple.rhtml @@ -1,7 +1,7 @@ <% if issues.length > 0 %>
<table cellspacing="0" cellpadding="1" width="100%" border="0" class="listTable">
<tr><td>
- <table width="100%" border="0" cellspacing="1" cellpadding="2" class="listTableContent">
+ <table class="listTableContent">
<tr class="ListHead">
<th>#</th>
<th><%=l(:field_tracker)%></th>
diff --git a/redmine/app/views/issues/change_status.rhtml b/redmine/app/views/issues/change_status.rhtml index 35494dbb9..9c14bdb88 100644 --- a/redmine/app/views/issues/change_status.rhtml +++ b/redmine/app/views/issues/change_status.rhtml @@ -1,29 +1,27 @@ <h2><%=l(:label_issue)%> #<%= @issue.id %>: <%= @issue.subject %></h2> <%= error_messages_for 'history' %>
-<%= start_form_tag :action => 'change_status', :id => @issue %>
+<%= start_form_tag({:action => 'change_status', :id => @issue}, :class => "tabular") %>
<%= hidden_field_tag 'confirm', 1 %>
<%= hidden_field 'history', 'status_id' %> <div class="box">
-<p><%=l(:label_issue_status_new)%>: <b><%= @history.status.name %></b></p>
+<p><label><%=l(:label_issue_status_new)%></label> <%= @history.status.name %></p>
-<div>
-<p><label for="issue_assigned_to_id"><%=l(:field_assigned_to)%></label><br/> +<p><label for="issue_assigned_to_id"><%=l(:field_assigned_to)%></label> <select name="issue[assigned_to_id]">
<option value=""></option>
<%= options_from_collection_for_select @assignable_to, "id", "display_name", @issue.assigned_to_id %></p> </select></p>
-</div>
-<p><label for="issue_fixed_version"><%=l(:field_fixed_version)%></label><br/> +<p><label for="issue_fixed_version"><%=l(:field_fixed_version)%></label> <select name="issue[fixed_version_id]">
<option value="">--none--</option>
<%= options_from_collection_for_select @issue.project.versions, "id", "name", @issue.fixed_version_id %>
</select></p>
-<p><label for="history_notes"><%=l(:field_notes)%></label><br />
+<p><label for="history_notes"><%=l(:field_notes)%></label>
<%= text_area 'history', 'notes', :cols => 60, :rows => 10 %></p>
</div> diff --git a/redmine/app/views/issues/edit.rhtml b/redmine/app/views/issues/edit.rhtml index 0386173ef..5a118f893 100644 --- a/redmine/app/views/issues/edit.rhtml +++ b/redmine/app/views/issues/edit.rhtml @@ -1,56 +1,26 @@ <h2><%= @issue.tracker.name %> #<%= @issue.id %> - <%= @issue.subject %></h2> -<%= error_messages_for 'issue' %>
-<%= start_form_tag :action => 'edit', :id => @issue %> - +<% labelled_tabular_form_for :issue, @issue, :url => {:action => 'edit'} do |f| %> +<%= error_messages_for 'issue' %> <div class="box"> -<!--[form:issue]-->
-<p><%=l(:field_status)%>: <b><%= @issue.status.name %></b></p>
- -<div style="float:left;margin-right:10px;">
-<p><label for="issue_priority_id"><%=l(:field_priority)%> <span class="required">*</span></label><br/> -<select name="issue[priority_id]">
-<%= options_from_collection_for_select @priorities, "id", "name", @issue.priority_id %></p> -</select></p>
-</div>
-
-<div style="float:left;margin-right:10px;">
-<p><label for="issue_assigned_to_id"><%=l(:field_assigned_to)%></label><br/> -<select name="issue[assigned_to_id]">
-<option value=""></option>
-<%= options_from_collection_for_select @issue.project.members, "user_id", "name", @issue.assigned_to_id %></p> -</select></p>
-</div>
-
-<div>
-<p><label for="issue_category_id"><%=l(:field_category)%></label><br/> -<select name="issue[category_id]">
-<option value=""></option>
-<%= options_from_collection_for_select @project.issue_categories, "id", "name", @issue.category_id %></p> -</select></p>
-</div>
-
-<p><label for="issue_subject"><%=l(:field_subject)%></label><span class="required">*</span><br/> -<%= text_field 'issue', 'subject', :size => 60 %></p> +<!--[form:issue]--> +<p><label><%=l(:field_status)%></label> <%= @issue.status.name %></p> -<p><label for="issue_description"><%=l(:field_description)%></label><span class="required">*</span><br/> -<%= text_area 'issue', 'description', :cols => 60, :rows => 10 %></p> +<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p> +<p><%= f.select :assigned_to_id, (@issue.project.members.collect {|m| [m.name, m.user_id]}), :include_blank => true %></p> +<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}) %></p> +<p><%= f.text_field :subject, :size => 80, :required => true %></p> +<p><%= f.text_area :description, :cols => 60, :rows => 10, :required => true %></p> +<p><%= f.date_select :due_date, :start_year => Date.today.year, :include_blank => true %></p> -<p><label for="issue_due_date"><%=l(:field_due_date)%></label><br /> -<%= date_select 'issue', 'due_date', :start_year => Date.today.year, :include_blank => true %></p> -
<% for @custom_value in @custom_values %> <p><%= custom_field_tag_with_label @custom_value %></p> -<% end %>
-
-<p><label for="issue_fixed_version"><%=l(:field_fixed_version)%></label><br/> -<select name="issue[fixed_version_id]">
-<option value="">--none--</option>
-<%= options_from_collection_for_select @project.versions, "id", "name", @issue.fixed_version_id %>
-</select></p> +<% end %> -<!--[eoform:issue]-->
+<p><%= f.select :fixed_version_id, (@project.versions.collect {|v| [v.name, v.id]}), { :include_blank => true } %> +</select></p> +<!--[eoform:issue]--> </div> -
+ <%= submit_tag l(:button_save) %> -<%= end_form_tag %>
+<% end %>
\ No newline at end of file diff --git a/redmine/app/views/news/_form.rhtml b/redmine/app/views/news/_form.rhtml index 564a8834a..02bb824d9 100644 --- a/redmine/app/views/news/_form.rhtml +++ b/redmine/app/views/news/_form.rhtml @@ -1,13 +1,6 @@ <%= error_messages_for 'news' %> - -<!--[form:news]--> -<p><label for="news_title"><%=l(:field_title)%></label> <span class="required">*</span><br/> -<%= text_field 'news', 'title', :size => 60 %></p> - -<p><label for="news_summary"><%=l(:field_summary)%></label><br/> -<%= text_area 'news', 'summary', :cols => 60, :rows => 2 %></p> - -<p><label for="news_description"><%=l(:field_description)%> <span class="required">*</span></label><br/> -<%= text_area 'news', 'description', :cols => 60, :rows => 10 %></p> -<!--[eoform:news]--> - +<div class="box"> +<p><%= f.text_field :title, :required => true, :size => 60 %></p> +<p><%= f.text_area :summary, :cols => 60, :rows => 2 %></p> +<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 10 %></p> +</div>
\ No newline at end of file diff --git a/redmine/app/views/news/edit.rhtml b/redmine/app/views/news/edit.rhtml index 27f7ac993..5e015c4c7 100644 --- a/redmine/app/views/news/edit.rhtml +++ b/redmine/app/views/news/edit.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_news)%></h2> -<%= start_form_tag :action => 'edit', :id => @news %> - <%= render :partial => 'form' %> - <%= submit_tag l(:button_save) %> -<%= end_form_tag %> +<% labelled_tabular_form_for :news, @news, :url => { :action => "edit" } do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> +<%= submit_tag l(:button_save) %> +<% end %>
\ No newline at end of file diff --git a/redmine/app/views/news/show.rhtml b/redmine/app/views/news/show.rhtml index 2ff75fa8a..bea9af4fb 100644 --- a/redmine/app/views/news/show.rhtml +++ b/redmine/app/views/news/show.rhtml @@ -7,4 +7,15 @@ </p>
<%= simple_format auto_link @news.description %> - +
+<% if authorize_for('news', 'edit') %>
+ <%= start_form_tag ({:controller => 'news', :action => 'edit', :id => @news}, :method => 'get' ) %>
+ <%= submit_tag l(:button_edit) %>
+ <%= end_form_tag %>
+<% end %>
+
+<% if authorize_for('news', 'destroy') %>
+ <%= start_form_tag ({:controller => 'news', :action => 'destroy', :id => @news}) %>
+ <%= submit_tag l(:button_delete) %>
+ <%= end_form_tag %>
+<% end %>
diff --git a/redmine/app/views/projects/_form.rhtml b/redmine/app/views/projects/_form.rhtml index 18b703cbd..889404bbc 100644 --- a/redmine/app/views/projects/_form.rhtml +++ b/redmine/app/views/projects/_form.rhtml @@ -1,41 +1,24 @@ <%= error_messages_for 'project' %> - <div class="box"> <!--[form:project]--> -<p><label for="project_name"><%=l(:field_name)%> <span class="required">*</span></label><br/> -<%= text_field 'project', 'name' %></p> +<p><%= f.text_field :name, :required => true %></p> <% if admin_loggedin? %> -<p><label for="project_parent_id"><%=l(:field_parent)%></label><br/> -<select name="project[parent_id]"> -<option value=""></option> -<%= options_from_collection_for_select @root_projects, "id", "name", @project.parent_id %> -</select></p> + <p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p> <% end %> -<p><label for="project_description"><%=l(:field_description)%> <span class="required">*</span></label><br/> -<%= text_area 'project', 'description', :cols => 60, :rows => 3 %></p> -
-<p><label for="project_homepage"><%=l(:field_homepage)%></label><br/> -<%= text_field 'project', 'homepage', :size => 40 %></p> - -<p><%= check_box 'project', 'is_public' %>
-<label for="project_is_public"><%=l(:field_is_public)%></label></p> +<p><%= f.text_area :description, :required => true, :cols => 60, :rows => 3 %></p> +<p><%= f.text_field :homepage, :size => 40 %></p> +<p><%= f.check_box :is_public %></p> <% for @custom_value in @custom_values %> <p><%= custom_field_tag_with_label @custom_value %></p> <% end %>
-<fieldset><legend><%=l(:label_custom_field_plural)%></legend>
-<% for custom_field in @custom_fields %>
- <input type="checkbox"
-
- name="custom_field_ids[]"
- value="<%= custom_field.id %>"
- <%if @project.custom_fields.include? custom_field%>checked="checked"<%end%>
- > <%= custom_field.name %>
-
-<% end %></fieldset>
-
+<p><label><%=l(:label_custom_field_plural)%></label>
+<% for custom_field in @custom_fields %> + <%= check_box_tag "custom_field_ids[]", custom_field.id, (@project.custom_fields.include? custom_field) %>
+ <%= custom_field.name %>
+<% end %></p>
+<!--[eoform:project]-->
</div> -<!--[eoform:project]--> diff --git a/redmine/app/views/projects/add.rhtml b/redmine/app/views/projects/add.rhtml index 2dd4eb450..bafbf9145 100644 --- a/redmine/app/views/projects/add.rhtml +++ b/redmine/app/views/projects/add.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_project_new)%></h2> -<%= start_form_tag :action => 'add' %>
-<%= render :partial => 'form' %>
-<%= submit_tag l(:button_create) %> -<%= end_form_tag %> +<% labelled_tabular_form_for :project, @project, :url => { :action => "add" } do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> +<%= submit_tag l(:button_save) %> +<% end %>
\ No newline at end of file diff --git a/redmine/app/views/projects/add_document.rhtml b/redmine/app/views/projects/add_document.rhtml index 8d6d2e39d..88572f409 100644 --- a/redmine/app/views/projects/add_document.rhtml +++ b/redmine/app/views/projects/add_document.rhtml @@ -1,10 +1,12 @@ <h2><%=l(:label_document_new)%></h2> -<%= start_form_tag( { :action => 'add_document', :id => @project }, :multipart => true) %>
+<%= start_form_tag( { :action => 'add_document', :id => @project }, :class => "tabular", :multipart => true) %>
<%= render :partial => 'documents/form' %> -
-<p><label for="attachment_file"><%=l(:label_attachment)%></label><br/> -<%= file_field 'attachment', 'file' %></p> + +<div class="box">
+<p><label for="attachment_file"><%=l(:label_attachment)%></label> +<%= file_field 'attachment', 'file' %></p> +</div> <%= submit_tag l(:button_create) %> <%= end_form_tag %> diff --git a/redmine/app/views/projects/add_issue.rhtml b/redmine/app/views/projects/add_issue.rhtml index 123513371..f640ad2b7 100644 --- a/redmine/app/views/projects/add_issue.rhtml +++ b/redmine/app/views/projects/add_issue.rhtml @@ -1,52 +1,26 @@ <h2><%=l(:label_issue_new)%>: <%= @tracker.name %></h2> -<%= start_form_tag( { :action => 'add_issue', :id => @project }, :multipart => true) %>
+<% labelled_tabular_form_for :issue, @issue, :url => {:action => 'add_issue'}, :html => {:multipart => true} do |f| %> <%= error_messages_for 'issue' %> - <div class="box"> -<!--[form:issue]-->
- +<!--[form:issue]--> <%= hidden_field_tag 'tracker_id', @tracker.id %> -<div style="float:left;margin-right:10px;">
-<p><label for="issue_priority_id"><%=l(:field_priority)%> <span class="required">*</span></label><br /> -<select name="issue[priority_id]">
-<%= options_from_collection_for_select @priorities, "id", "name", @issue.priority_id %></p> -</select></p>
-</div>
-
-<div style="float:left;margin-right:10px;">
-<p><label for="issue_assigned_to_id"><%=l(:field_assigned_to)%></label><br /> -<select name="issue[assigned_to_id]">
-<option value=""></option>
-<%= options_from_collection_for_select @issue.project.members, "user_id", "name", @issue.assigned_to_id %></p> -</select></p>
-</div>
-
-<div>
-<p><label for="issue_category_id"><%=l(:field_category)%></label><br /> -<select name="issue[category_id]">
-<option value=""></option><%= options_from_collection_for_select @project.issue_categories, "id", "name", @issue.category_id %> -</select></p>
-</div>
- -<p><label for="issue_subject"><%=l(:field_subject)%> <span class="required">*</span></label><br /> -<%= text_field 'issue', 'subject', :size => 80 %></p> -
-<p><label for="issue_description"><%=l(:field_description)%> <span class="required">*</span></label><br /> -<%= text_area 'issue', 'description', :cols => 60, :rows => 10 %></p>
- -<p><label for="issue_due_date"><%=l(:field_due_date)%></label><br /> -<%= date_select 'issue', 'due_date', :start_year => Date.today.year, :include_blank => true %></p> +<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
+<p><%= f.select :assigned_to_id, (@issue.project.members.collect {|m| [m.name, m.user_id]}), :include_blank => true %></p>
+<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}) %></p>
+<p><%= f.text_field :subject, :size => 80, :required => true %></p> +<p><%= f.text_area :description, :cols => 60, :rows => 10, :required => true %></p> +<p><%= f.date_select :due_date, :start_year => Date.today.year, :include_blank => true %></p> <% for @custom_value in @custom_values %> <p><%= custom_field_tag_with_label @custom_value %></p> <% end %>
-<p><label for="attachment_file"><%=l(:label_attachment)%></label><br /> +<p><label for="attachment_file"><%=l(:label_attachment)%></label> <%= file_field 'attachment', 'file' %></p>
<!--[eoform:issue]-->
</div> <%= submit_tag l(:button_create) %>
-<%= end_form_tag %>
\ No newline at end of file +<% end %>
\ No newline at end of file diff --git a/redmine/app/views/projects/add_news.rhtml b/redmine/app/views/projects/add_news.rhtml index abe6e96e0..a6ecd3da7 100644 --- a/redmine/app/views/projects/add_news.rhtml +++ b/redmine/app/views/projects/add_news.rhtml @@ -1,7 +1,6 @@ <h2><%=l(:label_news_new)%></h2> -<%= start_form_tag :action => 'add_news', :id => @project %> - <%= render :partial => 'news/form' %>
- <%= submit_tag l(:button_create) %> -<%= end_form_tag %> - +<% labelled_tabular_form_for :news, @news, :url => { :action => "add_news" } do |f| %> +<%= render :partial => 'news/form', :locals => { :f => f } %> +<%= submit_tag l(:button_create) %> +<% end %>
\ No newline at end of file diff --git a/redmine/app/views/projects/add_version.rhtml b/redmine/app/views/projects/add_version.rhtml index 501a7e615..c038b7de9 100644 --- a/redmine/app/views/projects/add_version.rhtml +++ b/redmine/app/views/projects/add_version.rhtml @@ -1,7 +1,6 @@ <h2><%=l(:label_version_new)%></h2> -<%= start_form_tag :action => 'add_version', :id => @project %>
- <%= render :partial => 'versions/form' %>
- <%= submit_tag l(:button_create) %> -<%= end_form_tag %> - +<% labelled_tabular_form_for :version, @version, :url => { :action => 'add_version' } do |f| %> +<%= render :partial => 'versions/form', :locals => { :f => f } %> +<%= submit_tag l(:button_create) %> +<% end %>
\ No newline at end of file diff --git a/redmine/app/views/projects/list.rhtml b/redmine/app/views/projects/list.rhtml index b48fef39a..0137086d9 100644 --- a/redmine/app/views/projects/list.rhtml +++ b/redmine/app/views/projects/list.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_public_projects)%></h2> -<table width="100%" cellspacing="1" cellpadding="2" class="listTableContent"> +<table class="listTableContent"> <tr class="ListHead"> <%= sort_header_tag('name', :caption => l(:label_project)) %>
<th><%=l(:field_description)%></th>
diff --git a/redmine/app/views/projects/list_files.rhtml b/redmine/app/views/projects/list_files.rhtml index a2a06c936..5fe65e6a6 100644 --- a/redmine/app/views/projects/list_files.rhtml +++ b/redmine/app/views/projects/list_files.rhtml @@ -2,7 +2,7 @@ <% delete_allowed = authorize_for('versions', 'destroy_file') %>
-<table border="0" cellspacing="1" cellpadding="2" class="listTableContent">
+<table class="listTableContent">
<tr class="ListHead">
<th><%=l(:field_version)%></th>
<th><%=l(:field_filename)%></th>
diff --git a/redmine/app/views/projects/list_issues.rhtml b/redmine/app/views/projects/list_issues.rhtml index 4bba76bb7..d18799acf 100644 --- a/redmine/app/views/projects/list_issues.rhtml +++ b/redmine/app/views/projects/list_issues.rhtml @@ -22,7 +22,7 @@ </tr>
</table>
-<table border="0" cellspacing="1" cellpadding="2" class="listTableContent">
+<table class="listTableContent">
<tr><td colspan="7" align="right">
<small><%= link_to l(:label_export_csv), :action => 'export_issues_csv', :id => @project.id %></small>
</td></tr>
diff --git a/redmine/app/views/projects/list_news.rhtml b/redmine/app/views/projects/list_news.rhtml index a1b15941a..f31f927ac 100644 --- a/redmine/app/views/projects/list_news.rhtml +++ b/redmine/app/views/projects/list_news.rhtml @@ -2,11 +2,8 @@ <% for news in @news %>
<p>
- <b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small>
- <%= link_to_if_authorized image_tag('edit_small'), :controller => 'news', :action => 'edit', :id => news %>
- <%= link_to_if_authorized image_tag('delete'), { :controller => 'news', :action => 'destroy', :id => news }, :confirm => 'Are you sure?' %>
- <br />
- <%= news.summary %>
+ <b><%= news.title %></b> <small>(<%= link_to_user news.author %> <%= format_time(news.created_on) %>)</small><br />
+ <%= news.summary %><br />
<small>[<%= link_to l(:label_read), :controller => 'news', :action => 'show', :id => news %>]</small>
</p>
<% end %> diff --git a/redmine/app/views/projects/settings.rhtml b/redmine/app/views/projects/settings.rhtml index 1d1684ff6..cb6864a23 100644 --- a/redmine/app/views/projects/settings.rhtml +++ b/redmine/app/views/projects/settings.rhtml @@ -1,9 +1,9 @@ <h2><%=l(:label_settings)%></h2> -<%= start_form_tag :action => 'edit', :id => @project %> -<%= render :partial => 'form' %>
-<center><%= submit_tag l(:button_save) %></center> -<%= end_form_tag %> +<% labelled_tabular_form_for :project, @project, :url => { :action => "edit", :id => @project } do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> +<%= submit_tag l(:button_save) %> +<% end %> diff --git a/redmine/app/views/reports/issue_report.rhtml b/redmine/app/views/reports/issue_report.rhtml index 08347bdb2..1717583d3 100644 --- a/redmine/app/views/reports/issue_report.rhtml +++ b/redmine/app/views/reports/issue_report.rhtml @@ -11,3 +11,4 @@ <strong><%=l(:field_category)%></strong>
<%= render :partial => 'simple', :locals => { :data => @issues_by_category, :field_name => "category_id", :rows => @categories } %>
+
diff --git a/redmine/app/views/roles/_form.rhtml b/redmine/app/views/roles/_form.rhtml index b007d1e34..ea7bafc33 100644 --- a/redmine/app/views/roles/_form.rhtml +++ b/redmine/app/views/roles/_form.rhtml @@ -1,9 +1,7 @@ <%= error_messages_for 'role' %> - <div class="box"> <!--[form:role]-->
-<p><label for="role_name"><%=l(:field_name)%> <span class="required">*</span></label><br /> -<%= text_field 'role', 'name' %></p>
+<p><%= f.text_field :name, :required => true %></p>
<strong><%=l(:label_permissions)%>:</strong>
<% permissions = @permissions.group_by {|p| p.group_id } %>
diff --git a/redmine/app/views/roles/edit.rhtml b/redmine/app/views/roles/edit.rhtml index 0bc352506..ffe117cef 100644 --- a/redmine/app/views/roles/edit.rhtml +++ b/redmine/app/views/roles/edit.rhtml @@ -1,8 +1,6 @@ <h2><%=l(:label_role)%></h2> -<%= start_form_tag ({ :action => 'edit', :id => @role }, :id => 'role_form') %> -<%= render :partial => 'form' %>
+<% labelled_tabular_form_for :role, @role, :url => { :action => 'edit' }, :html => {:id => 'role_form'} do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> -<%= end_form_tag %>
- -
+<% end %>
diff --git a/redmine/app/views/roles/list.rhtml b/redmine/app/views/roles/list.rhtml index ae92a8071..169b3d1c0 100644 --- a/redmine/app/views/roles/list.rhtml +++ b/redmine/app/views/roles/list.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_role_plural)%></h2> -<table border="0" cellspacing="1" cellpadding="2" class="listTableContent"> +<table class="listTableContent"> <tr class="ListHead"> <th><%=l(:label_role)%></th> <th></th> @@ -9,10 +9,8 @@ <% for role in @roles %> <tr class="<%= cycle("odd", "even") %>"> <td><%= link_to role.name, :action => 'edit', :id => role %></td> - <td align="center">
- <%= start_form_tag :action => 'destroy', :id => role %>
- <%= submit_tag l(:button_delete), :class => "button-small" %>
- <%= end_form_tag %> + <td align="center"> + <%= button_to l(:button_delete), { :action => 'destroy', :id => role }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
</tr> <% end %> </table> diff --git a/redmine/app/views/roles/new.rhtml b/redmine/app/views/roles/new.rhtml index 11d2d9209..a73c36cb1 100644 --- a/redmine/app/views/roles/new.rhtml +++ b/redmine/app/views/roles/new.rhtml @@ -1,7 +1,6 @@ <h2><%=l(:label_role_new)%></h2> -<%= start_form_tag ({ :action => 'new' }, :id => 'role_form') %> -<%= render :partial => 'form' %> +<% labelled_tabular_form_for :role, @role, :url => { :action => 'new' }, :html => {:id => 'role_form'} do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_create) %> -<%= end_form_tag %> - +<% end %>
\ No newline at end of file diff --git a/redmine/app/views/trackers/_form.rhtml b/redmine/app/views/trackers/_form.rhtml index e0b74ec37..625c0d636 100644 --- a/redmine/app/views/trackers/_form.rhtml +++ b/redmine/app/views/trackers/_form.rhtml @@ -1,10 +1,7 @@ <%= error_messages_for 'tracker' %> - +<div class="box"> <!--[form:tracker]--> -<p><label for="tracker_name"><%=l(:field_name)%></label> <span class="required">*</span><br/> -<%= text_field 'tracker', 'name' %></p> -
-<p><%= check_box 'tracker', 'is_in_chlog' %>
-<label for="tracker_is_in_chlog"><%=l(:field_is_in_chlog)%></label></p>
+<p><%= f.text_field :name, :required => true %></p>
+<p><%= f.check_box :is_in_chlog %></p>
<!--[eoform:tracker]--> - +</div> diff --git a/redmine/app/views/trackers/edit.rhtml b/redmine/app/views/trackers/edit.rhtml index 25cec51d2..d8411099c 100644 --- a/redmine/app/views/trackers/edit.rhtml +++ b/redmine/app/views/trackers/edit.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_tracker)%></h2> -<%= start_form_tag :action => 'edit', :id => @tracker %> - <%= render :partial => 'form' %> - <%= submit_tag l(:button_save) %> -<%= end_form_tag %> +<% labelled_tabular_form_for :tracker, @tracker, :url => { :action => 'edit' } do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> +<%= submit_tag l(:button_save) %> +<% end %>
\ No newline at end of file diff --git a/redmine/app/views/trackers/list.rhtml b/redmine/app/views/trackers/list.rhtml index 475a6b9da..8d4a5c595 100644 --- a/redmine/app/views/trackers/list.rhtml +++ b/redmine/app/views/trackers/list.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_tracker_plural)%></h2> -<table border="0" cellspacing="1" cellpadding="2" class="listTableContent"> +<table class="listTableContent"> <tr class="ListHead"> <th><%=l(:label_tracker)%></th>
<th></th> @@ -9,10 +9,8 @@ <% for tracker in @trackers %> <tr class="<%= cycle("odd", "even") %>"> <td><%= link_to tracker.name, :action => 'edit', :id => tracker %></td> - <td align="center">
- <%= start_form_tag :action => 'destroy', :id => tracker %>
- <%= submit_tag l(:button_delete), :class => "button-small" %>
- <%= end_form_tag %>
+ <td align="center"> + <%= button_to l(:button_delete), { :action => 'destroy', :id => tracker }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
</td> </tr> <% end %> diff --git a/redmine/app/views/trackers/new.rhtml b/redmine/app/views/trackers/new.rhtml index 788854c28..b318a5dc4 100644 --- a/redmine/app/views/trackers/new.rhtml +++ b/redmine/app/views/trackers/new.rhtml @@ -1,7 +1,6 @@ <h2><%=l(:label_tracker_new)%></h2> -<%= start_form_tag :action => 'new' %> - <%= render :partial => 'form' %> - <%= submit_tag l(:button_create) %> -<%= end_form_tag %> - +<% labelled_tabular_form_for :tracker, @tracker, :url => { :action => 'new' } do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> +<%= submit_tag l(:button_create) %> +<% end %>
\ No newline at end of file diff --git a/redmine/app/views/users/_form.rhtml b/redmine/app/views/users/_form.rhtml index 08bce06c0..6a714a7b0 100644 --- a/redmine/app/views/users/_form.rhtml +++ b/redmine/app/views/users/_form.rhtml @@ -2,36 +2,25 @@ <div class="box"> <!--[form:user]--> -<p><label for="user_login"><%=l(:field_login)%></label> <span class="required">*</span><br/> -<%= text_field 'user', 'login', :size => 25 %></p> +<p><%= f.text_field :login, :required => true, :size => 25 %></p> -<p><label for="password"><%=l(:field_password)%></label> <span class="required">*</span><br/> +<p><label for="password"><%=l(:field_password)%><span class="required"> *</span></label> <%= password_field_tag 'password', nil, :size => 25 %></p> -<p><label for="password_confirmation"><%=l(:field_password_confirmation)%></label> <span class="required">*</span><br/> +<p><label for="password_confirmation"><%=l(:field_password_confirmation)%><span class="required"> *</span></label> <%= password_field_tag 'password_confirmation', nil, :size => 25 %></p> -<p><label for="user_firstname"><%=l(:field_firstname)%></label> <span class="required">*</span><br/> -<%= text_field 'user', 'firstname' %></p> -
-<p><label for="user_lastname"><%=l(:field_lastname)%></label> <span class="required">*</span><br/> -<%= text_field 'user', 'lastname' %></p> - -<p><label for="user_mail"><%=l(:field_mail)%></label> <span class="required">*</span><br/> -<%= text_field 'user', 'mail' %></p>
-
-<p><label for="user_language"><%=l(:field_language)%></label><br/> -<%= select("user", "language", lang_options_for_select) %></p>
+<p><%= f.text_field :firstname, :required => true %></p>
+<p><%= f.text_field :lastname, :required => true %></p> +<p><%= f.text_field :mail, :required => true %></p>
+<p><%= f.select :language, lang_options_for_select %></p>
<% for @custom_value in @custom_values %> <p><%= custom_field_tag_with_label @custom_value %></p> <% end %>
-<div style="clear: both;"></div>
- -<p><%= check_box 'user', 'admin' %> <label for="user_admin"><%=l(:field_admin)%></label></p>
-
-<p><%= check_box 'user', 'mail_notification' %> <label for="user_mail_notification"><%=l(:field_mail_notification)%></label></p>
+<p><%= f.check_box :admin %></p>
+<p><%= f.check_box :mail_notification %></p>
<!--[eoform:user]--> </div> diff --git a/redmine/app/views/users/add.rhtml b/redmine/app/views/users/add.rhtml index 13e7069fc..d4c6a15f4 100644 --- a/redmine/app/views/users/add.rhtml +++ b/redmine/app/views/users/add.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_user_new)%></h2> -<%= start_form_tag :action => 'add' %> - <%= render :partial => 'form' %> - <%= submit_tag l(:button_create) %> -<%= end_form_tag %> +<% labelled_tabular_form_for :user, @user, :url => { :action => "add" } do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> +<%= submit_tag l(:button_create) %> +<% end %>
\ No newline at end of file diff --git a/redmine/app/views/users/edit.rhtml b/redmine/app/views/users/edit.rhtml index 524b920f6..2332b70ad 100644 --- a/redmine/app/views/users/edit.rhtml +++ b/redmine/app/views/users/edit.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_user)%></h2> -<%= start_form_tag :action => 'edit', :id => @user %> - <%= render :partial => 'form' %> - <%= submit_tag l(:button_save) %> -<%= end_form_tag %> +<% labelled_tabular_form_for :user, @user, :url => { :action => "edit" } do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> +<%= submit_tag l(:button_save) %> +<% end %> diff --git a/redmine/app/views/users/list.rhtml b/redmine/app/views/users/list.rhtml index 129decd71..10540daa7 100644 --- a/redmine/app/views/users/list.rhtml +++ b/redmine/app/views/users/list.rhtml @@ -1,6 +1,6 @@ <h2><%=l(:label_user_plural)%></h2> -<table border="0" cellspacing="1" cellpadding="2" class="listTableContent">
+<table class="listTableContent">
<tr class="ListHead"> <%= sort_header_tag('login', :caption => l(:field_login)) %>
<%= sort_header_tag('firstname', :caption => l(:field_firstname)) %>
diff --git a/redmine/app/views/versions/_form.rhtml b/redmine/app/views/versions/_form.rhtml index 18de3c5c3..577e1c37f 100644 --- a/redmine/app/views/versions/_form.rhtml +++ b/redmine/app/views/versions/_form.rhtml @@ -1,13 +1,8 @@ <%= error_messages_for 'version' %> - +<div class="box"> <!--[form:version]--> -<p><label for="version_name"><%=l(:field_name)%></label> <span class="required">*</span><br/> -<%= text_field 'version', 'name', :size => 20 %></p> - -<p><label for="version_description"><%=l(:field_description)%></label><br/> -<%= text_field 'version', 'description', :size => 60 %></p> -
-<p><label for="version_effective_date"><%=l(:field_effective_date)%></label><br/> -<%= date_select 'version', 'effective_date' %></p> +<p><%= f.text_field :name, :size => 20, :required => true %></p> +<p><%= f.text_field :description, :size => 60 %></p> +<p><%= f.date_select :effective_date, :required => true %></p> <!--[eoform:version]--> - +</div>
\ No newline at end of file diff --git a/redmine/app/views/versions/edit.rhtml b/redmine/app/views/versions/edit.rhtml index 6851d79b8..1556ebba1 100644 --- a/redmine/app/views/versions/edit.rhtml +++ b/redmine/app/views/versions/edit.rhtml @@ -1,8 +1,7 @@ <h2><%=l(:label_version)%></h2> -<%= start_form_tag :action => 'edit', :id => @version %> - <%= render :partial => 'form' %> - <%= submit_tag l(:button_save) %> -<%= end_form_tag %> - +<% labelled_tabular_form_for :version, @version, :url => { :action => 'edit' } do |f| %> +<%= render :partial => 'form', :locals => { :f => f } %> +<%= submit_tag l(:button_save) %> +<% end %> |