_volunteer_group_assignments.html.slim 1.97 KB
Newer Older
1
table.table.table-striped.group-assignments-table
2
3
4
  thead
    tr
      th= t_attr(:title, GroupOffer)
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
5
      th= t_attr(:role, GroupAssignment)
6
7
      th= t_attr(:period_start, GroupAssignment)
      th= t_attr(:period_end, GroupAssignment)
8
      th colspan=(editable ? '7' : '2')
9
10
  tbody
    - group_assignments.each do |group_assignment|
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
11
      tr
12
13
14
15
16
        td
          - if group_assignment.group_offer
            = link_to group_assignment.group_offer.title, group_offer_path(group_assignment.group_offer)
          - else
            = group_assignment.title
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
17
18
19
20
        - if group_assignment.responsible
          td= t_attr(:responsible, GroupAssignment)
        - else
          td= t_attr(:member, GroupAssignment)
21
22
        td= l(group_assignment.period_start) if group_assignment.period_start
        td= l(group_assignment.period_end) if group_assignment.period_end
23
24
        - if group_assignment.group_offer
          td= link_to t_action(:show), group_offer_path(group_assignment.group_offer)
25
        - if editable
26
          td= link_to t('download'), group_assignment_path(group_assignment, format: :pdf)
27
28
          - if policy(group_assignment.group_offer).edit?
            td= link_to t_action(:edit), edit_group_offer_path(group_assignment.group_offer)
29
30
31
32
          - if policy(GroupOffer).destroy?
            td= link_to t_action(:destroy), group_offer_path(group_assignment.group_offer), confirm_deleting(group_assignment.group_offer)
          - else
            td
33
          td= link_to "#{ group_assignment.group_offer.active? ? t('.deactivate') : t('.activate') }",
34
              change_active_state_group_offer_path(group_assignment.group_offer), method: :put, remote: :true
35
36
37
          - if policy(Feedback).index?
            td= link_to t_title(:new, Feedback), new_polymorphic_path([@volunteer, group_assignment.group_offer, Feedback])
            td= link_to t_title(:index, Feedback), polymorphic_path([@volunteer, group_assignment.group_offer, Feedback])
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
38
39
40
          - else
            td
            td