From 3137b854fa974d0ca3f174a5a27fb1af2abf3eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 13 Jan 2014 22:15:28 +0100 Subject: [PATCH] [change] refactor templates for entries --- app/views/archive.twig | 25 ++----------------------- app/views/bookmarks.twig | 16 ++++++++++++++++ app/views/entry.twig | 10 ++++++++++ app/views/index.twig | 25 ++----------------------- app/views/layout.twig | 4 ++-- app/views/menu.twig | 11 +++++++++++ 6 files changed, 43 insertions(+), 48 deletions(-) create mode 100644 app/views/bookmarks.twig create mode 100644 app/views/entry.twig create mode 100644 app/views/menu.twig diff --git a/app/views/archive.twig b/app/views/archive.twig index 472025f..df00d98 100644 --- a/app/views/archive.twig +++ b/app/views/archive.twig @@ -1,17 +1,5 @@ {% extends layout %} - -{% block menu %} -{% set count = entries|length %} - - -{% endblock %} +{% block title %}archive{% endblock %} {% block content %} {% if entries is empty %} @@ -19,16 +7,7 @@ {% else %} diff --git a/app/views/bookmarks.twig b/app/views/bookmarks.twig new file mode 100644 index 0000000..1fc12e2 --- /dev/null +++ b/app/views/bookmarks.twig @@ -0,0 +1,16 @@ +{% extends layout %} +{% block title %}bookmarks{% endblock %} + +{% block content %} +{% if entries is empty %} +

{{ 'No link available here!'|trans }}

+{% else %} + + +{% endif %} + +{% endblock %} diff --git a/app/views/entry.twig b/app/views/entry.twig new file mode 100644 index 0000000..4b177d7 --- /dev/null +++ b/app/views/entry.twig @@ -0,0 +1,10 @@ +
  • +

    {{ entry.title }}

    +

    {{ entry.content|striptags|slice(0, 300) }}…

    + +
  • \ No newline at end of file diff --git a/app/views/index.twig b/app/views/index.twig index 6dde9b3..9dabe75 100644 --- a/app/views/index.twig +++ b/app/views/index.twig @@ -1,17 +1,5 @@ {% extends layout %} - -{% block menu %} -{% set count = entries|length %} - - -{% endblock %} +{% block title %}unread{% endblock %} {% block content %} {% if entries is empty %} @@ -19,16 +7,7 @@ {% else %} diff --git a/app/views/layout.twig b/app/views/layout.twig index c5cb061..f2a56fa 100644 --- a/app/views/layout.twig +++ b/app/views/layout.twig @@ -10,7 +10,7 @@ - poche + {% block title %}{% endblock %} – poche @@ -18,7 +18,7 @@ {% include '_top.twig' %}
    - {% block menu %}{% endblock %} + {% include "menu.twig" %} {% block content %}{% endblock %}
    diff --git a/app/views/menu.twig b/app/views/menu.twig new file mode 100644 index 0000000..6f6b415 --- /dev/null +++ b/app/views/menu.twig @@ -0,0 +1,11 @@ +{% if entries is defined %} +{% set count = entries|length %} +{% endif %} + \ No newline at end of file