_volunteer_group_assignments.html.slim 2.19 KB
Newer Older
1
- editable ||= false
2
table.table.table-striped.group-assignments-table
3
4
  thead
    tr
5
6
      - if editable
        th.hidden-print Aktionen
7
      th= t_attr(:title, GroupOffer)
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
8
      th= t_attr(:role, GroupAssignment)
9
10
      th= t_attr(:period_start, GroupAssignment)
      th= t_attr(:period_end, GroupAssignment)
Tugce Nur Tas's avatar
Tugce Nur Tas committed
11
      - if policy(GroupAssignment).show_comments?
12
        th Rückmeldung
13
      th colspan=(editable ? '6' : '2')
14
15
  tbody
    - group_assignments.each do |group_assignment|
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
16
      tr
17
18
        td.index-action-cell.hidden-print
          - if group_assignment.group_offer && policy(group_assignment.group_offer).show?
19
            = button_link icon_span(:show), group_offer_path(group_assignment.group_offer),
20
21
                title: 'Anzeigen'
          - if editable
22
            - if policy(group_assignment).edit?
23
              = button_link icon_span(:edit), edit_group_assignment_path(group_assignment),
24
                  title: 'Bearbeiten'
Jiri Strojil's avatar
Jiri Strojil committed
25
            - if policy(group_assignment).show? && group_assignment.pdf.attached?
26
              = button_link icon_span(:download), group_assignment_path(group_assignment, format: :pdf),
27
                  title: 'Herunterladen'
28
29
        td
          - if group_assignment.group_offer
30
31
32
33
            - 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
34
35
          - else
            = group_assignment.title
36
37
38
39
40
        td
          - if group_assignment.responsible
            = t_attr(:responsible, GroupAssignment)
          - else
            = t_attr(:member, GroupAssignment)
41
42
        td= l(group_assignment.period_start) if group_assignment.period_start
        td= l(group_assignment.period_end) if group_assignment.period_end
Tugce Nur Tas's avatar
Tugce Nur Tas committed
43
        - if policy(GroupAssignment).show_comments?
44
          = td_truncate_content_modal(group_assignment.comments, 'Rückmeldung')
45
46
47
48
        - if editable && !@volunteer.external?
          td.index-action-cell.hidden-print
            - if policy(Feedback).index?
              span= link_to t_title(:index, Feedback), polymorphic_path([@volunteer, group_assignment.group_offer, Feedback])