1.18 (#3158)
* bump version * fix translation ids * added css classes to modify form with custom css * improve export pdf file names * respect financial year in new report * added new InvoiceCalculator: price * upgrade packages and node-sass to v7 * title pattern for customer, project and activity via API * support negative money without currency * fix sub-locale in print export template * fix overbooking validation for monthly budget * fix copying entities with different set of custom-fields compared to the current configuration
This commit is contained in:
31
templates/macros/webloader.html.twig
Normal file
31
templates/macros/webloader.html.twig
Normal file
@@ -0,0 +1,31 @@
|
||||
{% macro init_frontend_loader() %}
|
||||
{% set configurations = javascript_configurations(app.user)|merge({
|
||||
login: path('fos_user_security_login'),
|
||||
locale: app.request.locale,
|
||||
first_dow_iso: iso_day_by_name(app.user.firstDayOfWeek),
|
||||
autoComplete: kimai_config.themeAutocompleteCharacters,
|
||||
}) %}
|
||||
<script type="text/javascript">
|
||||
window.addEventListener('load', function() {
|
||||
const loader = new KimaiWebLoader({
|
||||
{%- for name, value in configurations -%}
|
||||
{%- if value is same as (true) -%}
|
||||
{{ name }}:true
|
||||
{%- elseif value is same as (false) -%}
|
||||
{{ name }}:false
|
||||
{%- elseif value is number -%}
|
||||
{{ name }}:{{ value }}
|
||||
{%- else -%}
|
||||
{{ name }}:'{{ value }}'
|
||||
{%- endif -%}
|
||||
{%- if not loop.last %},{% endif -%}
|
||||
{%- endfor -%}
|
||||
},{
|
||||
{%- for key, translation in javascript_translations() -%}
|
||||
'{{ key }}': '{{ translation.0|trans({}, translation.1)|escape('js') }}'{% if not loop.last %},{% endif %}
|
||||
{%- endfor -%}
|
||||
});
|
||||
window.kimai = loader.getKimai();
|
||||
});
|
||||
</script>
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user