From 448c2e37d16136f96841d97a77b4713e02711dd4 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Fri, 22 May 2015 22:37:41 +0200 Subject: [PATCH] templating --- .../views/default.html.twig | 34 +++-- .../views/Default/category.html.twig | 7 + .../Resources/views/Default/post.html.twig | 3 + .../Resources/views/Default/tag.html.twig | 7 + .../Resources/views/Default/contact.html.twig | 124 +++++++++--------- .../views/Default/lesson_page.html.twig | 24 +++- 6 files changed, 118 insertions(+), 81 deletions(-) diff --git a/app/Resources/TrinityContentManagerBundle/views/default.html.twig b/app/Resources/TrinityContentManagerBundle/views/default.html.twig index 0cf9402..3df5880 100644 --- a/app/Resources/TrinityContentManagerBundle/views/default.html.twig +++ b/app/Resources/TrinityContentManagerBundle/views/default.html.twig @@ -1,21 +1,27 @@ {% extends "::base.html.twig" %} {% block breadcrumb %} -
  • Accueil
  • -
  • »
  • -
  • {{ render_block('title') }}
  • +
  • Accueil
  • +
  • »
  • +
  • {{ render_block('title') }}
  • +{% endblock %} + +{% block header_title %} + {{ render_block('title') }} +{% endblock %} + +{% block header_subtitle %} +

    {{ render_block('subtitle') }}

    {% endblock %} {% block body %} -
    -
    -

    {{ render_block('title') }}

    - - {% if render_block('subtitle') %} -

    {{ render_block('subtitle') }}

    - {% endif %} -
    -
    - -
    {{ render_block('content1')|post }}
    +
    +
    +
    +
    + {{ render_block('content1')|post }} +
    +
    +
    +
    {% endblock %} diff --git a/src/Deblan/Bundle/BlogBundle/Resources/views/Default/category.html.twig b/src/Deblan/Bundle/BlogBundle/Resources/views/Default/category.html.twig index f195410..288b8f3 100644 --- a/src/Deblan/Bundle/BlogBundle/Resources/views/Default/category.html.twig +++ b/src/Deblan/Bundle/BlogBundle/Resources/views/Default/category.html.twig @@ -11,6 +11,13 @@ {% endif %} {% endblock %} +{% block header_title %} + {{ page.object }} +{% endblock %} + +{% block header_subtitle %} +{% endblock %} + {% block body %} {% if page.pager.nbResults == 0 %}
    Aucun article disponible.
    diff --git a/src/Deblan/Bundle/BlogBundle/Resources/views/Default/post.html.twig b/src/Deblan/Bundle/BlogBundle/Resources/views/Default/post.html.twig index c8f0fc6..67414aa 100644 --- a/src/Deblan/Bundle/BlogBundle/Resources/views/Default/post.html.twig +++ b/src/Deblan/Bundle/BlogBundle/Resources/views/Default/post.html.twig @@ -10,6 +10,9 @@ {{ page.object.title }} {% endblock %} +{% block header_subtitle %} +{% endblock %} + {% block body %} {% set post = page.object %} diff --git a/src/Deblan/Bundle/BlogBundle/Resources/views/Default/tag.html.twig b/src/Deblan/Bundle/BlogBundle/Resources/views/Default/tag.html.twig index 95a4619..00a29ec 100644 --- a/src/Deblan/Bundle/BlogBundle/Resources/views/Default/tag.html.twig +++ b/src/Deblan/Bundle/BlogBundle/Resources/views/Default/tag.html.twig @@ -11,6 +11,13 @@ {% endif %} {% endblock %} +{% block header_title %} + #{{ page.object }} +{% endblock %} + +{% block header_subtitle %} +{% endblock %} + {% block body %} {% if page.pager.nbResults == 0 %}
    Aucun article disponible.
    diff --git a/src/Deblan/Bundle/ContactBundle/Resources/views/Default/contact.html.twig b/src/Deblan/Bundle/ContactBundle/Resources/views/Default/contact.html.twig index 3824e9f..78aa93b 100644 --- a/src/Deblan/Bundle/ContactBundle/Resources/views/Default/contact.html.twig +++ b/src/Deblan/Bundle/ContactBundle/Resources/views/Default/contact.html.twig @@ -1,72 +1,76 @@ {% extends "::base.html.twig" %} {% block breadcrumb %} -
  • Accueil
  • -
  • »
  • -
  • Contact
  • +
  • Accueil
  • +
  • »
  • +
  • Contact
  • {% endblock %} +{% block header_title %} + {{ render_block('title') }} +{% endblock %} + +{% block header_subtitle %}{% endblock %} + {% block body %} -
    -
    -
    -
    -

    {{ render_block('title') }}

    +
    +
    +
    +
    + {{ render_block('content1') }} + +
    +
    + +
    +
    +
    + - {{ render_block('content1') }} - -
    -
    - -
    - -
    - +
    + {{ form_widget(form.name) }} + {{ form_errors(form.name) }} +
    +
    + +
    + -
    - {{ form_widget(form.name) }} - {{ form_errors(form.name) }} -
    -
    - -
    - +
    + {{ form_widget(form.email) }} + {{ form_errors(form.email) }} +
    +
    + +
    + -
    - {{ form_widget(form.email) }} - {{ form_errors(form.email) }} -
    -
    - -
    - +
    + {{ form_widget(form.subject) }} + {{ form_errors(form.subject) }} +
    +
    + +
    + -
    - {{ form_widget(form.subject) }} - {{ form_errors(form.subject) }} -
    -
    - -
    - +
    + {{ form_widget(form.message) }} + {{ form_errors(form.message) }} +
    +
    + +
    + +
    + +
    +
    -
    - {{ form_widget(form.message) }} - {{ form_errors(form.message) }} -
    -
    - -
    - -
    - -
    -
    - - {{ form_rest(form) }} -
    -
    -
    -
    -
    + {{ form_rest(form) }} + +
    +
    +
    +
    {% endblock %} diff --git a/src/Deblan/Bundle/LessonBundle/Resources/views/Default/lesson_page.html.twig b/src/Deblan/Bundle/LessonBundle/Resources/views/Default/lesson_page.html.twig index 8a7ad3d..61f3776 100644 --- a/src/Deblan/Bundle/LessonBundle/Resources/views/Default/lesson_page.html.twig +++ b/src/Deblan/Bundle/LessonBundle/Resources/views/Default/lesson_page.html.twig @@ -6,14 +6,24 @@
  • {{ render_block('title') }}
  • {% endblock %} +{% block header_title %} + {{ render_block('title') }} +{% endblock %} + +{% block header_subtitle %} +

    {{ render_block('subtitle') }}

    +{% endblock %} + {% block body %} -
    -
    -

    {{ render_block('title') }}

    -
    -
    - -
    {{ render_block('content1')|transform_url }}
    +
    +
    +
    +
    + {{ render_block('content1')|post }} +
    +
    +
    +
    {% endblock %} {% import _self as macros %}