Sprankelprachtig aan/afmeldsysteem

_form.html.erb 3.3KB

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