123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- - all_buttons = @activity.may_change?(current_person)
- = render partial: 'activities/prev_next'
- .row
- .col-md-9
- .panel.panel-default
- .panel-heading
- .btn-group.pull-right
- %button.btn.btn-default.dropdown-toggle.btn-xs{data: {toggle: 'dropdown'}, 'aria-haspopup': true, 'aria-expanded': false}
- %i.fas.fa-cogs
- %span.caret
- %ul.dropdown-menu
- %li
- %a.copy-reactions{data: {activity: @activity.id, absent: true}}
- %i.fas.fa-copy
- = t 'activities.participant.copy_absent'
- %a.copy-reactions{data: {activity: @activity.id, present: true, absent: true, unknown: true}}
- %i.fas.fa-copy
- = t 'activities.participant.copy_responses'
- - if all_buttons
- %li.divider{role: 'separator'}
- %li
- = link_to edit_group_activity_path(@group, @activity) do
- %i.fas.fa-pencil
- = t :edit
- = @activity.name
- %table.table
- - unless @organizers.blank?
- %tr
- %td
- = t 'activities.attrs.organizers'
- %td
- = @organizers
- - unless @activity.description.blank?
- %tr
- %td
- = t 'activities.attrs.description'
- %td
- = @activity.description
- - unless @activity.location.blank?
- %tr
- %td
- = t 'activities.attrs.where'
- %td
- = @activity.location
- %tr
- %td
- = t 'activities.attrs.when'
- %td
- = l @activity.start, format: :long
- - if @activity.end
- \-
- - if @activity.end.to_date == @activity.start.to_date
- = l @activity.end, format: '%H:%M'
- - else
- = l @activity.end, format: :long
- - if @activity.deadline
- %tr
- %td
- = t 'activities.attrs.deadline'
- %td
- = l @activity.deadline, format: :long
- - if @assignable_subgroups.any?
- %tr
- %td
- = t 'activerecord.models.subgroup.other'
- %td
- = @assignable_subgroups.join(', ')
- - if @ownparticipant&.subgroup
- %tr
- %td
- = t 'activities.participant.yoursubgroup'
- %td
- = @ownparticipant.subgroup.name
- - if @ownparticipant
- .col-md-3
- .panel.panel-default
- .panel-heading
- = t 'activities.participant.yourresponse'
- .panel-body
- = render partial: "activities/wide_presence_buttons", locals: {activity: @activity, person: @ownparticipant.person, state: @ownparticipant.attending}
- = editable @ownparticipant,
- :notes,
- url: presence_group_activity_path(@activity.group, @activity, person_id: @ownparticipant.person_id),
- title: t('activities.participant.notes'),
- value: @ownparticipant.notes,
- emptytext: t('activities.participant.add_notes')
- .hidden-xs
- .row
- .col-md-6
- %h2
- %span.state-count.all-count
- = @num_participants
- = t 'activities.participant.plural'
- = render partial: "state_counts", locals: {counts: @counts}
- .col-md-6
- - if @activity.subgroups.any?
- = select_tag(:subgroup_filter, options_for_select(@subgroup_ids), class: 'form-control subgroup-filter')
- %table.table.table-bordered
- - @participants.each do |p|
- %tr.participant-row.countable{class: p.row_class, data: {person_id: p.person.id, activity_id: @activity.id, subgroup_id: p.subgroup_id}}
- %td
- = p.person.full_name
- - if p.is_organizer
- %i.fas.fa-star-o
- %td
- = editable p, :notes, url: presence_group_activity_path(@activity.group, @activity, person_id: p.person_id), title: t('activities.participant.notes'), value: p.notes, emptytext: "--"
- %td
- - if p.person.id == current_person.id || all_buttons
- = render partial: "activities/presence_buttons", locals: {activity: @activity, person: p.person, state: p.attending}
- .hidden-sm.hidden-md.hidden-lg
- - if @activity.subgroups.any?
- .panel.panel-default
- .panel-heading
- = t 'activerecord.models.subgroup.other'
- .panel-body
- = select_tag(:subgroup_filter, options_for_select(@subgroup_ids), class: 'form-control subgroup-filter')
- .panel.panel-default.panel-success
- .panel-heading
- %a{role: 'button', href: '#present-collapse', data: {toggle: 'collapse'}, 'aria-expanded': 'false'}
- %span.sv-show-collapsed
- %i.fas.fa-angle-down
- %span.sv-show-expanded
- %i.fas.fa-angle-up
- = t 'activities.state.present'
- %span.badge.state-count.present-count
- = @counts[true] || "0"
- %table.table.collapse#present-collapse
- %tbody
- - @participants.where(attending: true).each do |p|
- = render partial: "mobile_participant_row", locals: {participant: p, show_all_buttons: all_buttons}
- .panel.panel-default
- .panel-heading
- %a{role: 'button', href: '#unknown-collapse', data: {toggle: 'collapse'}, 'aria-expanded': 'false'}
- %span.sv-show-collapsed
- %i.fas.fa-angle-down
- %span.sv-show-expanded
- %i.fas.fa-angle-up
- = t 'activities.state.need_response'
- %span.badge.state-count.unknown-count
- = @counts[nil] || "0"
- %table.table.collapse#unknown-collapse
- %tbody
- - @participants.where(attending: nil).each do |p|
- = render partial: "mobile_participant_row", locals: {participant: p, show_all_buttons: all_buttons}
- .panel.panel-default.panel-danger
- .panel-heading
- %a{role: 'button', href: '#absent-collapse', data: {toggle: 'collapse'}, 'aria-expanded': 'false'}
- %span.sv-show-collapsed
- %i.fas.fa-angle-down
- %span.sv-show-expanded
- %i.fas.fa-angle-up
- = t 'activities.state.absent'
- %span.badge.state-count.absent-count
- = @counts[false] || "0"
- %table.table.collapse#absent-collapse
- %tbody
- - @participants.where(attending: false).each do |p|
- = render partial: "mobile_participant_row", locals: {participant: p, show_all_buttons: all_buttons}
|