From f8138fb361e63eaeffa81b901780f26426cad9bf Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Fri, 14 Sep 2018 16:31:25 +0200 Subject: [PATCH] Optimized templates --- application/templates/source/content/name.html.twig | 1 + application/templates/source/content/user.html.twig | 1 + application/templates/source/name.html.twig | 5 +++-- application/templates/source/source.html.twig | 7 +++++++ application/templates/source/user.html.twig | 5 +++++ 5 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 application/templates/source/content/name.html.twig create mode 100644 application/templates/source/content/user.html.twig create mode 100644 application/templates/source/source.html.twig create mode 100644 application/templates/source/user.html.twig diff --git a/application/templates/source/content/name.html.twig b/application/templates/source/content/name.html.twig new file mode 100644 index 0000000..11a44c6 --- /dev/null +++ b/application/templates/source/content/name.html.twig @@ -0,0 +1 @@ +{{ source.name }} \ No newline at end of file diff --git a/application/templates/source/content/user.html.twig b/application/templates/source/content/user.html.twig new file mode 100644 index 0000000..4dcc15d --- /dev/null +++ b/application/templates/source/content/user.html.twig @@ -0,0 +1 @@ +{% include "source/content/name." ~ app.request.requestFormat ~ ".twig" with {'source':source.userSource}%} \ No newline at end of file diff --git a/application/templates/source/name.html.twig b/application/templates/source/name.html.twig index b80d06f..775f636 100644 --- a/application/templates/source/name.html.twig +++ b/application/templates/source/name.html.twig @@ -1,4 +1,5 @@ -{% extends "frames/default.html.twig" %} +{% extends "source/source.html.twig" %} {% block content %} -{{ source.name }} +

{% trans %} Name {% endtrans %}

+{% include "source/content/name." ~ app.request.requestFormat ~ ".twig" %} {% endblock %} diff --git a/application/templates/source/source.html.twig b/application/templates/source/source.html.twig new file mode 100644 index 0000000..8586f6d --- /dev/null +++ b/application/templates/source/source.html.twig @@ -0,0 +1,7 @@ +{% extends "frames/default.html.twig" %} +{% block title %} + {% trans %} + Source + {% endtrans %} + #{{ source.id }} +{% endblock %} \ No newline at end of file diff --git a/application/templates/source/user.html.twig b/application/templates/source/user.html.twig new file mode 100644 index 0000000..2998bab --- /dev/null +++ b/application/templates/source/user.html.twig @@ -0,0 +1,5 @@ +{% extends "source/source.html.twig" %} +{% block content %} +

{% trans %} User {% endtrans %}

+{% include "source/content/user." ~ app.request.requestFormat ~ ".twig" %} +{% endblock %} \ No newline at end of file