javascript and api to stop and display active records (#772)

This commit is contained in:
Kevin Papst
2019-05-10 13:45:09 +02:00
committed by GitHub
parent e619b5fd31
commit 09da7cd242
86 changed files with 918 additions and 449 deletions

View File

@@ -171,7 +171,7 @@
{% if is_granted('view_other_timesheet') %}
{% set actions = actions|merge({'timesheet': path('admin_timesheet', {'customer': customer.id})}) %}
{% endif %}
{% if is_granted('create_project') and customer.visible %}
{% if customer.visible and is_granted('create_project') %}
{% set actions = actions|merge({'create-project': path('admin_project_create_with_customer', {'customer': customer.id})}) %}
{% endif %}
{% if view == 'index' and is_granted('delete', customer) %}
@@ -215,7 +215,7 @@
{% if timesheet.id is not empty %}
{% if not timesheet.end and is_granted('stop', timesheet) %}
{% set actions = actions|merge({'stop': path('timesheet_stop', {'id' : timesheet.id})}) %}
{% set actions = actions|merge({'stop': {'url': path('stop_timesheet', {'id' : timesheet.id}), 'class': 'api-link', 'attr': {'data-event': 'kimai.timesheetStop kimai.timesheetUpdate', 'data-method': 'PATCH', 'data-msg-error': 'timesheet.stop.error', 'data-msg-success': 'timesheet.stop.success'}}}) %}
{% endif %}
{% if timesheet.end and is_granted('start', timesheet) %}
@@ -270,7 +270,7 @@
{% if timesheet.id is not empty %}
{% if not timesheet.end and is_granted('stop', timesheet) %}
{% set actions = actions|merge({'stop': path('admin_timesheet_stop', {'id' : timesheet.id})}) %}
{% set actions = actions|merge({'stop': {'url': path('stop_timesheet', {'id' : timesheet.id}), 'class': 'api-link', 'attr': {'data-event': 'kimai.timesheetStop kimai.timesheetUpdate', 'data-method': 'PATCH', 'data-msg-error': 'timesheet.stop.error', 'data-msg-success': 'timesheet.stop.success'}}}) %}
{% endif %}
{% if timesheet.end and is_granted('start', timesheet) %}

View File

@@ -70,14 +70,14 @@
{% endspaceless %}
{% endmacro %}
{% macro data_table_header(name, columns, skipStripped) %}
{% macro data_table_header(name, columns, skipStripped, reloadEvent) %}
{% import _self as macro %}
<div class="box data_table" id="datatable_{{ name }}">
<div class="box-body no-padding">
<div class="dataTables_wrapper form-inline dt-bootstrap">
<div class="row">
<div class="col-sm-12">
<table class="table {% if not skipStripped %}table-striped {% endif %}table-hover dataTable" role="grid">
<table class="table {% if not skipStripped %}table-striped {% endif %}table-hover dataTable" role="grid" data-reload-event="{{ reloadEvent }}">
<thead>
<tr>
{%- for title, class in columns -%}
@@ -96,7 +96,7 @@
</div>
</div>
</div>
{% if route is not empty %}
{% if route is not empty and columns is not null%}
<div class="navigation text-center no-print">
{{ pagerfanta(columns, 'twitter_bootstrap3_translated', { proximity: 1, routeName: route }) }}
</div>

View File

@@ -120,7 +120,7 @@
{% endmacro %}
{% macro info_box_progress(title, description, amount, percentage, icon, color) %}
<div class="info-box bg-{{ color|default(kimai_context.box_color) }}">
<div class="info-box bg-{{ color }}">
<span class="info-box-icon"><i class="{{ icon|icon(icon) }}"></i></span>
<div class="info-box-content">
@@ -192,6 +192,7 @@
{% set target = null %}
{% set title = null %}
{% set disabled = false %}
{% set attr = {} %}
{% if type is same as (false) %}
{% set class = "" %}
{% elseif type is null %}
@@ -223,6 +224,7 @@
{% set id = values.id ?? null %}
{% set title = values.title ?? null %}
{% set class = class ~ ( values.class | default("")) %}
{% set attr = values.attr ?? {} %}
{% endif %}
{% if disabled is same as (true) %}
@@ -248,6 +250,11 @@
{%- if target is not empty -%}
target="{{ target }}"
{%- endif -%}
{%- if attr is not empty -%}
{%- for name, value in attr -%}
{{ name }}="{{ value }}"
{%- endfor -%}
{%- endif -%}
>{% if title is not null %}{{ title }}{% else %}{{ macro.icon(icon) }}{% endif %}</a>
{% endfilter %}
{% endmacro %}