Sprankelprachtig aan/afmeldsysteem

edit.html.haml 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. %h1
  2. = t 'groups.edit'
  3. = render 'form', group: @group
  4. %h2
  5. = t 'defaultsubgroups.manage'
  6. %p
  7. = t 'defaultsubgroups.settings_blurb'
  8. .row
  9. .col-md-6
  10. %h4
  11. = t 'defaultsubgroups.create'
  12. -#= form_tag(group_create_default_subgroup_path(@group), method: :post, class: 'form') do
  13. = form_for(@defaultsubgroup, url: group_create_default_subgroup_path(@group), method: :post) do |f|
  14. - if @defaultsubgroup.errors.any?
  15. .has-error.form-group#error_explanation
  16. %ul
  17. - @defaultsubgroup.errors.full_messages.each do |message|
  18. %li
  19. = message
  20. .form-group{ class: [ ('has-error' if @defaultsubgroup.errors.any?) ] }
  21. %label
  22. = t 'activerecord.attributes.default_subgroup.name'
  23. = f.text_field(:name, class: 'form-control')
  24. .form-group
  25. .check-box
  26. %label
  27. = f.check_box(:is_assignable)
  28. = t 'activerecord.attributes.default_subgroup.is_assignable'
  29. = f.submit t('defaultsubgroups.create'), class: 'btn btn-success'
  30. .col-md-6
  31. %h4
  32. = t 'defaultsubgroups.destroy'
  33. - if @group.default_subgroups.blank?
  34. %p
  35. = t 'defaultsubgroups.none'
  36. - else
  37. = form_tag(group_destroy_default_subgroup_path(@group), method: :delete, class: 'form') do
  38. .form-group
  39. %label
  40. = t 'activerecord.models.default_subgroup.one'
  41. - options = @group.default_subgroups.pluck(:name, :id)
  42. = select_tag(:default_subgroup_id, options_for_select(options), class: 'form-control')
  43. = submit_tag(t('defaultsubgroups.destroy'), class: 'btn btn-danger')
  44. .row
  45. .col-md-12
  46. .btn-group
  47. = link_to t(:back), @group, class: 'btn btn-default'
  48. = link_to t('activities.mass_import_short'), group_activities_mass_new_path(@group), class: 'btn btn-default'
  49. = link_to t('groups.mass_add_short'), group_mass_add_path(@group), class: 'btn btn-default'