_group_assignments.html.slim 1.89 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
9
10
11
12
13
14
15
      - if editable
        th colspan='4'
        - if policy(GroupOffer).edit?
          th= ' '
      - if policy(GroupOffer).destroy?
        th= ' '
      - if policy(GroupOffer).change_active_state?
        th= ' '
16
17
  tbody
    - group_assignments.each do |group_assignment|
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
18
19
      tr
        td= link_to group_assignment.group_offer.title, group_offer_path(group_assignment.group_offer)
Chrysanthi Lagodimou's avatar
Chrysanthi Lagodimou committed
20
21
22
23
        - if group_assignment.responsible
          td= t_attr(:responsible, GroupAssignment)
        - else
          td= t_attr(:member, GroupAssignment)
24
25
        td= l(group_assignment.period_start) if group_assignment.period_start
        td= l(group_assignment.period_end) if group_assignment.period_end
26
27
        td= link_to t_action(:show), group_offer_path(group_assignment.group_offer)
        td= link_to t('download'), group_offer_path(group_assignment.group_offer, format: :pdf)
28
        - if editable
29
30
31
32
33
34
35
          - if policy(GroupOffer).edit?
            td= link_to t_action(:edit), edit_group_offer_path(group_assignment.group_offer)
          - if policy(GroupOffer).destroy?
            td= link_to t_action(:destroy), group_offer_path(group_assignment.group_offer), confirm_deleting(group_assignment.group_offer)
          - if policy(GroupOffer).change_active_state?
            td= 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
36
37
          td= link_to t_title(:new, Feedback), new_group_offer_feedback_path(group_assignment.group_offer)
          td= link_to t_title(:index, Feedback), group_offer_feedbacks_path(group_assignment.group_offer)