Commit 29eb26ca authored by Zsolt Benke's avatar Zsolt Benke
Browse files

Merge conditionals into one statement

parent d0f37c37
Pipeline #18285 passed with stage
in 35 minutes and 14 seconds
......@@ -21,13 +21,12 @@ tr
assignment.creator.full_name,
profile_link(assignment.creator)
= td_truncate_content_modal(assignment.comments, 'Bemerkungen')
- unless assignment.volunteer.external?
- if controller_name == 'volunteers'
- if policy(TrialFeedback).index?
td.index-action-cell.hidden-print
= link_to t_title(:new, TrialFeedback), new_polymorphic_path([assignment.volunteer, assignment, TrialFeedback])
span= link_to t_title(:index, TrialFeedback), polymorphic_path([assignment.volunteer, assignment, TrialFeedback])
- if policy(Feedback).index?
td.index-action-cell.hidden-print
= link_to t_title(:new, Feedback), new_polymorphic_path([assignment.volunteer, assignment, Feedback])
= link_to t_title(:index, Feedback), polymorphic_path([assignment.volunteer, assignment, Feedback])
- if controller_name == 'volunteers' && !assignment.volunteer.external?
- if policy(TrialFeedback).index?
td.index-action-cell.hidden-print
= link_to t_title(:new, TrialFeedback), new_polymorphic_path([assignment.volunteer, assignment, TrialFeedback])
span= link_to t_title(:index, TrialFeedback), polymorphic_path([assignment.volunteer, assignment, TrialFeedback])
- if policy(Feedback).index?
td.index-action-cell.hidden-print
= link_to t_title(:new, Feedback), new_polymorphic_path([assignment.volunteer, assignment, Feedback])
= link_to t_title(:index, Feedback), polymorphic_path([assignment.volunteer, assignment, Feedback])
......@@ -44,13 +44,12 @@ table.table.table-striped.group-assignments-table
td= l(group_assignment.period_start) if group_assignment.period_start
td= l(group_assignment.period_end) if group_assignment.period_end
= td_truncate_content_modal(group_assignment.comments, 'Bemerkungen')
- 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])
- 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])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment