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