Documents can be added/viewed/edited for an accompanyingCourse + menu entry added

This commit is contained in:
2021-09-14 15:44:06 +02:00
parent 88c192c22e
commit 2e5c2de363
11 changed files with 142 additions and 92 deletions

View File

@@ -5,7 +5,7 @@
{% block title %}
{# {{ 'Editing document for %name%'|trans({ '%name%': accompanyingCourse|chill_entity_render_string } ) }} #}
{% endblock %}
{% block accompanyingCoursecontent %}
{% block content %}
<h1>{{ 'Edit Document' | trans }}</h1>
@@ -16,13 +16,12 @@
{{ form_row(form.title) }}
{{ form_row(form.date) }}
{{ form_row(form.category) }}
{{ form_row(form.scope) }}
{{ form_row(form.description) }}
{{ form_row(form.object, { 'label': 'Document', 'existing': document.object }) }}
<ul class="record_actions">
<li class="cancel">
<a href="{{ path('accompanying_course_document_index', {'course': course.id}) }}" class="btn btn-cancel">
<a href="{{ path('accompanying_course_document_index', {'course': accompanyingCourse.id}) }}" class="btn btn-cancel">
{{ 'Back to the list' | trans }}
</a>
</li>

View File

@@ -20,7 +20,6 @@
<tr>
<th>{{ 'Title' | trans }}</th>
<th>{{ 'Category'|trans }}</th>
<th>{{ 'Circle' | trans }}</th>
<th>{{ 'Actions' | trans }}</th>
</tr>
</thead>
@@ -32,19 +31,19 @@
{# <td>{{ document.scope.name|localize_translatable_string }}</td> #}
<td>
<ul class="record_actions">
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) %}
{# if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE_DETAILS', document) #}
<li>
{{ m.download_button(document.object, document.title) }}
</li>
<li>
<a href="{{ path('accompanying_course_document_show', {'course': accompanyingCourse.id, 'id': document.id}) }}" class="btn btn-show"></a>
<a href="{{ chill_path_add_return_path('accompanying_course_document_show', {'course': accompanyingCourse.id, 'id': document.id}) }}" class="btn btn-show"></a>
</li>
{% endif %}
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
{# endif #}
{# if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) #}
<li>
<a href="{{ path('accompanying_course_document_edit', {'course': accompanyingCourse.id, 'id': document.id }) }}" class="btn btn-update"></a>
</li>
{% endif %}
{# endif #}
</ul>
</td>
</tr>

View File

@@ -13,7 +13,7 @@
{{ encore_entry_script_tags('mod_async_upload') }}
{% endblock %}
{% block accompanyingCoursecontent %}
{% block content %}
<h1>{{ 'Document %title%' | trans({ '%title%': document.title }) }}</h1>
@@ -21,9 +21,6 @@
<dt>{{ 'Title'|trans }}</dt>
<dd>{{ document.title }}</dd>
<dt>{{ 'Scope' | trans }}</dt>
<dd>{{ document.scope.name | localize_translatable_string }}</dd>
<dt>{{ 'Category'|trans }}</dt>
<dd>{{ document.category.name|localize_translatable_string }}</dd>
@@ -42,7 +39,7 @@
<ul class="record_actions">
<li class="cancel">
<a href="{{ path('accompanying_course_document_index', {'course': course.id}) }}" class="btn btn-cancel">
<a href="{{ path('accompanying_course_document_index', {'course': accompanyingCourse.id}) }}" class="btn btn-cancel">
{{ 'Back to the list' | trans }}
</a>
</li>
@@ -53,7 +50,7 @@
{% if is_granted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_UPDATE', document) %}
<li>
<a href="{{ path('accompanying_course_document_edit', {'id': document.id, 'course': course.id}) }}" class="btn btn-edit">
<a href="{{ path('accompanying_course_document_edit', {'id': document.id, 'course': accompanyingCourse.id}) }}" class="btn btn-edit">
{{ 'Edit' | trans }}
</a>
</li>