diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-28 21:09:06 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-28 21:09:06 +0000 |
commit | 26ef9da02b7ef7550712317ad050e5a2f31744c6 (patch) | |
tree | 2bd63ea6bb64aca39a733ca598253c48aa57e72d /app | |
parent | 4c9f261a245b256ecd299801583ad23bb6921ec2 (diff) | |
download | redmine-26ef9da02b7ef7550712317ad050e5a2f31744c6.tar.gz redmine-26ef9da02b7ef7550712317ad050e5a2f31744c6.zip |
Changed the notifications to use a hierarchy UI
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4222 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/settings_helper.rb | 10 | ||||
-rw-r--r-- | app/views/settings/_notifications.rhtml | 12 |
2 files changed, 17 insertions, 5 deletions
diff --git a/app/helpers/settings_helper.rb b/app/helpers/settings_helper.rb index e57b75fcc..6dc33a8e1 100644 --- a/app/helpers/settings_helper.rb +++ b/app/helpers/settings_helper.rb @@ -71,4 +71,14 @@ module SettingsHelper label = options.delete(:label) label != false ? content_tag("label", l(label || "setting_#{setting}")) : '' end + + # Renders a notification field for a Redmine::Notifiable option + def notification_field(notifiable) + return content_tag(:label, + check_box_tag('settings[notified_events][]', + notifiable.name, + Setting.notified_events.include?(notifiable.name)) + + l_or_humanize(notifiable.name, :prefix => 'label_'), + :class => notifiable.parent.present? ? "parent" : '') + end end diff --git a/app/views/settings/_notifications.rhtml b/app/views/settings/_notifications.rhtml index 2c62cdf9f..bf2b9d871 100644 --- a/app/views/settings/_notifications.rhtml +++ b/app/views/settings/_notifications.rhtml @@ -12,11 +12,13 @@ </div> -<fieldset class="box settings" id="notified_events"><legend><%=l(:text_select_mail_notifications)%></legend> - <%= setting_multiselect(:notified_events, - @notifiables.collect {|notifiable| [l_or_humanize(notifiable, :prefix => 'label_'), notifiable]}, :label => false) %> - - <p><%= check_all_links('notified_events') %></p> +<fieldset class="box" id="notified_events"><legend><%=l(:text_select_mail_notifications)%></legend> +<%= hidden_field_tag 'settings[notified_events][]', '' %> +<% @notifiables.each do |notifiable| %> +<%= notification_field notifiable %> +<br /> +<% end %> +<p><%= check_all_links('notified_events') %></p> </fieldset> <fieldset class="box"><legend><%= l(:setting_emails_footer) %></legend> |