new/show/edit/delete/list functionality added for accompanyingperiod task

This commit is contained in:
2021-09-17 14:33:42 +02:00
parent a156bd0863
commit 01ae50aca7
15 changed files with 243 additions and 119 deletions

View File

@@ -0,0 +1,25 @@
<div class="task-edit">
<h1>{{ 'Edit task'|trans }}</h1>
{{ form_start(form) }}
{{ form_row(form.title) }}
{{ form_row(form.description) }}
{{ form_row(form.assignee) }}
{{ form_row(form.circle) }}
{{ form_row(form.startDate) }}
{{ form_row(form.endDate) }}
{{ form_row(form.warningInterval) }}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a class="btn btn-cancel" href={% if task.person is not null %} "{{ path('chill_task_singletask_list', { 'person_id': task.person.id, 'list_params': app.request.query.get('list_params', {} )} ) }}" {% else %} "{{ chill_return_path_or('chill_task_singletask_courselist', {'course_id': task.course.id}) }}" {% endif %}>
{{ 'Cancel'|trans }}</a>
</li>
<li>
{{ form_widget(form.submit, { 'label': 'Save task', 'attr': {'class' : 'btn btn-update'}})}}
</li>
</ul>
{{ form_end(form) }}
</div>

View File

@@ -0,0 +1,30 @@
<div class="task-new">
<h1>{{ 'New task'|trans }}</h1>
{{ form_start(form) }}
{{ form_errors(form) }}
{{ form_row(form.title) }}
{{ form_row(form.description) }}
{{ form_row(form.assignee) }}
{{ form_row(form.circle) }}
{{ form_row(form.startDate) }}
{{ form_row(form.endDate) }}
{{ form_row(form.warningInterval) }}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a class="btn btn-cancel" href={% if task.person is not null %} "{{ path('chill_task_singletask_list', { 'person_id': task.person.id, 'list_params': app.request.query.get('list_params', {} )} ) }}" {% else %} "{{ chill_return_path_or('chill_task_singletask_courselist', {'course_id': task.course.id}) }}" {% endif %}>
{{'Cancel'|trans}}
</a>
</li>
<li>
{{ form_widget(form.submit, { 'label': 'Add a new task'|trans, 'attr': {'class': 'btn btn-save'} }) }}
</li>
</ul>
{{ form_end(form) }}
</div>

View File

@@ -68,8 +68,8 @@
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a class="btn btn-cancel" href="{%- if app.request.query.has('returnPath') -%} {{ app.request.query.get('returnPath')|escape('html_attr') }} {%- else -%} {{ path('chill_task_singletask_list', app.request.query.get('list_params', {}) ) }} {%- endif -%}">
{{ app.request.query.get('returnLabel')|default('Back to the list'|trans) }}
<a class="btn btn-cancel" href={% if task.person is not null %} "{{ path('chill_task_singletask_list', { 'person_id': task.person.id, 'list_params': app.request.query.get('list_params', {} )} ) }}" {% else %} "{{ chill_return_path_or('chill_task_singletask_courselist', {'course_id': task.course.id}) }}" {% endif %}>
{{'Back to the list'|trans}}
</a>
</li>

View File

@@ -0,0 +1,19 @@
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = 'chill_task_task_list' %}
{% set course = task.course %}
{% block title 'Remove task'|trans %}
{% block content %}
{{ include('@ChillMain/Util/confirmation_template.html.twig',
{
'title' : 'Remove task'|trans,
'confirm_question' : 'Are you sure you want to remove the task about accompanying period "%id%" ?'|trans({ '%id%' : course.id } ),
'cancel_route' : 'chill_task_singletask_courselist',
'cancel_parameters' : app.request.query.get('list_params', { } ),
'form' : delete_form,
} ) }}
{% endblock %}

View File

@@ -14,46 +14,17 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% extends person is defined ? "@ChillPerson/Person/layout.html.twig" %}
{% set activeRouteKey = 'chill_task_single_task_edit' %}
{% set person = task.person %}
{% block title %}{{ 'Edit task'|trans }}{% endblock %}
{% block title %}
{{ 'Edit task'|trans }}
{% endblock %}
{% block personcontent %}
<div class="task-edit">
<h1>{{ 'Edit task'|trans }}</h1>
{{ form_start(form) }}
{% include 'ChillTaskBundle:SingleTask:_edit.html.twig' %}
{{ form_row(form.title) }}
{{ form_row(form.description) }}
{{ form_row(form.assignee) }}
{{ form_row(form.circle) }}
{{ form_row(form.startDate) }}
{{ form_row(form.endDate) }}
{{ form_row(form.warningInterval) }}
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a class="btn btn-cancel" href="{% apply spaceless %}
{% if app.request.query.has('returnPath') %}
{{ app.request.query.get('returnPath')|escape('html_attr') }}">
{% else %}
{{ path('chill_task_single_task_show', { 'id': task.id, 'list_params': app.request.query.get('list_params', { } )} ) }}
{% endif %}
{% endapply %}">
{{ app.request.query.get('returnLabel')|default('Cancel'|trans) }}
</a>
</li>
<li>
{{ form_widget(form.submit, { 'label': 'Save task', 'attr': {'class' : 'btn btn-update'}})}}
</li>
</ul>
{{ form_end(form) }}
</div>
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = 'chill_task_single_task_edit' %}
{% set course = task.course %}
{% block title %}
{{ 'Edit task'|trans }}
{% endblock %}
{% block content %}
{% include 'ChillTaskBundle:SingleTask:_edit.html.twig' %}
{% endblock %}

View File

@@ -14,37 +14,16 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% extends person is defined ? "@ChillPerson/Person/layout.html.twig" : "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = 'chill_task_single_task_new' %}
{% set person = task.person %}
{% block title %}{{ 'New task'|trans }}{% endblock %}
{% block title %}
{{ 'New task'|trans }}
{% endblock %}
{% block personcontent %}
<div class="task-new">
<h1>{{ 'New task'|trans }}</h1>
{{ form_start(form) }}
{{ form_errors(form) }}
{{ form_row(form.title) }}
{{ form_row(form.description) }}
{{ form_row(form.assignee) }}
{{ form_row(form.circle) }}
{{ form_row(form.startDate) }}
{{ form_row(form.endDate) }}
{{ form_row(form.warningInterval) }}
<ul class="record_actions sticky-form-buttons">
<li>
{{ form_widget(form.submit, { 'label': 'Add a new task'|trans, 'attr': {'class': 'btn btn-save'} }) }}
</li>
</ul>
{{ form_end(form) }}
</div>
{% include 'ChillTaskBundle:SingleTask:_new.html.twig' %}
{% endblock %}

View File

@@ -0,0 +1,12 @@
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% set activeRouteKey = 'chill_task_single_task_new' %}
{# {% set person = task.person %} #}
{% block title %}
{{ 'New task'|trans }}
{% endblock %}
{% block content %}
{% include 'ChillTaskBundle:SingleTask:_new.html.twig' %}
{% endblock %}