_volunteer_group_assignments.html.slim 2.62 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= t_attr(:comments)
9
      th colspan=(editable ? '7' : '2')
10
11
  tbody
    - group_assignments.each do |group_assignment|
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
12
      tr
13
14
        td
          - if group_assignment.group_offer
15
16
17
18
            - 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
19
20
          - else
            = group_assignment.title
21
22
23
24
25
        td
          - if group_assignment.responsible
            = t_attr(:responsible, GroupAssignment)
          - else
            = t_attr(:member, GroupAssignment)
26
27
        td= l(group_assignment.period_start) if group_assignment.period_start
        td= l(group_assignment.period_end) if group_assignment.period_end
28
        = td_truncate_content_modal(group_assignment.comments, 'Bemerkungen', shorten_size: 100)
29
30
31
        td
          - if group_assignment.group_offer && policy(group_assignment.group_offer).show?
            = link_to t_action(:show), group_offer_path(group_assignment.group_offer)
32
        - if editable
33
34
35
36
37
38
39
40
41
42
          td
            - if policy(group_assignment).show?
              = link_to t('download'), group_assignment_path(group_assignment, format: :pdf)
          td
            - if policy(group_assignment.group_offer).edit?
              = link_to t_action(:edit), edit_group_offer_path(group_assignment.group_offer)
          td
            - if policy(group_assignment.group_offer).change_active_state?
              = link_to "#{ group_assignment.group_offer.active? ? t('.deactivate') : t('.activate') }",
                change_active_state_group_offer_path(group_assignment.group_offer), method: :put, remote: :true
Tugce Nur Tas's avatar
Tugce Nur Tas committed
43
          td.index-action-cell.hidden-print
44
45
46
            - 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
47
          td.index-action-cell.hidden-print
48
49
50
            - 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])