##// END OF EJS Templates
Merged r2610, r2611 from trunk....
Jean-Philippe Lang -
r2565:16810acf015a
parent child
Show More
@@ -1,88 +1,90
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class CustomFieldsController < ApplicationController
18 class CustomFieldsController < ApplicationController
19 before_filter :require_admin
19 before_filter :require_admin
20
20
21 def index
21 def index
22 list
22 list
23 render :action => 'list' unless request.xhr?
23 render :action => 'list' unless request.xhr?
24 end
24 end
25
25
26 def list
26 def list
27 @custom_fields_by_type = CustomField.find(:all).group_by {|f| f.class.name }
27 @custom_fields_by_type = CustomField.find(:all).group_by {|f| f.class.name }
28 @tab = params[:tab] || 'IssueCustomField'
28 @tab = params[:tab] || 'IssueCustomField'
29 render :action => "list", :layout => false if request.xhr?
29 render :action => "list", :layout => false if request.xhr?
30 end
30 end
31
31
32 def new
32 def new
33 case params[:type]
33 case params[:type]
34 when "IssueCustomField"
34 when "IssueCustomField"
35 @custom_field = IssueCustomField.new(params[:custom_field])
35 @custom_field = IssueCustomField.new(params[:custom_field])
36 @custom_field.trackers = Tracker.find(params[:tracker_ids]) if params[:tracker_ids]
36 @custom_field.trackers = Tracker.find(params[:tracker_ids]) if params[:tracker_ids]
37 when "UserCustomField"
37 when "UserCustomField"
38 @custom_field = UserCustomField.new(params[:custom_field])
38 @custom_field = UserCustomField.new(params[:custom_field])
39 when "ProjectCustomField"
39 when "ProjectCustomField"
40 @custom_field = ProjectCustomField.new(params[:custom_field])
40 @custom_field = ProjectCustomField.new(params[:custom_field])
41 when "TimeEntryCustomField"
41 when "TimeEntryCustomField"
42 @custom_field = TimeEntryCustomField.new(params[:custom_field])
42 @custom_field = TimeEntryCustomField.new(params[:custom_field])
43 else
43 else
44 redirect_to :action => 'list'
44 redirect_to :action => 'list'
45 return
45 return
46 end
46 end
47 if request.post? and @custom_field.save
47 if request.post? and @custom_field.save
48 flash[:notice] = l(:notice_successful_create)
48 flash[:notice] = l(:notice_successful_create)
49 call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field)
49 redirect_to :action => 'list', :tab => @custom_field.class.name
50 redirect_to :action => 'list', :tab => @custom_field.class.name
50 end
51 end
51 @trackers = Tracker.find(:all, :order => 'position')
52 @trackers = Tracker.find(:all, :order => 'position')
52 end
53 end
53
54
54 def edit
55 def edit
55 @custom_field = CustomField.find(params[:id])
56 @custom_field = CustomField.find(params[:id])
56 if request.post? and @custom_field.update_attributes(params[:custom_field])
57 if request.post? and @custom_field.update_attributes(params[:custom_field])
57 if @custom_field.is_a? IssueCustomField
58 if @custom_field.is_a? IssueCustomField
58 @custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : []
59 @custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : []
59 end
60 end
60 flash[:notice] = l(:notice_successful_update)
61 flash[:notice] = l(:notice_successful_update)
62 call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
61 redirect_to :action => 'list', :tab => @custom_field.class.name
63 redirect_to :action => 'list', :tab => @custom_field.class.name
62 end
64 end
63 @trackers = Tracker.find(:all, :order => 'position')
65 @trackers = Tracker.find(:all, :order => 'position')
64 end
66 end
65
67
66 def move
68 def move
67 @custom_field = CustomField.find(params[:id])
69 @custom_field = CustomField.find(params[:id])
68 case params[:position]
70 case params[:position]
69 when 'highest'
71 when 'highest'
70 @custom_field.move_to_top
72 @custom_field.move_to_top
71 when 'higher'
73 when 'higher'
72 @custom_field.move_higher
74 @custom_field.move_higher
73 when 'lower'
75 when 'lower'
74 @custom_field.move_lower
76 @custom_field.move_lower
75 when 'lowest'
77 when 'lowest'
76 @custom_field.move_to_bottom
78 @custom_field.move_to_bottom
77 end if params[:position]
79 end if params[:position]
78 redirect_to :action => 'list', :tab => @custom_field.class.name
80 redirect_to :action => 'list', :tab => @custom_field.class.name
79 end
81 end
80
82
81 def destroy
83 def destroy
82 @custom_field = CustomField.find(params[:id]).destroy
84 @custom_field = CustomField.find(params[:id]).destroy
83 redirect_to :action => 'list', :tab => @custom_field.class.name
85 redirect_to :action => 'list', :tab => @custom_field.class.name
84 rescue
86 rescue
85 flash[:error] = "Unable to delete custom field"
87 flash[:error] = "Unable to delete custom field"
86 redirect_to :action => 'list'
88 redirect_to :action => 'list'
87 end
89 end
88 end
90 end
@@ -1,113 +1,115
1 <%= error_messages_for 'custom_field' %>
1 <%= error_messages_for 'custom_field' %>
2
2
3 <script type="text/javascript">
3 <script type="text/javascript">
4 //<![CDATA[
4 //<![CDATA[
5 function toggle_custom_field_format() {
5 function toggle_custom_field_format() {
6 format = $("custom_field_field_format");
6 format = $("custom_field_field_format");
7 p_length = $("custom_field_min_length");
7 p_length = $("custom_field_min_length");
8 p_regexp = $("custom_field_regexp");
8 p_regexp = $("custom_field_regexp");
9 p_values = $("custom_field_possible_values");
9 p_values = $("custom_field_possible_values");
10 p_searchable = $("custom_field_searchable");
10 p_searchable = $("custom_field_searchable");
11 p_default = $("custom_field_default_value");
11 p_default = $("custom_field_default_value");
12
12
13 p_default.setAttribute('type','text');
13 p_default.setAttribute('type','text');
14 Element.show(p_default.parentNode);
14 Element.show(p_default.parentNode);
15
15
16 switch (format.value) {
16 switch (format.value) {
17 case "list":
17 case "list":
18 Element.hide(p_length.parentNode);
18 Element.hide(p_length.parentNode);
19 Element.hide(p_regexp.parentNode);
19 Element.hide(p_regexp.parentNode);
20 if (p_searchable) Element.show(p_searchable.parentNode);
20 if (p_searchable) Element.show(p_searchable.parentNode);
21 Element.show(p_values);
21 Element.show(p_values);
22 break;
22 break;
23 case "bool":
23 case "bool":
24 p_default.setAttribute('type','checkbox');
24 p_default.setAttribute('type','checkbox');
25 Element.hide(p_length.parentNode);
25 Element.hide(p_length.parentNode);
26 Element.hide(p_regexp.parentNode);
26 Element.hide(p_regexp.parentNode);
27 if (p_searchable) Element.hide(p_searchable.parentNode);
27 if (p_searchable) Element.hide(p_searchable.parentNode);
28 Element.hide(p_values);
28 Element.hide(p_values);
29 break;
29 break;
30 case "date":
30 case "date":
31 Element.hide(p_length.parentNode);
31 Element.hide(p_length.parentNode);
32 Element.hide(p_regexp.parentNode);
32 Element.hide(p_regexp.parentNode);
33 if (p_searchable) Element.hide(p_searchable.parentNode);
33 if (p_searchable) Element.hide(p_searchable.parentNode);
34 Element.hide(p_values);
34 Element.hide(p_values);
35 break;
35 break;
36 case "float":
36 case "float":
37 case "int":
37 case "int":
38 Element.show(p_length.parentNode);
38 Element.show(p_length.parentNode);
39 Element.show(p_regexp.parentNode);
39 Element.show(p_regexp.parentNode);
40 if (p_searchable) Element.hide(p_searchable.parentNode);
40 if (p_searchable) Element.hide(p_searchable.parentNode);
41 Element.hide(p_values);
41 Element.hide(p_values);
42 break;
42 break;
43 default:
43 default:
44 Element.show(p_length.parentNode);
44 Element.show(p_length.parentNode);
45 Element.show(p_regexp.parentNode);
45 Element.show(p_regexp.parentNode);
46 if (p_searchable) Element.show(p_searchable.parentNode);
46 if (p_searchable) Element.show(p_searchable.parentNode);
47 Element.hide(p_values);
47 Element.hide(p_values);
48 break;
48 break;
49 }
49 }
50 }
50 }
51
51
52 function addValueField() {
52 function addValueField() {
53 var f = $$('p#custom_field_possible_values span');
53 var f = $$('p#custom_field_possible_values span');
54 p = document.getElementById("custom_field_possible_values");
54 p = document.getElementById("custom_field_possible_values");
55 var v = f[0].cloneNode(true);
55 var v = f[0].cloneNode(true);
56 v.childNodes[0].value = "";
56 v.childNodes[0].value = "";
57 p.appendChild(v);
57 p.appendChild(v);
58 }
58 }
59
59
60 function deleteValueField(e) {
60 function deleteValueField(e) {
61 var f = $$('p#custom_field_possible_values span');
61 var f = $$('p#custom_field_possible_values span');
62 if (f.length == 1) {
62 if (f.length == 1) {
63 e.parentNode.childNodes[0].value = "";
63 e.parentNode.childNodes[0].value = "";
64 } else {
64 } else {
65 Element.remove(e.parentNode);
65 Element.remove(e.parentNode);
66 }
66 }
67 }
67 }
68
68
69 //]]>
69 //]]>
70 </script>
70 </script>
71
71
72 <div class="box">
72 <div class="box">
73 <p><%= f.text_field :name, :required => true %></p>
73 <p><%= f.text_field :name, :required => true %></p>
74 <p><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();" %></p>
74 <p><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();" %></p>
75 <p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label>
75 <p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label>
76 <%= f.text_field :min_length, :size => 5, :no_label => true %> -
76 <%= f.text_field :min_length, :size => 5, :no_label => true %> -
77 <%= f.text_field :max_length, :size => 5, :no_label => true %><br>(<%=l(:text_min_max_length_info)%>)</p>
77 <%= f.text_field :max_length, :size => 5, :no_label => true %><br>(<%=l(:text_min_max_length_info)%>)</p>
78 <p><%= f.text_field :regexp, :size => 50 %><br>(<%=l(:text_regexp_info)%>)</p>
78 <p><%= f.text_field :regexp, :size => 50 %><br>(<%=l(:text_regexp_info)%>)</p>
79 <p id="custom_field_possible_values"><label><%= l(:field_possible_values) %> <%= image_to_function "add.png", "addValueField();return false" %></label>
79 <p id="custom_field_possible_values"><label><%= l(:field_possible_values) %> <%= image_to_function "add.png", "addValueField();return false" %></label>
80 <% (@custom_field.possible_values.to_a + [""]).each do |value| %>
80 <% (@custom_field.possible_values.to_a + [""]).each do |value| %>
81 <span><%= text_field_tag 'custom_field[possible_values][]', value, :size => 30 %> <%= image_to_function "delete.png", "deleteValueField(this);return false" %><br /></span>
81 <span><%= text_field_tag 'custom_field[possible_values][]', value, :size => 30 %> <%= image_to_function "delete.png", "deleteValueField(this);return false" %><br /></span>
82 <% end %>
82 <% end %>
83 </p>
83 </p>
84 <p><%= @custom_field.field_format == 'bool' ? f.check_box(:default_value) : f.text_field(:default_value) %></p>
84 <p><%= @custom_field.field_format == 'bool' ? f.check_box(:default_value) : f.text_field(:default_value) %></p>
85 <%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
85 </div>
86 </div>
86
87
87 <div class="box">
88 <div class="box">
88 <% case @custom_field.type.to_s
89 <% case @custom_field.type.to_s
89 when "IssueCustomField" %>
90 when "IssueCustomField" %>
90
91
91 <fieldset><legend><%=l(:label_tracker_plural)%></legend>
92 <fieldset><legend><%=l(:label_tracker_plural)%></legend>
92 <% for tracker in @trackers %>
93 <% for tracker in @trackers %>
93 <%= check_box_tag "tracker_ids[]", tracker.id, (@custom_field.trackers.include? tracker) %> <%= tracker.name %>
94 <%= check_box_tag "tracker_ids[]", tracker.id, (@custom_field.trackers.include? tracker) %> <%= tracker.name %>
94 <% end %>
95 <% end %>
95 </fieldset>
96 </fieldset>
96 &nbsp;
97 &nbsp;
97 <p><%= f.check_box :is_required %></p>
98 <p><%= f.check_box :is_required %></p>
98 <p><%= f.check_box :is_for_all %></p>
99 <p><%= f.check_box :is_for_all %></p>
99 <p><%= f.check_box :is_filter %></p>
100 <p><%= f.check_box :is_filter %></p>
100 <p><%= f.check_box :searchable %></p>
101 <p><%= f.check_box :searchable %></p>
101
102
102 <% when "UserCustomField" %>
103 <% when "UserCustomField" %>
103 <p><%= f.check_box :is_required %></p>
104 <p><%= f.check_box :is_required %></p>
104
105
105 <% when "ProjectCustomField" %>
106 <% when "ProjectCustomField" %>
106 <p><%= f.check_box :is_required %></p>
107 <p><%= f.check_box :is_required %></p>
107
108
108 <% when "TimeEntryCustomField" %>
109 <% when "TimeEntryCustomField" %>
109 <p><%= f.check_box :is_required %></p>
110 <p><%= f.check_box :is_required %></p>
110
111
111 <% end %>
112 <% end %>
113 <%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
112 </div>
114 </div>
113 <%= javascript_tag "toggle_custom_field_format();" %>
115 <%= javascript_tag "toggle_custom_field_format();" %>
@@ -1,15 +1,17
1 <%= error_messages_for 'issue_status' %>
1 <%= error_messages_for 'issue_status' %>
2
2
3 <div class="box">
3 <div class="box">
4 <!--[form:issue_status]-->
4 <!--[form:issue_status]-->
5 <p><label for="issue_status_name"><%=l(:field_name)%><span class="required"> *</span></label>
5 <p><label for="issue_status_name"><%=l(:field_name)%><span class="required"> *</span></label>
6 <%= text_field 'issue_status', 'name' %></p>
6 <%= text_field 'issue_status', 'name' %></p>
7
7
8 <p><label for="issue_status_is_closed"><%=l(:field_is_closed)%></label>
8 <p><label for="issue_status_is_closed"><%=l(:field_is_closed)%></label>
9 <%= check_box 'issue_status', 'is_closed' %></p>
9 <%= check_box 'issue_status', 'is_closed' %></p>
10
10
11 <p><label for="issue_status_is_default"><%=l(:field_is_default)%></label>
11 <p><label for="issue_status_is_default"><%=l(:field_is_default)%></label>
12 <%= check_box 'issue_status', 'is_default' %></p>
12 <%= check_box 'issue_status', 'is_default' %></p>
13
13
14 <%= call_hook(:view_issue_statuses_form, :issue_status => @issue_status) %>
15
14 <!--[eoform:issue_status]-->
16 <!--[eoform:issue_status]-->
15 </div> No newline at end of file
17 </div>
@@ -1,90 +1,94
1 <ul>
1 <ul>
2 <%= call_hook(:view_issues_context_menu_start, {:issues => @issues, :can => @can, :back => @back }) %>
3
2 <% if !@issue.nil? -%>
4 <% if !@issue.nil? -%>
3 <li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue},
5 <li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue},
4 :class => 'icon-edit', :disabled => !@can[:edit] %></li>
6 :class => 'icon-edit', :disabled => !@can[:edit] %></li>
5 <li class="folder">
7 <li class="folder">
6 <a href="#" class="submenu" onclick="return false;"><%= l(:field_status) %></a>
8 <a href="#" class="submenu" onclick="return false;"><%= l(:field_status) %></a>
7 <ul>
9 <ul>
8 <% @statuses.each do |s| -%>
10 <% @statuses.each do |s| -%>
9 <li><%= context_menu_link s.name, {:controller => 'issues', :action => 'edit', :id => @issue, :issue => {:status_id => s}, :back_to => @back}, :method => :post,
11 <li><%= context_menu_link s.name, {:controller => 'issues', :action => 'edit', :id => @issue, :issue => {:status_id => s}, :back_to => @back}, :method => :post,
10 :selected => (s == @issue.status), :disabled => !(@can[:update] && @allowed_statuses.include?(s)) %></li>
12 :selected => (s == @issue.status), :disabled => !(@can[:update] && @allowed_statuses.include?(s)) %></li>
11 <% end -%>
13 <% end -%>
12 </ul>
14 </ul>
13 </li>
15 </li>
14 <% else %>
16 <% else %>
15 <li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id)},
17 <li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id)},
16 :class => 'icon-edit', :disabled => !@can[:edit] %></li>
18 :class => 'icon-edit', :disabled => !@can[:edit] %></li>
17 <% end %>
19 <% end %>
18
20
19 <li class="folder">
21 <li class="folder">
20 <a href="#" class="submenu"><%= l(:field_priority) %></a>
22 <a href="#" class="submenu"><%= l(:field_priority) %></a>
21 <ul>
23 <ul>
22 <% @priorities.each do |p| -%>
24 <% @priorities.each do |p| -%>
23 <li><%= context_menu_link p.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'priority_id' => p, :back_to => @back}, :method => :post,
25 <li><%= context_menu_link p.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'priority_id' => p, :back_to => @back}, :method => :post,
24 :selected => (@issue && p == @issue.priority), :disabled => !@can[:edit] %></li>
26 :selected => (@issue && p == @issue.priority), :disabled => !@can[:edit] %></li>
25 <% end -%>
27 <% end -%>
26 </ul>
28 </ul>
27 </li>
29 </li>
28 <% unless @project.nil? || @project.versions.empty? -%>
30 <% unless @project.nil? || @project.versions.empty? -%>
29 <li class="folder">
31 <li class="folder">
30 <a href="#" class="submenu"><%= l(:field_fixed_version) %></a>
32 <a href="#" class="submenu"><%= l(:field_fixed_version) %></a>
31 <ul>
33 <ul>
32 <% @project.versions.sort.each do |v| -%>
34 <% @project.versions.sort.each do |v| -%>
33 <li><%= context_menu_link v.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => v, :back_to => @back}, :method => :post,
35 <li><%= context_menu_link v.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => v, :back_to => @back}, :method => :post,
34 :selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li>
36 :selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li>
35 <% end -%>
37 <% end -%>
36 <li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => 'none', :back_to => @back}, :method => :post,
38 <li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => 'none', :back_to => @back}, :method => :post,
37 :selected => (@issue && @issue.fixed_version.nil?), :disabled => !@can[:update] %></li>
39 :selected => (@issue && @issue.fixed_version.nil?), :disabled => !@can[:update] %></li>
38 </ul>
40 </ul>
39 </li>
41 </li>
40 <% end %>
42 <% end %>
41 <% unless @assignables.nil? || @assignables.empty? -%>
43 <% unless @assignables.nil? || @assignables.empty? -%>
42 <li class="folder">
44 <li class="folder">
43 <a href="#" class="submenu"><%= l(:field_assigned_to) %></a>
45 <a href="#" class="submenu"><%= l(:field_assigned_to) %></a>
44 <ul>
46 <ul>
45 <% @assignables.each do |u| -%>
47 <% @assignables.each do |u| -%>
46 <li><%= context_menu_link u.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'assigned_to_id' => u, :back_to => @back}, :method => :post,
48 <li><%= context_menu_link u.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'assigned_to_id' => u, :back_to => @back}, :method => :post,
47 :selected => (@issue && u == @issue.assigned_to), :disabled => !@can[:update] %></li>
49 :selected => (@issue && u == @issue.assigned_to), :disabled => !@can[:update] %></li>
48 <% end -%>
50 <% end -%>
49 <li><%= context_menu_link l(:label_nobody), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'assigned_to_id' => 'none', :back_to => @back}, :method => :post,
51 <li><%= context_menu_link l(:label_nobody), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'assigned_to_id' => 'none', :back_to => @back}, :method => :post,
50 :selected => (@issue && @issue.assigned_to.nil?), :disabled => !@can[:update] %></li>
52 :selected => (@issue && @issue.assigned_to.nil?), :disabled => !@can[:update] %></li>
51 </ul>
53 </ul>
52 </li>
54 </li>
53 <% end %>
55 <% end %>
54 <% unless @project.nil? || @project.issue_categories.empty? -%>
56 <% unless @project.nil? || @project.issue_categories.empty? -%>
55 <li class="folder">
57 <li class="folder">
56 <a href="#" class="submenu"><%= l(:field_category) %></a>
58 <a href="#" class="submenu"><%= l(:field_category) %></a>
57 <ul>
59 <ul>
58 <% @project.issue_categories.each do |u| -%>
60 <% @project.issue_categories.each do |u| -%>
59 <li><%= context_menu_link u.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'category_id' => u, :back_to => @back}, :method => :post,
61 <li><%= context_menu_link u.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'category_id' => u, :back_to => @back}, :method => :post,
60 :selected => (@issue && u == @issue.category), :disabled => !@can[:update] %></li>
62 :selected => (@issue && u == @issue.category), :disabled => !@can[:update] %></li>
61 <% end -%>
63 <% end -%>
62 <li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'category_id' => 'none', :back_to => @back}, :method => :post,
64 <li><%= context_menu_link l(:label_none), {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'category_id' => 'none', :back_to => @back}, :method => :post,
63 :selected => (@issue && @issue.category.nil?), :disabled => !@can[:update] %></li>
65 :selected => (@issue && @issue.category.nil?), :disabled => !@can[:update] %></li>
64 </ul>
66 </ul>
65 </li>
67 </li>
66 <% end -%>
68 <% end -%>
67 <li class="folder">
69 <li class="folder">
68 <a href="#" class="submenu"><%= l(:field_done_ratio) %></a>
70 <a href="#" class="submenu"><%= l(:field_done_ratio) %></a>
69 <ul>
71 <ul>
70 <% (0..10).map{|x|x*10}.each do |p| -%>
72 <% (0..10).map{|x|x*10}.each do |p| -%>
71 <li><%= context_menu_link "#{p}%", {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'done_ratio' => p, :back_to => @back}, :method => :post,
73 <li><%= context_menu_link "#{p}%", {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'done_ratio' => p, :back_to => @back}, :method => :post,
72 :selected => (@issue && p == @issue.done_ratio), :disabled => !@can[:edit] %></li>
74 :selected => (@issue && p == @issue.done_ratio), :disabled => !@can[:edit] %></li>
73 <% end -%>
75 <% end -%>
74 </ul>
76 </ul>
75 </li>
77 </li>
76
78
77 <% if !@issue.nil? %>
79 <% if !@issue.nil? %>
78 <li><%= context_menu_link l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue},
80 <li><%= context_menu_link l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue},
79 :class => 'icon-copy', :disabled => !@can[:copy] %></li>
81 :class => 'icon-copy', :disabled => !@can[:copy] %></li>
80 <% if @can[:log_time] -%>
82 <% if @can[:log_time] -%>
81 <li><%= context_menu_link l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue},
83 <li><%= context_menu_link l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue},
82 :class => 'icon-time' %></li>
84 :class => 'icon-time' %></li>
83 <% end %>
85 <% end %>
84 <% end %>
86 <% end %>
85
87
86 <li><%= context_menu_link l(:button_move), {:controller => 'issues', :action => 'move', :ids => @issues.collect(&:id)},
88 <li><%= context_menu_link l(:button_move), {:controller => 'issues', :action => 'move', :ids => @issues.collect(&:id)},
87 :class => 'icon-move', :disabled => !@can[:move] %></li>
89 :class => 'icon-move', :disabled => !@can[:move] %></li>
88 <li><%= context_menu_link l(:button_delete), {:controller => 'issues', :action => 'destroy', :ids => @issues.collect(&:id)},
90 <li><%= context_menu_link l(:button_delete), {:controller => 'issues', :action => 'destroy', :ids => @issues.collect(&:id)},
89 :method => :post, :confirm => l(:text_issues_destroy_confirmation), :class => 'icon-del', :disabled => !@can[:delete] %></li>
91 :method => :post, :confirm => l(:text_issues_destroy_confirmation), :class => 'icon-del', :disabled => !@can[:delete] %></li>
92
93 <%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
90 </ul>
94 </ul>
@@ -1,126 +1,128
1 <div class="contextual">
1 <div class="contextual">
2 <%= link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
2 <%= link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
3 <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
3 <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
4 <%= watcher_tag(@issue, User.current) %>
4 <%= watcher_tag(@issue, User.current) %>
5 <%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-copy' %>
5 <%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-copy' %>
6 <%= link_to_if_authorized l(:button_move), {:controller => 'issues', :action => 'move', :id => @issue }, :class => 'icon icon-move' %>
6 <%= link_to_if_authorized l(:button_move), {:controller => 'issues', :action => 'move', :id => @issue }, :class => 'icon icon-move' %>
7 <%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
7 <%= link_to_if_authorized l(:button_delete), {:controller => 'issues', :action => 'destroy', :id => @issue}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
8 </div>
8 </div>
9
9
10 <h2><%= @issue.tracker.name %> #<%= @issue.id %></h2>
10 <h2><%= @issue.tracker.name %> #<%= @issue.id %></h2>
11
11
12 <div class="<%= css_issue_classes(@issue) %> details">
12 <div class="<%= css_issue_classes(@issue) %> details">
13 <%= avatar(@issue.author, :size => "64") %>
13 <%= avatar(@issue.author, :size => "64") %>
14 <h3><%=h @issue.subject %></h3>
14 <h3><%=h @issue.subject %></h3>
15 <p class="author">
15 <p class="author">
16 <%= authoring @issue.created_on, @issue.author %>.
16 <%= authoring @issue.created_on, @issue.author %>.
17 <%= l(:label_updated_time, distance_of_time_in_words(Time.now, @issue.updated_on)) + '.' if @issue.created_on != @issue.updated_on %>
17 <%= l(:label_updated_time, distance_of_time_in_words(Time.now, @issue.updated_on)) + '.' if @issue.created_on != @issue.updated_on %>
18 </p>
18 </p>
19
19
20 <table width="100%">
20 <table width="100%">
21 <tr>
21 <tr>
22 <td style="width:15%" class="status"><b><%=l(:field_status)%>:</b></td><td style="width:35%" class="status"><%= @issue.status.name %></td>
22 <td style="width:15%" class="status"><b><%=l(:field_status)%>:</b></td><td style="width:35%" class="status"><%= @issue.status.name %></td>
23 <td style="width:15%" class="start-date"><b><%=l(:field_start_date)%>:</b></td><td style="width:35%"><%= format_date(@issue.start_date) %></td>
23 <td style="width:15%" class="start-date"><b><%=l(:field_start_date)%>:</b></td><td style="width:35%"><%= format_date(@issue.start_date) %></td>
24 </tr>
24 </tr>
25 <tr>
25 <tr>
26 <td class="priority"><b><%=l(:field_priority)%>:</b></td><td class="priority"><%= @issue.priority.name %></td>
26 <td class="priority"><b><%=l(:field_priority)%>:</b></td><td class="priority"><%= @issue.priority.name %></td>
27 <td class="due-date"><b><%=l(:field_due_date)%>:</b></td><td class="due-date"><%= format_date(@issue.due_date) %></td>
27 <td class="due-date"><b><%=l(:field_due_date)%>:</b></td><td class="due-date"><%= format_date(@issue.due_date) %></td>
28 </tr>
28 </tr>
29 <tr>
29 <tr>
30 <td class="assigned-to"><b><%=l(:field_assigned_to)%>:</b></td><td><%= avatar(@issue.assigned_to, :size => "14") %><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
30 <td class="assigned-to"><b><%=l(:field_assigned_to)%>:</b></td><td><%= avatar(@issue.assigned_to, :size => "14") %><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
31 <td class="progress"><b><%=l(:field_done_ratio)%>:</b></td><td class="progress"><%= progress_bar @issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%" %></td>
31 <td class="progress"><b><%=l(:field_done_ratio)%>:</b></td><td class="progress"><%= progress_bar @issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%" %></td>
32 </tr>
32 </tr>
33 <tr>
33 <tr>
34 <td class="category"><b><%=l(:field_category)%>:</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td>
34 <td class="category"><b><%=l(:field_category)%>:</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td>
35 <% if User.current.allowed_to?(:view_time_entries, @project) %>
35 <% if User.current.allowed_to?(:view_time_entries, @project) %>
36 <td class="spent-time"><b><%=l(:label_spent_time)%>:</b></td>
36 <td class="spent-time"><b><%=l(:label_spent_time)%>:</b></td>
37 <td class="spent-hours"><%= @issue.spent_hours > 0 ? (link_to lwr(:label_f_hour, @issue.spent_hours), {:controller => 'timelog', :action => 'details', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time') : "-" %></td>
37 <td class="spent-hours"><%= @issue.spent_hours > 0 ? (link_to lwr(:label_f_hour, @issue.spent_hours), {:controller => 'timelog', :action => 'details', :project_id => @project, :issue_id => @issue}, :class => 'icon icon-time') : "-" %></td>
38 <% end %>
38 <% end %>
39 </tr>
39 </tr>
40 <tr>
40 <tr>
41 <td class="fixed-version"><b><%=l(:field_fixed_version)%>:</b></td><td><%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %></td>
41 <td class="fixed-version"><b><%=l(:field_fixed_version)%>:</b></td><td><%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %></td>
42 <% if @issue.estimated_hours %>
42 <% if @issue.estimated_hours %>
43 <td class="estimated-hours"><b><%=l(:field_estimated_hours)%>:</b></td><td><%= lwr(:label_f_hour, @issue.estimated_hours) %></td>
43 <td class="estimated-hours"><b><%=l(:field_estimated_hours)%>:</b></td><td><%= lwr(:label_f_hour, @issue.estimated_hours) %></td>
44 <% end %>
44 <% end %>
45 </tr>
45 </tr>
46 <tr>
46 <tr>
47 <% n = 0 -%>
47 <% n = 0 -%>
48 <% @issue.custom_values.each do |value| -%>
48 <% @issue.custom_values.each do |value| -%>
49 <td valign="top"><b><%=h value.custom_field.name %>:</b></td><td valign="top"><%= simple_format(h(show_value(value))) %></td>
49 <td valign="top"><b><%=h value.custom_field.name %>:</b></td><td valign="top"><%= simple_format(h(show_value(value))) %></td>
50 <% n = n + 1
50 <% n = n + 1
51 if (n > 1)
51 if (n > 1)
52 n = 0 %>
52 n = 0 %>
53 </tr><tr>
53 </tr><tr>
54 <%end
54 <%end
55 end %>
55 end %>
56 </tr>
56 </tr>
57 <%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
57 <%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
58 </table>
58 </table>
59 <hr />
59 <hr />
60
60
61 <div class="contextual">
61 <div class="contextual">
62 <%= link_to_remote_if_authorized(l(:button_quote), { :url => {:action => 'reply', :id => @issue} }, :class => 'icon icon-comment') unless @issue.description.blank? %>
62 <%= link_to_remote_if_authorized(l(:button_quote), { :url => {:action => 'reply', :id => @issue} }, :class => 'icon icon-comment') unless @issue.description.blank? %>
63 </div>
63 </div>
64
64
65 <p><strong><%=l(:field_description)%></strong></p>
65 <p><strong><%=l(:field_description)%></strong></p>
66 <div class="wiki">
66 <div class="wiki">
67 <%= textilizable @issue, :description, :attachments => @issue.attachments %>
67 <%= textilizable @issue, :description, :attachments => @issue.attachments %>
68 </div>
68 </div>
69
69
70 <%= link_to_attachments @issue %>
70 <%= link_to_attachments @issue %>
71
71
72 <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
73
72 <% if authorize_for('issue_relations', 'new') || @issue.relations.any? %>
74 <% if authorize_for('issue_relations', 'new') || @issue.relations.any? %>
73 <hr />
75 <hr />
74 <div id="relations">
76 <div id="relations">
75 <%= render :partial => 'relations' %>
77 <%= render :partial => 'relations' %>
76 </div>
78 </div>
77 <% end %>
79 <% end %>
78
80
79 <% if User.current.allowed_to?(:add_issue_watchers, @project) ||
81 <% if User.current.allowed_to?(:add_issue_watchers, @project) ||
80 (@issue.watchers.any? && User.current.allowed_to?(:view_issue_watchers, @project)) %>
82 (@issue.watchers.any? && User.current.allowed_to?(:view_issue_watchers, @project)) %>
81 <hr />
83 <hr />
82 <div id="watchers">
84 <div id="watchers">
83 <%= render :partial => 'watchers/watchers', :locals => {:watched => @issue} %>
85 <%= render :partial => 'watchers/watchers', :locals => {:watched => @issue} %>
84 </div>
86 </div>
85 <% end %>
87 <% end %>
86
88
87 </div>
89 </div>
88
90
89 <% if @issue.changesets.any? && User.current.allowed_to?(:view_changesets, @project) %>
91 <% if @issue.changesets.any? && User.current.allowed_to?(:view_changesets, @project) %>
90 <div id="issue-changesets">
92 <div id="issue-changesets">
91 <h3><%=l(:label_associated_revisions)%></h3>
93 <h3><%=l(:label_associated_revisions)%></h3>
92 <%= render :partial => 'changesets', :locals => { :changesets => @issue.changesets} %>
94 <%= render :partial => 'changesets', :locals => { :changesets => @issue.changesets} %>
93 </div>
95 </div>
94 <% end %>
96 <% end %>
95
97
96 <% if @journals.any? %>
98 <% if @journals.any? %>
97 <div id="history">
99 <div id="history">
98 <h3><%=l(:label_history)%></h3>
100 <h3><%=l(:label_history)%></h3>
99 <%= render :partial => 'history', :locals => { :journals => @journals } %>
101 <%= render :partial => 'history', :locals => { :journals => @journals } %>
100 </div>
102 </div>
101 <% end %>
103 <% end %>
102 <div style="clear: both;"></div>
104 <div style="clear: both;"></div>
103
105
104 <% if authorize_for('issues', 'edit') %>
106 <% if authorize_for('issues', 'edit') %>
105 <div id="update" style="display:none;">
107 <div id="update" style="display:none;">
106 <h3><%= l(:button_update) %></h3>
108 <h3><%= l(:button_update) %></h3>
107 <%= render :partial => 'edit' %>
109 <%= render :partial => 'edit' %>
108 </div>
110 </div>
109 <% end %>
111 <% end %>
110
112
111 <p class="other-formats">
113 <p class="other-formats">
112 <%= l(:label_export_to) %>
114 <%= l(:label_export_to) %>
113 <span><%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
115 <span><%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
114 <span><%= link_to 'PDF', {:format => 'pdf'}, :class => 'pdf' %></span>
116 <span><%= link_to 'PDF', {:format => 'pdf'}, :class => 'pdf' %></span>
115 </p>
117 </p>
116
118
117 <% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
119 <% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
118
120
119 <% content_for :sidebar do %>
121 <% content_for :sidebar do %>
120 <%= render :partial => 'issues/sidebar' %>
122 <%= render :partial => 'issues/sidebar' %>
121 <% end %>
123 <% end %>
122
124
123 <% content_for :header_tags do %>
125 <% content_for :header_tags do %>
124 <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject}") %>
126 <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject}") %>
125 <%= stylesheet_link_tag 'scm' %>
127 <%= stylesheet_link_tag 'scm' %>
126 <% end %>
128 <% end %>
@@ -1,52 +1,53
1 <div class="contextual">
1 <div class="contextual">
2 <%= link_to(l(:button_change_password), :action => 'password') unless @user.auth_source_id %>
2 <%= link_to(l(:button_change_password), :action => 'password') unless @user.auth_source_id %>
3 </div>
3 </div>
4 <h2><%=l(:label_my_account)%></h2>
4 <h2><%=l(:label_my_account)%></h2>
5 <%= error_messages_for 'user' %>
5 <%= error_messages_for 'user' %>
6
6
7 <% form_for :user, @user, :url => { :action => "account" },
7 <% form_for :user, @user, :url => { :action => "account" },
8 :builder => TabularFormBuilder,
8 :builder => TabularFormBuilder,
9 :lang => current_language,
9 :lang => current_language,
10 :html => { :id => 'my_account_form' } do |f| %>
10 :html => { :id => 'my_account_form' } do |f| %>
11 <div class="splitcontentleft">
11 <div class="splitcontentleft">
12 <h3><%=l(:label_information_plural)%></h3>
12 <h3><%=l(:label_information_plural)%></h3>
13 <div class="box tabular">
13 <div class="box tabular">
14 <p><%= f.text_field :firstname, :required => true %></p>
14 <p><%= f.text_field :firstname, :required => true %></p>
15 <p><%= f.text_field :lastname, :required => true %></p>
15 <p><%= f.text_field :lastname, :required => true %></p>
16 <p><%= f.text_field :mail, :required => true %></p>
16 <p><%= f.text_field :mail, :required => true %></p>
17 <p><%= f.select :language, lang_options_for_select %></p>
17 <p><%= f.select :language, lang_options_for_select %></p>
18 <%= call_hook(:view_my_account, :user => @user, :form => f) %>
18 </div>
19 </div>
19
20
20 <%= submit_tag l(:button_save) %>
21 <%= submit_tag l(:button_save) %>
21 </div>
22 </div>
22
23
23 <div class="splitcontentright">
24 <div class="splitcontentright">
24 <h3><%=l(:field_mail_notification)%></h3>
25 <h3><%=l(:field_mail_notification)%></h3>
25 <div class="box">
26 <div class="box">
26 <%= select_tag 'notification_option', options_for_select(@notification_options, @notification_option),
27 <%= select_tag 'notification_option', options_for_select(@notification_options, @notification_option),
27 :onchange => 'if ($("notification_option").value == "selected") {Element.show("notified-projects")} else {Element.hide("notified-projects")}' %>
28 :onchange => 'if ($("notification_option").value == "selected") {Element.show("notified-projects")} else {Element.hide("notified-projects")}' %>
28 <% content_tag 'div', :id => 'notified-projects', :style => (@notification_option == 'selected' ? '' : 'display:none;') do %>
29 <% content_tag 'div', :id => 'notified-projects', :style => (@notification_option == 'selected' ? '' : 'display:none;') do %>
29 <p><% User.current.projects.each do |project| %>
30 <p><% User.current.projects.each do |project| %>
30 <label><%= check_box_tag 'notified_project_ids[]', project.id, @user.notified_projects_ids.include?(project.id) %> <%=h project.name %></label><br />
31 <label><%= check_box_tag 'notified_project_ids[]', project.id, @user.notified_projects_ids.include?(project.id) %> <%=h project.name %></label><br />
31 <% end %></p>
32 <% end %></p>
32 <p><em><%= l(:text_user_mail_option) %></em></p>
33 <p><em><%= l(:text_user_mail_option) %></em></p>
33 <% end %>
34 <% end %>
34 <p><label><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified] %> <%= l(:label_user_mail_no_self_notified) %></label></p>
35 <p><label><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified] %> <%= l(:label_user_mail_no_self_notified) %></label></p>
35 </div>
36 </div>
36
37
37 <h3><%=l(:label_preferences)%></h3>
38 <h3><%=l(:label_preferences)%></h3>
38 <div class="box tabular">
39 <div class="box tabular">
39 <% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %>
40 <% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %>
40 <p><%= pref_fields.check_box :hide_mail %></p>
41 <p><%= pref_fields.check_box :hide_mail %></p>
41 <p><%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p>
42 <p><%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p>
42 <p><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p>
43 <p><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p>
43 <% end %>
44 <% end %>
44 </div>
45 </div>
45 </div>
46 </div>
46 <% end %>
47 <% end %>
47
48
48 <% content_for :sidebar do %>
49 <% content_for :sidebar do %>
49 <%= render :partial => 'sidebar' %>
50 <%= render :partial => 'sidebar' %>
50 <% end %>
51 <% end %>
51
52
52 <% html_title(l(:label_my_account)) -%>
53 <% html_title(l(:label_my_account)) -%>
@@ -1,31 +1,32
1 <%= error_messages_for 'user' %>
1 <%= error_messages_for 'user' %>
2
2
3 <!--[form:user]-->
3 <!--[form:user]-->
4 <div class="box">
4 <div class="box">
5 <p><%= f.text_field :login, :required => true, :size => 25 %></p>
5 <p><%= f.text_field :login, :required => true, :size => 25 %></p>
6 <p><%= f.text_field :firstname, :required => true %></p>
6 <p><%= f.text_field :firstname, :required => true %></p>
7 <p><%= f.text_field :lastname, :required => true %></p>
7 <p><%= f.text_field :lastname, :required => true %></p>
8 <p><%= f.text_field :mail, :required => true %></p>
8 <p><%= f.text_field :mail, :required => true %></p>
9 <p><%= f.select :language, lang_options_for_select %></p>
9 <p><%= f.select :language, lang_options_for_select %></p>
10
10
11 <% @user.custom_field_values.each do |value| %>
11 <% @user.custom_field_values.each do |value| %>
12 <p><%= custom_field_tag_with_label :user, value %></p>
12 <p><%= custom_field_tag_with_label :user, value %></p>
13 <% end %>
13 <% end %>
14
14
15 <p><%= f.check_box :admin, :disabled => (@user == User.current) %></p>
15 <p><%= f.check_box :admin, :disabled => (@user == User.current) %></p>
16 <%= call_hook(:view_users_form, :user => @user, :form => f) %>
16 </div>
17 </div>
17
18
18 <div class="box">
19 <div class="box">
19 <h3><%=l(:label_authentication)%></h3>
20 <h3><%=l(:label_authentication)%></h3>
20 <% unless @auth_sources.empty? %>
21 <% unless @auth_sources.empty? %>
21 <p><%= f.select :auth_source_id, ([[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='') {Element.show('password_fields');} else {Element.hide('password_fields');}" %></p>
22 <p><%= f.select :auth_source_id, ([[l(:label_internal), ""]] + @auth_sources.collect { |a| [a.name, a.id] }), {}, :onchange => "if (this.value=='') {Element.show('password_fields');} else {Element.hide('password_fields');}" %></p>
22 <% end %>
23 <% end %>
23 <div id="password_fields" style="<%= 'display:none;' if @user.auth_source %>">
24 <div id="password_fields" style="<%= 'display:none;' if @user.auth_source %>">
24 <p><label for="password"><%=l(:field_password)%><span class="required"> *</span></label>
25 <p><label for="password"><%=l(:field_password)%><span class="required"> *</span></label>
25 <%= password_field_tag 'password', nil, :size => 25 %><br />
26 <%= password_field_tag 'password', nil, :size => 25 %><br />
26 <em><%= l(:text_caracters_minimum, 4) %></em></p>
27 <em><%= l(:text_caracters_minimum, 4) %></em></p>
27 <p><label for="password_confirmation"><%=l(:field_password_confirmation)%><span class="required"> *</span></label>
28 <p><label for="password_confirmation"><%=l(:field_password_confirmation)%><span class="required"> *</span></label>
28 <%= password_field_tag 'password_confirmation', nil, :size => 25 %></p>
29 <%= password_field_tag 'password_confirmation', nil, :size => 25 %></p>
29 </div>
30 </div>
30 </div>
31 </div>
31 <!--[eoform:user]-->
32 <!--[eoform:user]-->
General Comments 0
You need to be logged in to leave comments. Login now