mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 00:23:50 +00:00
Feature: [CalendarDoc] pick template for generating calendar directly in list
This commit is contained in:
@@ -113,7 +113,7 @@
|
||||
<div class="item-row">
|
||||
<ul class="record_actions">
|
||||
{% if is_granted('CHILL_CALENDAR_CALENDAR_SEE', calendar) %}
|
||||
{% if not hasDocs %}
|
||||
{% if templates|length == 0 %}
|
||||
<li>
|
||||
<a class="btn btn-create"
|
||||
href="{{ chill_path_add_return_path('chill_calendar_calendardoc_new', {'id': calendar.id }) }}">
|
||||
@@ -127,18 +127,21 @@
|
||||
{{ 'chill_calendar.Add a document'|trans }}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
href="{{ chill_path_add_return_path('chill_calendar_calendardoc_pick_template', {'id': calendar.id }) }}">
|
||||
{{ 'chill_calendar.Add a document from template'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
href="{{ chill_path_add_return_path('chill_calendar_calendardoc_new', {'id': calendar.id }) }}">
|
||||
{{ 'chill_calendar.Upload a document'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% for template in templates %}
|
||||
<li>
|
||||
<a class="dropdown-item"
|
||||
href="{{ chill_path_add_return_path('chill_docgenerator_generate_from_template', {'template': template.id, 'entityClassName': 'Chill\\CalendarBundle\\Entity\\Calendar', 'entityId': calendar.id}) }}"
|
||||
>
|
||||
{{ template.name|localize_translatable_string }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
@@ -1,37 +0,0 @@
|
||||
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = 'chill_calendar_calendar_list' %}
|
||||
|
||||
{% block title %}{{ 'chill_calendar.Add a document' |trans }}{% endblock title %}
|
||||
|
||||
{% set user_id = null %}
|
||||
{% set accompanyingCourse = calendar.accompanyingPeriod %}
|
||||
{% set accompanying_course_id = accompanyingCourse.id %}
|
||||
|
||||
{% block js %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_script_tags('mod_docgen_picktemplate') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('mod_docgen_picktemplate') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>{{ 'chill_calendar.Add a document'|trans }}</h1>
|
||||
|
||||
<p>
|
||||
{% if calendar.endDate.diff(calendar.startDate).days >= 1 %}
|
||||
{{ calendar.startDate|format_datetime('short', 'short') }}
|
||||
- {{ calendar.endDate|format_datetime('short', 'short') }}
|
||||
{% else %}
|
||||
{{ calendar.startDate|format_datetime('short', 'short') }}
|
||||
- {{ calendar.endDate|format_datetime('none', 'short') }}
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<div data-docgen-template-picker="data-docgen-template-picker" data-entity-id="{{ calendar.id }}" data-entity-class="{{ 'Chill\\CalendarBundle\\Entity\\Calendar'|e('html_attr') }}"></div>
|
||||
|
||||
{% endblock %}
|
@@ -1,35 +0,0 @@
|
||||
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = 'chill_calendar_calendar_list' %}
|
||||
|
||||
{% block title %}{{ 'chill_calendar.Add a document' |trans }}{% endblock title %}
|
||||
|
||||
{% set person = calendar.person %}
|
||||
|
||||
{% block js %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_script_tags('mod_docgen_picktemplate') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('mod_docgen_picktemplate') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>{{ 'chill_calendar.Add a document'|trans }}</h1>
|
||||
|
||||
<p>
|
||||
{% if calendar.endDate.diff(calendar.startDate).days >= 1 %}
|
||||
{{ calendar.startDate|format_datetime('short', 'short') }}
|
||||
- {{ calendar.endDate|format_datetime('short', 'short') }}
|
||||
{% else %}
|
||||
{{ calendar.startDate|format_datetime('short', 'short') }}
|
||||
- {{ calendar.endDate|format_datetime('none', 'short') }}
|
||||
{% endif %}
|
||||
</p>
|
||||
|
||||
<div data-docgen-template-picker="data-docgen-template-picker" data-entity-id="{{ calendar.id }}" data-entity-class="{{ 'Chill\\CalendarBundle\\Entity\\Calendar'|e('html_attr') }}"></div>
|
||||
|
||||
{% endblock %}
|
Reference in New Issue
Block a user