added hourly and money budgets to activity, project and customer (#843)
This commit is contained in:
48
templates/activity/budget.html.twig
Normal file
48
templates/activity/budget.html.twig
Normal file
@@ -0,0 +1,48 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/actions.html.twig" as actions %}
|
||||
|
||||
{% block page_title %}{{ 'admin_activity.title'|trans }}{% endblock %}
|
||||
{% block page_subtitle %}{{ 'admin_activity.subtitle'|trans }}{% endblock %}
|
||||
{% block page_actions %}{{ actions.activity(activity, 'delete') }}{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
{% set params = {
|
||||
'%activity%': '<strong>' ~ activity.name ~ '</strong>',
|
||||
'%project%': '<strong>-</strong>',
|
||||
'%customer%': '<strong>-</strong>',
|
||||
'%records%': '<strong>' ~ stats.recordAmount ~ '</strong>',
|
||||
'%duration%': '<strong>' ~ stats.recordDuration|duration ~ '</strong>'
|
||||
} %}
|
||||
|
||||
{% if activity.project is not null %}
|
||||
{% set params = params|merge({
|
||||
'%project%': '<strong>' ~ activity.project.name ~ '</strong>',
|
||||
'%customer%': '<strong>' ~ activity.project.customer.name ~ '</strong>',
|
||||
}) %}
|
||||
{% endif %}
|
||||
|
||||
{% embed '@AdminLTE/Widgets/box-widget.html.twig' %}
|
||||
{% import "macros/progressbar.html.twig" as progress %}
|
||||
{% block box_title %}{{ activity.name }}{% endblock %}
|
||||
{% block box_body %}
|
||||
<p>
|
||||
{{ 'admin_activity.short_stats'|trans(params)|raw }}
|
||||
</p>
|
||||
|
||||
{% set currency = null %}
|
||||
{% if activity.project is not null %}
|
||||
{% set currency = activity.project.customer.currency %}
|
||||
{% endif %}
|
||||
|
||||
{% if activity.budget > 0 %}
|
||||
{{ progress.progressbar(activity.budget, stats.recordRate, 'label.budget'|trans, stats.recordRate|money(currency) ~ ' / ' ~ activity.budget|money(currency) ) }}
|
||||
{% endif %}
|
||||
|
||||
{% if activity.timeBudget > 0 %}
|
||||
{{ progress.progressbar(activity.timeBudget, stats.recordDuration, 'label.timeBudget'|trans, stats.recordDuration|duration ~ ' / ' ~ activity.timeBudget|duration ) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -24,8 +24,10 @@
|
||||
}) %}
|
||||
{% endif %}
|
||||
|
||||
{% set message = '<p>' ~ ("admin_activity.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_activity.delete_confirm"|trans(params)|raw,
|
||||
'message': message|raw,
|
||||
'form': form,
|
||||
'used': inUse,
|
||||
'back': path('admin_activity')
|
||||
|
||||
Reference in New Issue
Block a user