Sprankelprachtig aan/afmeldsysteem

_form.html.erb 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 row">
  42. <div class="col-md-6">
  43. <%= f.label :reminder_at %>
  44. <%= f.datetime_field :reminder_at, class: 'form-control' %>
  45. </div>
  46. <div class="col-md-6">
  47. <%= f.label :no_response_action %>
  48. <%= f.select(:no_response_action, options_for_select([
  49. [I18n.t('activities.no_response_action.auto_present'), 'true'],
  50. [I18n.t('activities.no_response_action.auto_absent'), 'false']
  51. ], selected: @activity.no_response_action.to_s), {}, {class: 'form-control'}) %>
  52. </div>
  53. </div>
  54. <div class="form-group">
  55. <div class="check-box">
  56. <%= f.check_box(:subgroup_division_enabled) %>
  57. <%= t 'activerecord.attributes.activity.subgroup_division_enabled' %>
  58. </div>
  59. </div>
  60. <div class="form-group btn-group">
  61. <%= f.submit class: 'btn btn-primary' %>
  62. <% unless activity.new_record? %>
  63. <%= link_to I18n.t('activities.subgroups.distribute_remaining'),
  64. { action: 'immediate_subgroups', group_id: activity.group_id, activity_id: activity.id },
  65. class: 'btn btn-warning',
  66. method: :post,
  67. data: { confirm: I18n.t('activities.subgroups.distribute_remaining_explanation')}
  68. %>
  69. <%= link_to I18n.t('activities.subgroups.redistribute'),
  70. { action: 'immediate_subgroups', group_id: activity.group_id, activity_id: activity.id, overwrite: true },
  71. method: :post,
  72. class: 'btn btn-danger',
  73. data: { confirm: I18n.t('activities.subgroups.redistribute_explanation')}
  74. %>
  75. <%= link_to I18n.t('activities.subgroups.clear'),
  76. { action: 'clear_subgroups', group_id: activity.group_id, activity_id: activity.id, },
  77. method: :post,
  78. class: 'btn btn-danger',
  79. data: { confirm: I18n.t('activities.subgroups.clear_explanation')}
  80. %>
  81. <% end %>
  82. </div>
  83. </div>
  84. <% end %>