From 6fdb7d38ea6fae48333958e6995d750928338bf7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Sun, 25 Feb 2018 06:25:41 +0100 Subject: [PATCH] Review layout for easier styling Add link to alternative page Add specific templates --- Resources/views/article/index.html.twig | 29 ++++++++++ Resources/views/article/read.html.twig | 37 +++++++++++++ Resources/views/body.html.twig | 71 +++++++++++++------------ Resources/views/keyword/index.html.twig | 28 ++++++++++ Resources/views/keyword/read.html.twig | 39 ++++++++++++++ Resources/views/mail/contact.html.twig | 46 ++++++++++++++++ Resources/views/page/about.html.twig | 4 ++ Resources/views/page/contact.html.twig | 41 ++++++++++++++ 8 files changed, 262 insertions(+), 33 deletions(-) create mode 100644 Resources/views/article/index.html.twig create mode 100644 Resources/views/article/read.html.twig create mode 100644 Resources/views/keyword/index.html.twig create mode 100644 Resources/views/keyword/read.html.twig create mode 100644 Resources/views/mail/contact.html.twig create mode 100644 Resources/views/page/about.html.twig create mode 100644 Resources/views/page/contact.html.twig diff --git a/Resources/views/article/index.html.twig b/Resources/views/article/index.html.twig new file mode 100644 index 0000000..817a4e0 --- /dev/null +++ b/Resources/views/article/index.html.twig @@ -0,0 +1,29 @@ +{% extends 'RapsysBlogBundle::body.html.twig' %} +{% block blog_title %}

{% trans %}Dev log{% endtrans %}

{% endblock %} +{% block content %} +
+

{% trans %}Articles list{% endtrans %}

+ {% for article in articles %} +
+
+

{{article.title}}

+

