_volunteer_group_assignments.html.slim 2.9 KB
Newer Older
1
table.table.table-striped.group-assignments-table
2
3
  thead
    tr
4
5
      - if editable
        th.hidden-print Aktionen
6
      th= t_attr(:title, GroupOffer)
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
7
      th= t_attr(:role, GroupAssignment)
8
9
      th= t_attr(:period_start, GroupAssignment)
      th= t_attr(:period_end, GroupAssignment)
10
      th= t_attr(:comments)
11
      th colspan=(editable ? '7' : '2')
12
13
  tbody
    - group_assignments.each do |group_assignment|
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
14
      tr
15
16
17
18
19
        td.index-action-cell.hidden-print
          - if group_assignment.group_offer && policy(group_assignment.group_offer).show?
            = button_link navigation_glyph(:show), group_offer_path(group_assignment.group_offer),
                title: 'Anzeigen'
          - if editable
20
21
            - if policy(group_assignment).edit?
              = button_link navigation_glyph(:edit), edit_group_assignment_path(group_assignment),
22
23
24
25
26
27
28
29
                  title: 'Bearbeiten'
            - if policy(group_assignment).show?
              = button_link navigation_glyph(:download), group_assignment_path(group_assignment, format: :pdf),
                  title: 'Herunterladen'
            - if policy(group_assignment.group_offer).change_active_state?
              = button_link navigation_glyph(group_assignment.group_offer.active? ? :deactivate : :activate),
                  change_active_state_group_offer_path(group_assignment.group_offer), method: :put, remote: :true,
                  title: (group_assignment.group_offer.active? ? 'Deaktivieren' : 'Aktivieren')
30
31
        td
          - if group_assignment.group_offer
32
33
34
35
            - 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
36
37
          - else
            = group_assignment.title
38
39
40
41
42
        td
          - if group_assignment.responsible
            = t_attr(:responsible, GroupAssignment)
          - else
            = t_attr(:member, GroupAssignment)
43
44
        td= l(group_assignment.period_start) if group_assignment.period_start
        td= l(group_assignment.period_end) if group_assignment.period_end
45
        = td_truncate_content_modal(group_assignment.comments, 'Bemerkungen')
46
        - if editable
Tugce Nur Tas's avatar
Tugce Nur Tas committed
47
          td.index-action-cell.hidden-print
48
49
50
            - 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
51
          td.index-action-cell.hidden-print
52
53
54
            - 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])