restart via API allows to copy description (#782)

This commit is contained in:
Kevin Papst
2019-05-13 17:32:01 +02:00
committed by GitHub
parent 1f5710eaba
commit bbe1f9beda
28 changed files with 250 additions and 118 deletions

View File

@@ -219,7 +219,7 @@
{% endif %}
{% if timesheet.end and is_granted('start', timesheet) %}
{% set actions = actions|merge({'repeat': path('timesheet_start', {'id' : timesheet.id})}) %}
{% set actions = actions|merge({'repeat': {'url': path('restart_timesheet', {'id' : timesheet.id}), 'class': 'api-link', 'attr': {'data-payload': '{"copy": "all"}', 'data-event': 'kimai.timesheetStart kimai.timesheetUpdate', 'data-method': 'PATCH', 'data-msg-error': 'timesheet.start.error', 'data-msg-success': 'timesheet.start.success'}}}) %}
{% endif %}
{% if is_granted('edit', timesheet) %}
@@ -274,7 +274,7 @@
{% endif %}
{% if timesheet.end and is_granted('start', timesheet) %}
{% set actions = actions|merge({'repeat': path('timesheet_start', {'id' : timesheet.id})}) %}
{% set actions = actions|merge({'repeat': {'url': path('restart_timesheet', {'id' : timesheet.id}), 'class': 'api-link', 'attr': {'data-payload': '{"copy": "all"}', 'data-event': 'kimai.timesheetStart kimai.timesheetUpdate', 'data-method': 'PATCH', 'data-msg-error': 'timesheet.start.error', 'data-msg-success': 'timesheet.start.success'}}}) %}
{% endif %}
{% if is_granted('edit', timesheet) %}

View File

@@ -253,8 +253,8 @@
target="{{ target }}"
{%- endif -%}
{%- if attr is not empty -%}
{%- for name, value in attr -%}
{{ name }}="{{ value }}"
{%- for name, value in attr %}
{{- ' ' ~ name }}={% if '"' in value %}'{{ value|raw }}'{% else %}"{{ value|raw }}"{% endif %}
{%- endfor -%}
{%- endif -%}
>{% if title is not null %}{{ title }}{% else %}{{ macro.icon(icon) }}{% endif %}</a>