+ {% trans with {'%date%': article.created|localizeddate('full', 'short')} %}Published the %date%{% endtrans %}{% if article.created != article.updated %}{% trans with {'%date%': article.updated|localizeddate('short', 'short')} %}, edited the %date%{% endtrans %}{% endif %} + {% if article.keywords %} + + {% transchoice article.keywords|length %}{1} Keyword:|]1,Inf[ Keywords:{% endtranschoice %} + {% for slug, keyword in article.keywords %} + {{ keyword }} + {% endfor %} + + {% endif %} +

+
+

{{article.description}}

+ +
+ {% endfor %} +
+{% endblock %} diff --git a/Resources/views/article/read.html.twig b/Resources/views/article/read.html.twig new file mode 100644 index 0000000..329ae40 --- /dev/null +++ b/Resources/views/article/read.html.twig @@ -0,0 +1,37 @@ +{% extends 'RapsysBlogBundle::body.html.twig' %} +{% block blog_title %}

{% trans %}Dev log{% endtrans %}

{% endblock %} +{% block blog_subtitle %}

{% trans %}Articles list{% endtrans %}

{% endblock %} +{% block content %} + {% if article is defined and article %} +
+
+

{{article.title}}

+

+ {% trans with {'%date%': article.created|localizeddate('full', 'short')} %}Published the %date%{% endtrans %}{% if article.created != article.updated %}{% trans with {'%date%': article.updated|localizeddate('short', 'short')} %}, edited the %date%{% endtrans %}{% endif %} + {% if article.keywords %} + + {% transchoice article.keywords|length %}{1} Keyword:|]1,Inf[ Keywords:{% endtranschoice %} + {% for keyword_id, keyword in article.keywords %} + {{ keyword }} + {% endfor %} + + {% endif %} +

+
+

{{article.body|bb2html}}

+
+ {% endif %} +{% endblock %} +{% block alternate %} + + {% for locale, slug in article.slugs %} + + {% endfor %} +{% endblock %} +{% block footer_nav %} + +{% endblock %} diff --git a/Resources/views/body.html.twig b/Resources/views/body.html.twig index 0fd4304..6535e78 100644 --- a/Resources/views/body.html.twig +++ b/Resources/views/body.html.twig @@ -1,42 +1,47 @@ {% extends 'RapsysBlogBundle::base.html.twig' %} {% block body %} -
- {% block header %} - - {% endblock %} - - {% block sidebar %}{% endblock %} + {% block sidebar %}{% endblock %} - {% block content %}
{% endblock %} + {% block content %}
{% endblock %} - {% block footer %} -
- Copyright 2016 - Raphaël Gertz all rights reserved. -
- {% endblock %} -
+ {% block footer %} + + {% endblock %} {% endblock %} diff --git a/Resources/views/keyword/index.html.twig b/Resources/views/keyword/index.html.twig new file mode 100644 index 0000000..9860b9c --- /dev/null +++ b/Resources/views/keyword/index.html.twig @@ -0,0 +1,28 @@ +{% extends 'RapsysBlogBundle::body.html.twig' %} +{% block blog_title %}

{% trans %}Dev log{% endtrans %}

{% endblock %} +{% block content %} +
+

{% trans %}Keywords list{% endtrans %}

+ {% for keyword in keywords %} +
+
+

{{keyword.title}}

+

+ {% trans with {'%date%': keyword.created|localizeddate('full', 'short')} %}Published the %date%{% endtrans %}{% if keyword.created != keyword.updated %}{% trans with {'%date%': keyword.updated|localizeddate('short', 'short')} %}, edited the %date%{% endtrans %}{% endif %} +

+
+ {% if keyword.articles %} +

{% transchoice keyword.articles|length %}{1} Article:|]1,Inf[ Articles:{% endtranschoice %}

+
    + {% for slug, article in keyword.articles %} +
  • {{ article }}
  • + {% endfor %} +
+ {% endif %} + +
+ {% endfor %} +
+{% endblock %} diff --git a/Resources/views/keyword/read.html.twig b/Resources/views/keyword/read.html.twig new file mode 100644 index 0000000..24d3601 --- /dev/null +++ b/Resources/views/keyword/read.html.twig @@ -0,0 +1,39 @@ +{% extends 'RapsysBlogBundle::body.html.twig' %} +{% block blog_title %}

{% trans %}Dev log{% endtrans %}

{% endblock %} +{% block blog_subtitle %}

{% trans %}Keywords list{% endtrans %}

{% endblock %} +{% block content %} + {% if keyword is defined and keyword %} +
+
+

{{keyword.title}}

+

+ {% trans with {'%date%': keyword.created|localizeddate('full', 'short')} %}Published the %date%{% endtrans %}{% if keyword.created != keyword.updated %}{% trans with {'%date%': keyword.updated|localizeddate('short', 'short')} %}, edited the %date%{% endtrans %}{% endif %} +

+
+

{{ keyword.description }}

+ {% if keyword.articles %} +

{% transchoice keyword.articles|length %}{1} Article:|]1,Inf[ Articles:{% endtranschoice %}

+ + {% endif %} +
+ {% endif %} +{% endblock %} +{% block alternate %} + + {% for locale, slug in keyword.slugs %} + + {% endfor %} +{% endblock %} +{% block footer_nav %} + +{% endblock %} diff --git a/Resources/views/mail/contact.html.twig b/Resources/views/mail/contact.html.twig new file mode 100644 index 0000000..dbbf5fe --- /dev/null +++ b/Resources/views/mail/contact.html.twig @@ -0,0 +1,46 @@ + + + + + + {{ subject }} + + + + + + + + +
{{ blog_title }}

{{ blog_title }}

+ + + + + + +
  +

{% trans %}Hi,{% endtrans %} {{ contact_name }}

+

{% trans %}Subject:{% endtrans %} {{ subject }}

+

{{ message|nl2br }}

+
 
+ + + + + + + + + diff --git a/Resources/views/page/about.html.twig b/Resources/views/page/about.html.twig new file mode 100644 index 0000000..fde1616 --- /dev/null +++ b/Resources/views/page/about.html.twig @@ -0,0 +1,4 @@ +{% extends 'RapsysBlogBundle::body.html.twig' %} +{% block blog_title %}

{% trans %}Dev log{% endtrans %}

{% endblock %} +{% block blog_subtitle %}

{% trans %}About{% endtrans %}

{% endblock %} +{% block content %}TODO: dernière page à faire avant la page cv et peut-être un peu de sémantique pour google & facebook :){% endblock %} diff --git a/Resources/views/page/contact.html.twig b/Resources/views/page/contact.html.twig new file mode 100644 index 0000000..e98ef66 --- /dev/null +++ b/Resources/views/page/contact.html.twig @@ -0,0 +1,41 @@ +{% extends 'RapsysBlogBundle::body.html.twig' %} +{% block blog_title %}

{% trans %}Dev log{% endtrans %}

{% endblock %} +{% block blog_subtitle %}

{% trans %}Contact{% endtrans %}

{% endblock %} +{% block content %} +
+
+

{% trans %}Contact{% endtrans %}

+
+ {% if sent %} +

{% trans %}Your message has been sent{% endtrans %}

+ {% else %} +
+ {{ form_start(form) }} + {# Render CSRF token etc .#} +
+ {{ form_widget(form.subject) }} + {{ form_errors(form.subject) }} +
+
+ {{ form_widget(form.name) }} + {{ form_errors(form.name) }} +
+
+ {{ form_widget(form.email) }} + {{ form_errors(form.email) }} +
+
+ {{ form_widget(form.message) }} + {{ form_errors(form.message) }} +
+ + {{ form_row(form.submit) }} + +
+ {{ form_rest(form) }} +
+ {{ form_end(form) }} +
+ {% endif %} +
+{% endblock %} -- 2.41.1