_volunteer_group_assignments.html.slim 3.03 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)
11
12
      - if policy(GroupAssignment).comments?
        th= t_attr(:comments)
13
      th colspan=(editable ? '7' : '2')
14
15
  tbody
    - group_assignments.each do |group_assignment|
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
16
      tr
17
18
19
20
21
        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
22
23
            - if policy(group_assignment).edit?
              = button_link navigation_glyph(:edit), edit_group_assignment_path(group_assignment),
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),
30
                  change_active_state_group_offer_path(group_assignment.group_offer), method: :put,
31
                  title: (group_assignment.group_offer.active? ? 'Deaktivieren' : 'Aktivieren')
32
33
        td
          - if group_assignment.group_offer
34
35
36
37
            - 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
38
39
          - else
            = group_assignment.title
40
41
42
43
44
        td
          - if group_assignment.responsible
            = t_attr(:responsible, GroupAssignment)
          - else
            = t_attr(:member, GroupAssignment)
45
46
        td= l(group_assignment.period_start) if group_assignment.period_start
        td= l(group_assignment.period_end) if group_assignment.period_end
47
48
        - if policy(GroupAssignment).comments?
          = td_truncate_content_modal(group_assignment.comments, 'Bemerkungen')
49
50
51
52
53
54
55
56
57
        - if editable && !@volunteer.external?
          td.index-action-cell.hidden-print
            - 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])
          td.index-action-cell.hidden-print
            - 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])