0
0
Fork 0
mirror of https://github.com/kevinpapst/kimai2.git synced 2025-03-29 19:11:32 +00:00

allow to customize modal size, form attributes and submit buttons

This commit is contained in:
Kevin Papst 2021-08-24 15:36:35 +02:00
parent beab7748fa
commit b91f21e079
3 changed files with 10 additions and 6 deletions

View file

@ -5,7 +5,7 @@
{% set _reset = reset is defined and reset is same as (false) ? false : true %}
<div class="box box-primary">
{% block form_before %}{% endblock %}
{{ form_start(form) }}
{{ form_start(form, formStartOptions|default({})) }}
<div class="box-header with-border">
<h3 class="box-title">
{{ title }}
@ -20,7 +20,9 @@
{% endblock %}
</div>
<div class="box-footer">
<input type="submit" value="{{ 'action.save'|trans }}" class="btn btn-primary" />
{% block submit_button %}
<input type="submit" data-loading-text="{{ (submit_button|default('action.save'))|trans }}…" value="{{ (submit_button|default('action.save'))|trans }}" class="btn btn-primary" />
{% endblock %}
{% if _back is not same as (false) %}
<a href="{{ _back }}" class="btn btn-link">{{ 'action.back'|trans }}</a>
{% endif %}

View file

@ -4,10 +4,10 @@ REQUIRED CHANGES NEED TO BE DONE IN THESE FILES:
- default/_form_modal.html.twig
#}
<div class="modal {% block modal_class %}{% endblock %}" id="{% block modal_id %}form_modal{% endblock %}" tabindex="-1" role="dialog" aria-labelledby="{{ block('modal_id') }}_label">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-dialog {% block modal_size %}modal-lg{% endblock %}" role="document">
<div class="modal-content">
{% block form_before %}{% endblock %}
{% block modal_before %}{{ form_start(form) }}{% endblock %}
{% block modal_before %}{{ form_start(form, formStartOptions|default({})) }}{% endblock %}
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="{{ 'action.close'|trans }}"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="{{ block('modal_id') }}_label">
@ -28,7 +28,9 @@ REQUIRED CHANGES NEED TO BE DONE IN THESE FILES:
</div>
<div class="modal-footer">
{% block modal_footer %}
<button type="submit" class="btn btn-primary pull-left modal-form-save" data-loading-text="{{ 'action.save'|trans }}..." id="{{ block('modal_id') }}_save">{{ 'action.save'|trans }}</button>
{% block submit_button %}
<button type="submit" class="btn btn-primary pull-left modal-form-save" data-loading-text="{{ (submit_button|default('action.save'))|trans }}…" id="{{ block('modal_id') }}_save">{{ (submit_button|default('action.save'))|trans }}</button>
{% endblock %}
<button type="button" class="btn btn-default btn-cancel" data-dismiss="modal">{{ 'action.close'|trans }}</button>
{% endblock %}
</div>

View file

@ -4,7 +4,7 @@ REQUIRED CHANGES NEED TO BE DONE IN THESE FILES:
- default/_form_modal.html.twig
#}
<div class="modal{% if block('modal_class') is defined %} {{ block('modal_class') }}{% endif %}" id="{{ block('modal_id') }}" tabindex="-1" role="dialog" aria-labelledby="{{ block('modal_id') }}_label">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-dialog {% block modal_size %}modal-lg{% endblock %}" role="document">
<div class="modal-content">
{% if block('modal_before') is defined %}{{ block('modal_before') }}{% endif %}
<div class="modal-header">