added delete activity action #71 (#75)

* added delete activity form #71
* fixed stop button, added permission checks around action buttons #70
* do not allow to start hidden activities #33
* do not allow to start record for hidden project or customer #27 #32
This commit is contained in:
Kevin Papst
2018-01-10 20:11:51 +01:00
committed by GitHub
parent 098a1325d6
commit e1393a3e9d
16 changed files with 311 additions and 36 deletions

View File

@@ -12,7 +12,6 @@
{% endif %}
{{ tables.data_table_header({
'label.id': 'hidden-xs',
'label.name': '',
'label.customer': '',
'label.project': '',
@@ -23,7 +22,6 @@
{% for entry in entries %}
<tr>
<td class="hidden-xs">{{ entry.id }}</td>
<td>{{ entry.name }}</td>
<td>
<a href="{{ path('admin_customer_edit', {'id' : entry.project.customer.id}) }}">{{ widgets.label_customer(entry.project.customer) }}</a>
@@ -34,10 +32,14 @@
<td class="hidden-xs">{{ entry.comment }}</td>
<td>{{ widgets.label_visible(entry.visible) }}</td>
<td>
{{ widgets.button_group({
'edit': path('admin_activity_edit', {'id': entry.id}),
'trash': '#'
}) }}
{% set actionButtons = {} %}
{% if is_granted('edit', entry) %}
{% set actionButtons = {'edit': path('admin_activity_edit', {'id': entry.id})}|merge(actionButtons) %}
{% endif %}
{% if is_granted('delete', entry) %}
{% set actionButtons = actionButtons|merge({'trash': path('admin_activity_delete', {'id': entry.id})}) %}
{% endif %}
{{ widgets.button_group(actionButtons) }}
</td>
</tr>
{% endfor %}