Merge branch '116-course-index-link-action-to-view-if-closed' into 'master'

Fixed: rights on the action list in accompanying period main's page

Closes #116

See merge request Chill-Projet/chill-bundles!566
This commit is contained in:
Julien Fastré 2023-07-06 20:05:25 +00:00
commit 8929f4b8a3
2 changed files with 20 additions and 12 deletions

View File

@ -0,0 +1,6 @@
kind: Fixed
body: On the accompanying course page, open the action on view mode if the user does
not have right to update them (i.e. if the accompanying period is closed)
time: 2023-06-27T11:02:33.027807027+02:00
custom:
Issue: "116"

View File

@ -1,9 +1,11 @@
<div class="accompanying-course-work">
<div class="accompanying-course-work">
{% for w in works | slice(0,5) %}
<a href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) }}"
class="dashboard-link" title="{{ 'crud.social_action.title_link'|trans }}">
<a href="{%- if is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_UPDATE', w) -%}
{{- chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) -}}
{%- elseif is_granted('CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE', w) -%}
{{- chill_path_add_return_path('chill_person_accompanying_period_work_show', { 'id': w.id }) -}}
{%- else %}#{% endif -%}" class="dashboard-link" title="{{ 'crud.social_action.title_link'|trans }}">
<div class="dashboard">
<span class="title_label"></span>
<span class="title_action"><span class="like-h3">{{ w.socialAction|chill_entity_render_string }}</span>
@ -67,6 +69,6 @@
</a>
{% endfor %}
</div>
</div>