mirror of
https://github.com/kevinpapst/kimai2.git
synced 2024-12-22 12:18:29 +00:00
15 lines
663 B
Twig
15 lines
663 B
Twig
{% macro init_frontend_loader() %}
|
|
{% set fdow = app.user is not null ? app.user.firstDayOfWeek : 'monday' %}
|
|
{% set configurations = javascript_configurations(app.user, app.request.locale)|merge({
|
|
login: path('login'),
|
|
direction: tabler_bundle.rightToLeft ? 'rtl' : 'ltr',
|
|
first_dow_iso: iso_day_by_name(fdow),
|
|
}) %}
|
|
<script type="text/javascript">
|
|
window.addEventListener('load', function() {
|
|
const loader = new KimaiWebLoader({{ configurations|json_encode|raw }},{{ javascript_translations()|json_encode|raw }});
|
|
window.kimai = loader.getKimai();
|
|
});
|
|
</script>
|
|
{% endmacro %}
|