_volunteer_group_assignments.html.slim 2.72 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
        td
          - if group_assignment.group_offer
14
15
16
17
            - if policy(group_assignment.group_offer).show?
              = link_to group_assignment.group_offer.title, group_offer_path(group_assignment.group_offer)
            - else
              = group_assignment.group_offer.title
18
19
          - else
            = group_assignment.title
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
20
21
22
23
        - if group_assignment.responsible
          td= t_attr(:responsible, GroupAssignment)
        - else
          td= t_attr(:member, GroupAssignment)
24
25
        td= l(group_assignment.period_start) if group_assignment.period_start
        td= l(group_assignment.period_end) if group_assignment.period_end
26
        - if group_assignment.group_offer && policy(group_assignment.group_offer).show?
27
          td= link_to t_action(:show), group_offer_path(group_assignment.group_offer)
28
        - if editable
29
30
31
32
          - if policy(group_assignment).show?
            td= link_to t('download'), group_assignment_path(group_assignment, format: :pdf)
          - else
            td
33
34
          - if policy(group_assignment.group_offer).edit?
            td= link_to t_action(:edit), edit_group_offer_path(group_assignment.group_offer)
35
36
          - else
            td
37
          - if policy(GroupOffer).destroy?
Chrysanthi Lagodimou's avatar
fixes    
Chrysanthi Lagodimou committed
38
            td= link_to t_action(:delete), group_offer_path(group_assignment.group_offer), confirm_deleting(group_assignment.group_offer)
39
40
          - else
            td
41
42
          - if policy(group_assignment.group_offer).change_active_state?
            td= link_to "#{ group_assignment.group_offer.active? ? t('.deactivate') : t('.activate') }",
43
              change_active_state_group_offer_path(group_assignment.group_offer), method: :put, remote: :true
44
45
          - else
            td
Tugce Nur Tas's avatar
Tugce Nur Tas committed
46
          td.index-action-cell.hidden-print
47
48
49
            - if policy(TrialFeedback).index?
              span= link_to t_title(:new, TrialFeedback), new_polymorphic_path([@volunteer, group_assignment.group_offer, TrialFeedback])
              span= link_to t_title(:index, TrialFeedback), polymorphic_path([@volunteer, group_assignment.group_offer, TrialFeedback])
Tugce Nur Tas's avatar
Tugce Nur Tas committed
50
          td.index-action-cell.hidden-print
51
52
53
            - if policy(Feedback).index?
              span= link_to t_title(:new, Feedback), new_polymorphic_path([@volunteer, group_assignment.group_offer, Feedback])
              span= link_to t_title(:index, Feedback), polymorphic_path([@volunteer, group_assignment.group_offer, Feedback])