From 94134e2575f0674b61078b070674fe6fb612b4fc Mon Sep 17 00:00:00 2001 From: leetNightshade <> Date: Fri, 29 Jun 2018 17:06:21 -0700 Subject: [PATCH] Adding gravatar support and nice time display, and classes and div's for customizing comment formatting. --- languages.yaml | 46 +++--- templates/partials/comments.html.twig | 227 +++++++++++++++----------- 2 files changed, 151 insertions(+), 122 deletions(-) diff --git a/languages.yaml b/languages.yaml index 5a83143..5c0cc87 100644 --- a/languages.yaml +++ b/languages.yaml @@ -14,8 +14,8 @@ de: EMAIL_FOOTER: '' NAME: Name: EMAIL: Email: - WRITTEN_ON: geschrieben am - BY: von + WRITTEN_ON: am + BY: Von NAME_LABEL: "Name" NAME_PLACEHOLDER: "Namen eingeben" EMAIL_LABEL: "Email" @@ -44,8 +44,8 @@ en: EMAIL_FOOTER: '' NAME: Name: EMAIL: Email: - WRITTEN_ON: Written on - BY: by + WRITTEN_ON: on + BY: By NAME_LABEL: "Name" NAME_PLACEHOLDER: "Enter your name" EMAIL_LABEL: "Email" @@ -74,8 +74,8 @@ es: EMAIL_FOOTER: '' NAME: Nombre: EMAIL: Email: - WRITTEN_ON: Escrito en - BY: por + WRITTEN_ON: en + BY: Por NAME_LABEL: "Nombre" NAME_PLACEHOLDER: "Escriba su nombre" EMAIL_LABEL: "Email" @@ -104,8 +104,8 @@ fr: EMAIL_FOOTER: '' NAME: Nom : EMAIL: E-mail : - WRITTEN_ON: Écrit le - BY: par + WRITTEN_ON: le + BY: Par NAME_LABEL: "Nom" NAME_PLACEHOLDER: "Indiquez votre nom" EMAIL_LABEL: "E-mail" @@ -134,8 +134,8 @@ hr: EMAIL_FOOTER: '' NAME: Ime: EMAIL: Email: - WRITTEN_ON: Napisano je na - BY: od + WRITTEN_ON: na + BY: Od NAME_LABEL: "Ime" NAME_PLACEHOLDER: "Unesite ime" EMAIL_LABEL: "Email adresa" @@ -164,8 +164,8 @@ it: EMAIL_FOOTER: '' NAME: Nome: EMAIL: Email: - WRITTEN_ON: Scritto il - BY: da + WRITTEN_ON: il + BY: Da NAME_LABEL: "Nome" NAME_PLACEHOLDER: "Inserisci il tuo nome" EMAIL_LABEL: "Email" @@ -194,7 +194,7 @@ ja: EMAIL_FOOTER: '' NAME: 名前 : EMAIL: メールアドレス : - WRITTEN_ON: に書かれた + WRITTEN_ON: に BY: に NAME_LABEL: "名前" NAME_PLACEHOLDER: "お名前を" @@ -224,8 +224,8 @@ pl: EMAIL_FOOTER: '' NAME: Imię: EMAIL: Email: - WRITTEN_ON: Napisany przez - BY: przez + WRITTEN_ON: na + BY: Przez ru: PLUGIN_COMMENTS: @@ -243,8 +243,8 @@ ru: EMAIL_FOOTER: '' NAME: Имя: EMAIL: Email: - WRITTEN_ON: Написан в - BY: от + WRITTEN_ON: на + BY: От pt-br: PLUGIN_COMMENTS: @@ -262,8 +262,8 @@ pt-br: EMAIL_FOOTER: '' NAME: Name: EMAIL: Email: - WRITTEN_ON: Publicado em - BY: por + WRITTEN_ON: em + BY: Por NAME_LABEL: "Nome" NAME_PLACEHOLDER: "Escreva seu nome" EMAIL_LABEL: "E-mail" @@ -292,8 +292,8 @@ ro: EMAIL_FOOTER: '' NAME: 'Nume:' EMAIL: 'Adresă de email:' - WRITTEN_ON: 'Scris în data de' - BY: 'de către' + WRITTEN_ON: 'pe' + BY: 'De' NAME_LABEL: "Numele" NAME_PLACEHOLDER: "Introduceți numele Dvs." EMAIL_LABEL: "Email" @@ -322,8 +322,8 @@ no: EMAIL_FOOTER: '' NAME: Navn: EMAIL: Epost: - WRITTEN_ON: Skrevet på - BY: av + WRITTEN_ON: på + BY: Av NAME_LABEL: "Navn" NAME_PLACEHOLDER: "Skriv ditt navn" EMAIL_LABEL: "Epost" diff --git a/templates/partials/comments.html.twig b/templates/partials/comments.html.twig index b4153a0..8d58c29 100644 --- a/templates/partials/comments.html.twig +++ b/templates/partials/comments.html.twig @@ -1,114 +1,143 @@ {% if grav.twig.enable_comments_plugin %} - {% set scope = scope ?: 'data.' %} + {% set scope = scope ?: 'data.' %} - {% if grav.twig.pingbacks_enabled %} - {% if grav.twig.pingbacks|length %} - {% set comments_visible = false %} - {% for pingback in grav.twig.pingbacks %} - {% if pingback.approved == "true" %} - {% set comments_visible = true %} - {% endif %} - {% endfor %} + {% if grav.twig.pingbacks_enabled %} + {% if grav.twig.pingbacks|length %} + {% set comments_visible = false %} + {% for pingback in grav.twig.pingbacks %} + {% if pingback.approved == "true" %} + {% set comments_visible = true %} + {% endif %} + {% endfor %} - {% if comments_visible %} -
- {{pingback.text}}
- - {{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{pingback.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} - {% if pingback.site %} - {{pingback.author}} - {% else %} - {{pingback.author}} - {% endif %} - |
-
+
+ {{pingback.text}}
+
+ |
+
- {{comment.text}}
- - {{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{comment.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} - {% if comment.site %} - {{comment.author}} - {% else %} - {{comment.author}} - {% endif %} - |
-
+
+ {{comment.text}}
+
+ |
+
- {{'PLUGIN_COMMENTS.COMMENTS_NONE'|t}} - | -