Merge pull request #3324 from NobodysNightmare/feature/keep_uri_short

prevent too long Request-URLs for many watchers
pull/3345/head
Oliver Günther 9 years ago
commit 2f5f6b2380
  1. 7
      app/views/work_packages/_form.html.erb
  2. 9
      lib/tabular_form_builder.rb

@ -84,9 +84,10 @@ See doc/COPYRIGHT.rdoc for more details.
<% block.each do |user| %>
<div class="form--field -wide-label">
<%= f.collection_check_box(:watcher_user_ids,
user.id,
work_package.watched_by?(user) && work_package.visible?(user),
user.name) %>
user.id,
work_package.watched_by?(user) && work_package.visible?(user),
user.name,
unchecked_value: nil) %>
</div>
<% end %>
</div>

@ -82,19 +82,20 @@ class TabularFormBuilder < ActionView::Helpers::FormBuilder
end
def collection_check_box(field,
value,
checked_value,
checked,
text = field.to_s + "_#{value}",
text = field.to_s + "_#{checked_value}",
options = {})
label_for = "#{sanitized_object_name}_#{field}_#{value}".to_sym
label_for = "#{sanitized_object_name}_#{field}_#{checked_value}".to_sym
unchecked_value = options.delete(:unchecked_value) { '' }
input_options = options.reverse_merge(multiple: true,
checked: checked,
for: label_for,
label: text)
check_box(field, input_options, value, '')
check_box(field, input_options, checked_value, unchecked_value)
end
def fields_for_custom_fields(record_name, record_object = nil, options = {}, &block)

Loading…
Cancel
Save