##// END OF EJS Templates
Disable children when checking parent notifiable....
Jean-Philippe Lang -
r12721:d50ec43dffcd
parent child
Show More
@@ -84,12 +84,24 module SettingsHelper
84 84
85 85 # Renders a notification field for a Redmine::Notifiable option
86 86 def notification_field(notifiable)
87 return content_tag(:label,
88 check_box_tag('settings[notified_events][]',
89 notifiable.name,
90 Setting.notified_events.include?(notifiable.name), :id => nil).html_safe +
91 l_or_humanize(notifiable.name, :prefix => 'label_').html_safe,
92 :class => notifiable.parent.present? ? "parent" : '').html_safe
87 tag_data = notifiable.parent.present? ?
88 {:parent_notifiable => notifiable.parent} :
89 {:disables => "input[data-parent-notifiable=#{notifiable.name}]"}
90
91 tag = check_box_tag('settings[notified_events][]',
92 notifiable.name,
93 Setting.notified_events.include?(notifiable.name),
94 :id => nil,
95 :data => tag_data)
96
97 text = l_or_humanize(notifiable.name, :prefix => 'label_')
98
99 options = {}
100 if notifiable.parent.present?
101 options[:class] = "parent"
102 end
103
104 content_tag(:label, tag + text, options)
93 105 end
94 106
95 107 def cross_project_subtasks_options
General Comments 0
You need to be logged in to leave comments. Login now