diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-28 22:13:06 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-28 22:13:06 +0000 |
commit | 437690119b0b1bd462d45f2367c1fe805e529972 (patch) | |
tree | acab2ce9db00d12e8ef9ae962234f0da341e00bc /app/views | |
parent | 26ef9da02b7ef7550712317ad050e5a2f31744c6 (diff) | |
download | redmine-437690119b0b1bd462d45f2367c1fe805e529972.tar.gz redmine-437690119b0b1bd462d45f2367c1fe805e529972.zip |
Allow admins to edit user's email notifications and preferences. #3503
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4223 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/my/account.rhtml | 16 | ||||
-rw-r--r-- | app/views/users/_form.rhtml | 10 | ||||
-rw-r--r-- | app/views/users/_mail_notifications.html.erb | 12 | ||||
-rw-r--r-- | app/views/users/_preferences.html.erb | 6 |
4 files changed, 30 insertions, 14 deletions
diff --git a/app/views/my/account.rhtml b/app/views/my/account.rhtml index b173b2b0d..99b58ffe7 100644 --- a/app/views/my/account.rhtml +++ b/app/views/my/account.rhtml @@ -32,24 +32,12 @@ <div class="splitcontentright"> <h3><%=l(:field_mail_notification)%></h3> <div class="box"> -<%= select_tag 'notification_option', options_for_select(@notification_options.collect {|o| [l(o.last), o.first]}, @notification_option.to_sym), - :onchange => 'if ($("notification_option").value == "selected") {Element.show("notified-projects")} else {Element.hide("notified-projects")}' %> -<% content_tag 'div', :id => 'notified-projects', :style => (@notification_option == 'selected' ? '' : 'display:none;') do %> -<p><% User.current.projects.each do |project| %> - <label><%= check_box_tag 'notified_project_ids[]', project.id, @user.notified_projects_ids.include?(project.id) %> <%=h project.name %></label><br /> -<% end %></p> -<p><em><%= l(:text_user_mail_option) %></em></p> -<% end %> -<p><label><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified] %> <%= l(:label_user_mail_no_self_notified) %></label></p> +<%= render :partial => 'users/mail_notifications' %> </div> <h3><%=l(:label_preferences)%></h3> <div class="box tabular"> -<% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %> -<p><%= pref_fields.check_box :hide_mail %></p> -<p><%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p> -<p><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p> -<% end %> +<%= render :partial => 'users/preferences' %> </div> </div> diff --git a/app/views/users/_form.rhtml b/app/views/users/_form.rhtml index 4f9a0ff21..7e50fcdc3 100644 --- a/app/views/users/_form.rhtml +++ b/app/views/users/_form.rhtml @@ -32,4 +32,14 @@ <%= password_field_tag 'password_confirmation', nil, :size => 25 %></p> </div> </div> + +<div class="box"> +<h3><%=l(:field_mail_notification)%></h3> +<%= render :partial => 'users/mail_notifications' %> +</div> + +<div class="box tabular"> +<h3><%=l(:label_preferences)%></h3> +<%= render :partial => 'users/preferences' %> +</div> <!--[eoform:user]--> diff --git a/app/views/users/_mail_notifications.html.erb b/app/views/users/_mail_notifications.html.erb new file mode 100644 index 000000000..d29250893 --- /dev/null +++ b/app/views/users/_mail_notifications.html.erb @@ -0,0 +1,12 @@ +<p> +<%= select_tag 'notification_option', options_for_select(@notification_options.collect {|o| [l(o.last), o.first]}, @notification_option.to_sym), + :onchange => 'if ($("notification_option").value == "selected") {Element.show("notified-projects")} else {Element.hide("notified-projects")}' %> +</p> +<% content_tag 'div', :id => 'notified-projects', :style => (@notification_option == 'selected' ? '' : 'display:none;') do %> +<p><% @user.projects.each do |project| %> + <label><%= check_box_tag 'notified_project_ids[]', project.id, @user.notified_projects_ids.include?(project.id) %> <%=h project.name %></label><br /> +<% end %></p> +<p><em><%= l(:text_user_mail_option) %></em></p> +<% end %> +<p><label><%= l(:label_user_mail_no_self_notified) %></label><%= check_box_tag 'no_self_notified', 1, @user.pref[:no_self_notified] %></p> + diff --git a/app/views/users/_preferences.html.erb b/app/views/users/_preferences.html.erb new file mode 100644 index 000000000..85b5990e3 --- /dev/null +++ b/app/views/users/_preferences.html.erb @@ -0,0 +1,6 @@ +<% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %> +<p><%= pref_fields.check_box :hide_mail %></p> +<p><%= pref_fields.select :time_zone, ActiveSupport::TimeZone.all.collect {|z| [ z.to_s, z.name ]}, :include_blank => true %></p> +<p><%= pref_fields.select :comments_sorting, [[l(:label_chronological_order), 'asc'], [l(:label_reverse_chronological_order), 'desc']] %></p> +<% end %> + |