From 9b60894114bc994af85ec363d7846c6320d46cb2 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Wed, 7 Oct 2015 15:43:28 +0200 Subject: [PATCH] Improve rendering comments --- admin/templates/comments.html.twig | 93 ++++++++++++++----- .../partials/comments-list.html.twig | 11 --- 2 files changed, 70 insertions(+), 34 deletions(-) delete mode 100644 admin/templates/partials/comments-list.html.twig diff --git a/admin/templates/comments.html.twig b/admin/templates/comments.html.twig index 49bd8ea..9f2bd00 100644 --- a/admin/templates/comments.html.twig +++ b/admin/templates/comments.html.twig @@ -9,33 +9,80 @@ {% endblock %} {% block content %} -
-
-

- {{"PLUGIN_COMMENTS.COMMENTS"|e|tu}} -

+ + + + +
+ + +
    +
  • {% for file in grav.twig.files %} - - - - {{ file.fileName }} - {% if file.data.hasUnread %}Has {{file.data.unreadCount}} unread comments{% endif %} - - - - - -
    - {% include 'partials/comments-list.html.twig' with { file: file } %} -
    - - +
    + + + + {{ file.data.name ?: file.fileName }} + +

    {% if file.data.hasUnread %}Has {{file.data.unreadCount}} unread comments{% else %}{{file.data.comments|length}} comments{% endif %}

    + + + +
    {% endfor %} - -
+ +
+ {% endblock %} diff --git a/admin/templates/partials/comments-list.html.twig b/admin/templates/partials/comments-list.html.twig deleted file mode 100644 index 3eb2bef..0000000 --- a/admin/templates/partials/comments-list.html.twig +++ /dev/null @@ -1,11 +0,0 @@ - - {% for comment in file.data.comments %} - - - - {% endfor %} -
- {{ comment.text }} -
- By {{ comment.author }} {{ comment.email }} -