Sprankelprachtig aan/afmeldsysteem

_form.html.erb 2.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <%= form_for([@group, activity]) do |f| %>
  2. <% if activity.errors.any? %>
  3. <div id="error_explanation">
  4. <h2><%= pluralize(activity.errors.count, "error") %> prohibited this activity from being saved:</h2>
  5. <ul>
  6. <% activity.errors.full_messages.each do |message| %>
  7. <li><%= message %></li>
  8. <% end %>
  9. </ul>
  10. </div>
  11. <% end %>
  12. <div class="actions">
  13. <div class="form-group">
  14. <%= f.label :name %>
  15. <%= f.text_field :name, class: 'form-control' %>
  16. </div>
  17. <div class="form-group">
  18. <div class="row">
  19. <div class="col-md-6">
  20. <%= f.label :start %>
  21. <%= f.datetime_field :start, class: 'form-control' %>
  22. </div>
  23. <div class="col-md-6">
  24. <%= f.label :end %>
  25. <%= f.datetime_field :end, class: 'form-control' %>
  26. </div>
  27. </div>
  28. </div>
  29. <div class="form-group">
  30. <%= f.label :description %>
  31. <%= f.text_area :description, class: 'form-control' %>
  32. </div>
  33. <div class="form-group">
  34. <%= f.label :location %>
  35. <%= f.text_area :location, class: 'form-control' %>
  36. </div>
  37. <div class="form-group">
  38. <%= f.label :deadline %>
  39. <%= f.datetime_field :deadline, class: 'form-control' %>
  40. </div>
  41. <div class="form-group">
  42. <%= f.label :reminder_at %>
  43. <%= f.datetime_field :reminder_at, class: 'form-control' %>
  44. </div>
  45. <div class="form-group">
  46. <div class="check-box">
  47. <%= f.check_box(:subgroup_division_enabled) %>
  48. <%= t 'activerecord.attributes.activity.subgroup_division_enabled' %>
  49. </div>
  50. <div class="form-group btn-group">
  51. <%= f.submit class: 'btn btn-primary' %>
  52. <% unless activity.new_record? %>
  53. <%= link_to I18n.t('activities.subgroups.distribute_remaining'),
  54. { action: 'immediate_subgroups', group_id: activity.group_id, activity_id: activity.id },
  55. class: 'btn btn-warning',
  56. method: :post,
  57. data: { confirm: I18n.t('activities.subgroups.distribute_remaining_explanation')}
  58. %>
  59. <%= link_to I18n.t('activities.subgroups.redistribute'),
  60. { action: 'immediate_subgroups', group_id: activity.group_id, activity_id: activity.id, overwrite: true },
  61. method: :post,
  62. class: 'btn btn-danger',
  63. data: { confirm: I18n.t('activities.subgroups.redistribute_explanation')}
  64. %>
  65. <%= link_to I18n.t('activities.subgroups.clear'),
  66. { action: 'clear_subgroups', group_id: activity.group_id, activity_id: activity.id, },
  67. method: :post,
  68. class: 'btn btn-danger',
  69. data: { confirm: I18n.t('activities.subgroups.clear_explanation')}
  70. %>
  71. <% end %>
  72. </div>
  73. </div>
  74. <% end %>