Merge branch 'master' into notification/completion

This commit is contained in:
2022-01-11 10:18:02 +01:00
9 changed files with 230 additions and 113 deletions

View File

@@ -1,20 +1,19 @@
{# WIP
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% block title 'accompanying_course_comment.Remove comment'|trans %}
{% set person = activity.person %}
{% block display_content %}
<blockquote class="chill-user-quote col">{{ comment.content|chill_markdown_to_html }}</blockquote>
{% endblock %}
{% block title 'Remove comment'|trans %}
{% block personcontent %}
{% block content %}
{{ include('@ChillMain/Util/confirmation_template.html.twig',
{
'title' : 'Remove comment'|trans,
'confirm_question' : 'Are you sure you want to remove comment ?'|trans,
'cancel_route' : 'chill_activity_activity_list',
'cancel_parameters' : { 'person_id' : activity.person.id, 'id' : activity.id },
'title' : 'accompanying_course_comment.Remove comment'|trans,
'confirm_question' : 'accompanying_course_comment.Are you sure you want to remove comment ?'|trans,
'cancel_route' : 'chill_person_accompanying_period_comment_list',
'cancel_parameters' : { 'accompanying_period_id': comment.accompanyingPeriod.id },
'display_content' : block('display_content'),
'form' : delete_form
} ) }}
{% endblock %}
#}

View File

@@ -10,21 +10,27 @@
{% if isPinned is defined and isPinned == 'true' %}
{% else %}
<li>
<button class="btn btn-sm btn-misc" type="button">
<i class="fa fa-flag fa-fw"></i>{{ 'Pin comment'|trans }}
</button>
<form method="post" action="{{ chill_path_forward_return_path('chill_person_accompanying_period_comment_pin', {'id': comment.id}) }}">
<button class="btn btn-sm btn-misc" type="submit">
<i class="fa fa-flag fa-fw"></i>{{ 'Pin comment'|trans }}
</button>
</form>
</li>
{% endif %}
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_EDIT', comment) %}
<li>
<a class="btn btn-sm btn-edit" title="{{ 'Edit'|trans }}" href="{{ path('chill_person_accompanying_period_comment_list', {
'_fragment': 'comment-' ~ comment.id,
'edit': comment.id,
'accompanying_period_id': comment.accompanyingPeriod.id
}) }}"></a>
</li>
{% endif %}
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_COMMENT_DELETE', comment) %}
<li>
<a class="btn btn-sm btn-delete" title="{{ 'Delete'|trans }}" href="{{ path('chill_person_accompanying_period_comment_delete', {'id': comment.id}) }}"></a>
</li>
{% endif %}
<li>
<a class="btn btn-sm btn-edit" title="{{ 'Edit'|trans }}" href="{{ path('chill_person_accompanying_period_comment_list', {
'_fragment': 'comment-' ~ comment.id,
'edit': comment.id,
'accompanying_period_id': comment.accompanyingPeriod.id
}) }}"></a>
</li>
<li>
<a class="btn btn-sm btn-delete" title="{{ 'Delete'|trans }}" href=""></a>
</li>
{% endmacro %}
{% macro form_comment(type, form) %}
@@ -75,9 +81,12 @@
{% endif %}
{% endfor %}
</div>
<div class="new-comment my-5">
<h2 class="chill-blue">{{ 'Write a new comment'|trans }}</h2>
{{ _self.form_comment('new', form) }}
</div>
{% if form is not null %}
<div class="new-comment my-5">
<h2 class="chill-blue">{{ 'Write a new comment'|trans }}</h2>
{{ _self.form_comment('new', form) }}
</div>
{% endif %}
</div>
{% endblock %}

View File

@@ -22,6 +22,3 @@
</div>
</div>
{% endmacro %}
{#
TODO if shared, move this file in Main, out of AccompanyingCourse
#}