diff app/helpers/settings_helper.rb @ 51:371eac10df0b live

* Merge from "cannam" branch. This includes update to Redmine trunk, plus welcome/tip-of-the-day from luisf branch.
author Chris Cannam
date Wed, 24 Nov 2010 12:20:08 +0000
parents 94944d00e43c
children cbce1fd3b1b7
line wrap: on
line diff
--- a/app/helpers/settings_helper.rb	Thu Oct 21 11:19:14 2010 +0100
+++ b/app/helpers/settings_helper.rb	Wed Nov 24 12:20:08 2010 +0000
@@ -71,4 +71,14 @@
     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