From e7e73602a00532f757ba50e8e6928ef5eeff7987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 7 Jun 2020 19:58:05 +0200 Subject: [PATCH] Improved title for admin pages. --- .../AdminPages/EntityAdminBase.html.twig | 360 +++++++++--------- 1 file changed, 184 insertions(+), 176 deletions(-) diff --git a/templates/AdminPages/EntityAdminBase.html.twig b/templates/AdminPages/EntityAdminBase.html.twig index b191de35..21654f2c 100644 --- a/templates/AdminPages/EntityAdminBase.html.twig +++ b/templates/AdminPages/EntityAdminBase.html.twig @@ -1,197 +1,205 @@ {% extends "main_card.html.twig" %} -{% block card_type %} - {% if timeTravel is defined and timeTravel is not null %} - bg-primary-striped text-white - {% else %} - bg-primary text-white - {% endif %} -{% endblock %} + {% block title %} + {% if entity.id is null %} + {{ block("new_title") }} + {% else %} + {{ block("edit_title") }} + {% endif %} + {% endblock %} -{% form_theme form.log_comment 'bootstrap_4_layout.html.twig' %} + {% block card_type %} + {% if timeTravel is defined and timeTravel is not null %} + bg-primary-striped text-white + {% else %} + bg-primary text-white + {% endif %} + {% endblock %} -{% block card_content %} -
-
+ {% form_theme form.log_comment 'bootstrap_4_layout.html.twig' %} -
-
- + {% block card_content %} +
+
+ +
+
+ +
+
+ + +
-
- - -
-
-
+
+ +
-
+
-
- -
- - {% if entity.ID %} - {% block edit_title %}{% trans with {'%name': entity.name} %}edit.caption{% endtrans %}{% endblock %} - {% if timeTravel is defined and timeTravel is not null %} - ({{ timeTravel|format_datetime('short') }}) +
+ + {% if entity.ID %} + {% block edit_title %}{% trans with {'%name': entity.name} %}edit.caption{% endtrans %}{% endblock %} + {% if timeTravel is defined and timeTravel is not null %} + ({{ timeTravel|format_datetime('short') }}) + {% endif %} + {% block quick_links %}{% endblock %} + {% else %} + {% block new_title %}{% trans %}new.caption{% endtrans %}{% endblock %} {% endif %} - {% block quick_links %}{% endblock %} - {% else %} - {% block new_title %}{% trans %}new.caption{% endtrans %}{% endblock %} + + {% if timeTravel is defined and timeTravel is not null %} + {% trans with {'%timestamp%': timeTravel|format_datetime('short')} %}part.info.timetravel_hint{% endtrans %} {% endif %} - - {% if timeTravel is defined and timeTravel is not null %} - {% trans with {'%timestamp%': timeTravel|format_datetime('short')} %}part.info.timetravel_hint{% endtrans %} - {% endif %} - {{ form_errors(form) }} + {{ form_errors(form) }} - - -
- -
- - {{ form_start(form) }} - - - - - -
-
- {{ form_row(form.name) }} - {% if form.parent%} - {{ form_row(form.parent) }} - {% endif %} - {% if form.not_selectable is defined %} - {{ form_row(form.not_selectable) }} - {% endif %} - - {% block additional_controls %}{% endblock %} - - {% block comment %} - {{ form_row(form.comment) }} - {% endblock %} - -
- {% block additional_panes %}{% endblock %} - -
- {% include "AdminPages/_attachments.html.twig" %} - {% block master_picture_block %} - {{ form_row(form.master_picture_attachment) }} - {% endblock %} -
- - {% if entity.parameters is defined %} -
- {% include "AdminPages/_parameters.html.twig" %} -
- {% endif %} -
- -
-
-
- {{ form_widget(form.save) }} - - -
- -
-
- - {{ form_row(form.reset) }} - {{ form_end(form) }} - - - {# Only include on existing parts #} + + +
+ +
+ + {{ form_start(form) }} + + + + + +
+
+ {{ form_row(form.name) }} + {% if form.parent%} + {{ form_row(form.parent) }} + {% endif %} + {% if form.not_selectable is defined %} + {{ form_row(form.not_selectable) }} + {% endif %} + + {% block additional_controls %}{% endblock %} + + {% block comment %} + {{ form_row(form.comment) }} + {% endblock %} + +
+ {% block additional_panes %}{% endblock %} + +
+ {% include "AdminPages/_attachments.html.twig" %} + {% block master_picture_block %} + {{ form_row(form.master_picture_attachment) }} + {% endblock %} +
+ + {% if entity.parameters is defined %} +
+ {% include "AdminPages/_parameters.html.twig" %} +
+ {% endif %} +
+ +
+
+
+ {{ form_widget(form.save) }} + + +
+ +
+
+ + {{ form_row(form.reset) }} + {{ form_end(form) }} + + + {# Only include on existing parts #} + {% if entity.id %} + {{ include('AdminPages/_duplicate.html.twig') }} + {{ include('AdminPages/_delete_form.html.twig') }} + {% endif %} + +
+ +
+ {% include "AdminPages/_info.html.twig" %} +
+ + {% if datatable is defined and datatable is not null %} +
+ {% include "LogSystem/_log_table.html.twig" %} +
{% endif %} + {% if entity.id %} +
+ {% include 'AdminPages/_export_form.html.twig' with {'path' : path(route_base ~ '_export', {'id': entity.id})} %} +
+ {% else %} {# For new element we have a combined import/export tab #} +
+ + {{ form_start(import_form) }} + + {{ form_end(import_form) }} + +
+
+ {% trans %}export_all.label{% endtrans %} + {% include 'AdminPages/_export_form.html.twig' with {'path' : path('attachment_type_export_all')} %} +
+
+ +
+ {% trans %}mass_creation.help{% endtrans %} + {{ form(mass_creation_form) }} +
+ + + {% endif %}
+
+
-
- {% include "AdminPages/_info.html.twig" %} -
- - {% if datatable is defined and datatable is not null %} -
- {% include "LogSystem/_log_table.html.twig" %} -
- {% endif %} - - {% if entity.id %} -
- {% include 'AdminPages/_export_form.html.twig' with {'path' : path(route_base ~ '_export', {'id': entity.id})} %} -
- {% else %} {# For new element we have a combined import/export tab #} -
- - {{ form_start(import_form) }} - - {{ form_end(import_form) }} - -
-
- {% trans %}export_all.label{% endtrans %} - {% include 'AdminPages/_export_form.html.twig' with {'path' : path('attachment_type_export_all')} %} -
-
- -
- {% trans %}mass_creation.help{% endtrans %} - {{ form(mass_creation_form) }} -
- - - {% endif %} -
-
- -
-{% endblock %} \ No newline at end of file + {% endblock %} \ No newline at end of file