1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <%= form_for([@group, activity]) do |f| %>
- <% if activity.errors.any? %>
- <div id="error_explanation">
- <h2>
- <%= I18n.t(:could_not_be_saved, errorcount: I18n.t(:error, count: activity.errors.count), class: I18n.t('activities.singular')) %>
- </h2>
- <ul>
- <% activity.errors.full_messages.each do |message| %>
- <li><%= message %></li>
- <% end %>
- </ul>
- </div>
- <% end %>
- <div class="actions">
- <div class="form-group">
- <%= f.label :name %>
- <%= f.text_field :name, class: 'form-control' %>
- </div>
- <div class="form-group">
- <div class="row">
- <div class="col-md-6">
- <%= f.label :start %>
- <%= f.datetime_field :start, class: 'form-control' %>
- </div>
- <div class="col-md-6">
- <%= f.label :end %>
- <%= f.datetime_field :end, class: 'form-control' %>
- </div>
- </div>
- </div>
- <div class="form-group">
- <%= f.label :description %>
- <%= f.text_area :description, class: 'form-control' %>
- </div>
- <div class="form-group">
- <%= f.label :location %>
- <%= f.text_area :location, class: 'form-control' %>
- </div>
- <div class="form-group">
- <%= f.label :deadline %>
- <%= f.datetime_field :deadline, class: 'form-control' %>
- </div>
- <div class="form-group row">
- <div class="col-md-6">
- <%= f.label :reminder_at %>
- <%= f.datetime_field :reminder_at, class: 'form-control' %>
- </div>
- <div class="col-md-6">
- <%= f.label :no_response_action %>
- <%= f.select(:no_response_action, options_for_select([
- [I18n.t('activities.no_response_action.auto_present'), 'true'],
- [I18n.t('activities.no_response_action.auto_absent'), 'false']
- ], selected: @activity.no_response_action.to_s), {}, {class: 'form-control'}) %>
- </div>
- </div>
- <div class="form-group">
- <div class="check-box">
- <%= f.check_box(:subgroup_division_enabled) %>
- <%= t 'activerecord.attributes.activity.subgroup_division_enabled' %>
- </div>
- </div>
- <div class="form-group btn-group">
- <%= submit_tag(t(:save_and_return), class: "btn btn-success") %>
- <%= f.submit class: 'btn btn-primary', name: "commit-continue" %>
- </div>
- <div class="form-group btn-group">
- <% unless activity.new_record? %>
- <%= link_to I18n.t('activities.subgroups.distribute_remaining'),
- { action: 'immediate_subgroups', group_id: activity.group_id, activity_id: activity.id },
- class: 'btn btn-warning',
- method: :post,
- data: { confirm: I18n.t('activities.subgroups.distribute_remaining_explanation')}
- %>
- <%= link_to I18n.t('activities.subgroups.redistribute'),
- { action: 'immediate_subgroups', group_id: activity.group_id, activity_id: activity.id, overwrite: true },
- method: :post,
- class: 'btn btn-danger',
- data: { confirm: I18n.t('activities.subgroups.redistribute_explanation')}
- %>
- <%= link_to I18n.t('activities.subgroups.clear'),
- { action: 'clear_subgroups', group_id: activity.group_id, activity_id: activity.id, },
- method: :post,
- class: 'btn btn-danger',
- data: { confirm: I18n.t('activities.subgroups.clear_explanation')}
- %>
- <% end %>
- </div>
- </div>
- <% end %>
|