adding the possibility to remove activities

fix #28
This commit is contained in:
2016-06-08 21:26:30 +02:00
parent dfaa4b0968
commit 1e476b39da
10 changed files with 152 additions and 25 deletions

View File

@@ -0,0 +1,19 @@
{% extends "ChillPersonBundle::layout.html.twig" %}
{% set activeRouteKey = 'chill_activity_activity_list' %}
{% set person = activity.person %}
{% block title 'Remove activity'|trans %}
{% block personcontent %}
{{ include('ChillMainBundle:Util:confirmation_template.html.twig',
{
'title' : 'Remove activity'|trans,
'confirm_question' : 'Are you sure you want to remove the activity about "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname } ),
'cancel_route' : 'chill_activity_activity_list',
'cancel_parameters' : { 'person_id' : activity.person.id, 'id' : activity.id },
'form' : delete_form
} ) }}
{% endblock %}

View File

@@ -51,9 +51,18 @@
<li>
<a href="{{ path('chill_activity_activity_show', { 'id': activity.id, 'person_id': person.id }) }}" class="sc-button">{{ 'show'|trans|capitalize }}</a>
</li>
{% if is_granted('CHILL_ACTIVITY_UPDATE', activity) %}
<li>
<a href="{{ path('chill_activity_activity_edit', { 'id': activity.id, 'person_id': person.id }) }}" class="sc-button bt-update">{{ 'Edit' | trans }}</a>
</li>
{% endif %}
{% if is_granted('CHILL_ACTIVITY_DELETE', activity) %}
<li>
<a href="{{ path('chill_activity_activity_delete', { 'id': activity.id, 'person_id' : person.id } ) }}" class="sc-button bt-delete">
{{ 'Delete'|trans }}
</a>
</li>
{% endif %}
</td>
</tr>
{% endfor %}

View File

@@ -40,7 +40,19 @@
</dl>
<a class="sc-button bt-update" href="{{ path('chill_activity_activity_edit', { 'id': entity.id, 'person_id': person.id }) }}">
<i class="fa fa-pencil"></i> {{ 'Edit the activity'|trans }}
</a>
<ul class="record_actions">
<li>
<a class="sc-button bt-update" href="{{ path('chill_activity_activity_edit', { 'id': entity.id, 'person_id': person.id }) }}">
<i class="fa fa-pencil"></i> {{ 'Edit the activity'|trans }}
</a>
</li>
{% if is_granted('CHILL_ACTIVITY_DELETE', entity) %}
<li>
<a href="{{ path('chill_activity_activity_delete', { 'id': entity.id, 'person_id' : person.id } ) }}" class="sc-button bt-delete">
{{ 'Delete'|trans }}
</a>
</li>
{% endif %}
</ul>
{% endblock personcontent %}