added hourly and money budgets to activity, project and customer (#843)

This commit is contained in:
Kevin Papst
2019-06-11 13:18:57 +02:00
committed by GitHub
parent 833968a87d
commit 5702d7afa8
118 changed files with 1743 additions and 1077 deletions

View File

@@ -0,0 +1,37 @@
{% extends 'base.html.twig' %}
{% import "macros/actions.html.twig" as actions %}
{% block page_title %}{{ 'admin_customer.title'|trans }}{% endblock %}
{% block page_subtitle %}{{ 'admin_customer.subtitle'|trans }}{% endblock %}
{% block page_actions %}{{ actions.customer(customer, 'delete') }}{% endblock %}
{% block main %}
{% set params = {
'%activity%': '<strong>' ~ stats.activityAmount ~ '</strong>',
'%project%': '<strong>' ~ stats.projectAmount ~ '</strong>',
'%customer%': '<strong>' ~ customer.name ~ '</strong>',
'%records%': '<strong>' ~ stats.recordAmount ~ '</strong>',
'%duration%': '<strong>' ~ stats.recordDuration|duration ~ '</strong>',
'%rate%': '<strong>' ~ stats.recordRate|money ~ '</strong>'
} %}
{% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
{% import "macros/progressbar.html.twig" as progress %}
{% block box_title %}{{ customer.name }}{% endblock %}
{% block box_body %}
<p>
{{ 'admin_customer.short_stats'|trans(params)|raw }}
</p>
{% if customer.budget > 0 %}
{{ progress.progressbar(customer.budget, stats.recordRate, 'label.budget'|trans, stats.recordRate|money(customer.currency) ~ ' / ' ~ customer.budget|money(customer.currency) ) }}
{% endif %}
{% if customer.timeBudget > 0 %}
{{ progress.progressbar(customer.timeBudget, stats.recordDuration, 'label.timeBudget'|trans, stats.recordDuration|duration ~ ' / ' ~ customer.timeBudget|duration ) }}
{% endif %}
{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -17,8 +17,10 @@
'%duration%': '<strong>' ~ stats.recordDuration|duration ~ '</strong>'
} %}
{% set message = '<p>' ~ ("admin_customer.short_stats"|trans(params)|raw) ~ '</p><p>' ~ ("admin_entity.delete_confirm"|trans|raw) ~ '</p>' %}
{{ include(app.request.xmlHttpRequest ? 'default/_form_delete_modal.html.twig' : 'default/_form_delete.html.twig', {
'message': "admin_customer.delete_confirm"|trans(params)|raw,
'message': message|raw,
'form': form,
'used': inUse,
'back': path('admin_customer')

View File

@@ -9,7 +9,6 @@
'comment': 'hidden-xs',
'country': 'hidden-xs',
'number': 'hidden-xs',
'currency': 'hidden-xs',
'visible': 'hidden-xs',
'actions': 'actions alwaysVisible',
} %}
@@ -38,7 +37,6 @@
<td class="{{ tables.data_table_column_class(tableName, columns, 'comment') }}">{{ entry.comment|comment2html }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'country') }}">{{ entry.country|country }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'number') }}">{{ entry.number }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'currency') }}">{{ entry.currency }} {{ entry.currency|currency }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'visible') }}">{{ widgets.label_visible(entry.visible) }}</td>
<td class="actions">
{{ actions.customer(entry, 'index') }}