Adding gravatar support and nice time display, and classes and div's for

customizing comment formatting.
This commit is contained in:
leetNightshade 2018-06-29 17:06:21 -07:00
parent 43a70fe64a
commit 94134e2575
2 changed files with 151 additions and 122 deletions

View File

@ -14,8 +14,8 @@ de:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: Name: NAME: Name:
EMAIL: Email: EMAIL: Email:
WRITTEN_ON: geschrieben am WRITTEN_ON: am
BY: von BY: Von
NAME_LABEL: "Name" NAME_LABEL: "Name"
NAME_PLACEHOLDER: "Namen eingeben" NAME_PLACEHOLDER: "Namen eingeben"
EMAIL_LABEL: "Email" EMAIL_LABEL: "Email"
@ -44,8 +44,8 @@ en:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: Name: NAME: Name:
EMAIL: Email: EMAIL: Email:
WRITTEN_ON: Written on WRITTEN_ON: on
BY: by BY: By
NAME_LABEL: "Name" NAME_LABEL: "Name"
NAME_PLACEHOLDER: "Enter your name" NAME_PLACEHOLDER: "Enter your name"
EMAIL_LABEL: "Email" EMAIL_LABEL: "Email"
@ -74,8 +74,8 @@ es:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: Nombre: NAME: Nombre:
EMAIL: Email: EMAIL: Email:
WRITTEN_ON: Escrito en WRITTEN_ON: en
BY: por BY: Por
NAME_LABEL: "Nombre" NAME_LABEL: "Nombre"
NAME_PLACEHOLDER: "Escriba su nombre" NAME_PLACEHOLDER: "Escriba su nombre"
EMAIL_LABEL: "Email" EMAIL_LABEL: "Email"
@ -104,8 +104,8 @@ fr:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: Nom : NAME: Nom :
EMAIL: E-mail : EMAIL: E-mail :
WRITTEN_ON: Écrit le WRITTEN_ON: le
BY: par BY: Par
NAME_LABEL: "Nom" NAME_LABEL: "Nom"
NAME_PLACEHOLDER: "Indiquez votre nom" NAME_PLACEHOLDER: "Indiquez votre nom"
EMAIL_LABEL: "E-mail" EMAIL_LABEL: "E-mail"
@ -134,8 +134,8 @@ hr:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: Ime: NAME: Ime:
EMAIL: Email: EMAIL: Email:
WRITTEN_ON: Napisano je na WRITTEN_ON: na
BY: od BY: Od
NAME_LABEL: "Ime" NAME_LABEL: "Ime"
NAME_PLACEHOLDER: "Unesite ime" NAME_PLACEHOLDER: "Unesite ime"
EMAIL_LABEL: "Email adresa" EMAIL_LABEL: "Email adresa"
@ -164,8 +164,8 @@ it:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: Nome: NAME: Nome:
EMAIL: Email: EMAIL: Email:
WRITTEN_ON: Scritto il WRITTEN_ON: il
BY: da BY: Da
NAME_LABEL: "Nome" NAME_LABEL: "Nome"
NAME_PLACEHOLDER: "Inserisci il tuo nome" NAME_PLACEHOLDER: "Inserisci il tuo nome"
EMAIL_LABEL: "Email" EMAIL_LABEL: "Email"
@ -194,7 +194,7 @@ ja:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: 名前 : NAME: 名前 :
EMAIL: メールアドレス : EMAIL: メールアドレス :
WRITTEN_ON: 書かれた WRITTEN_ON:
BY: BY:
NAME_LABEL: "名前" NAME_LABEL: "名前"
NAME_PLACEHOLDER: "お名前を" NAME_PLACEHOLDER: "お名前を"
@ -224,8 +224,8 @@ pl:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: Imię: NAME: Imię:
EMAIL: Email: EMAIL: Email:
WRITTEN_ON: Napisany przez WRITTEN_ON: na
BY: przez BY: Przez
ru: ru:
PLUGIN_COMMENTS: PLUGIN_COMMENTS:
@ -243,8 +243,8 @@ ru:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: Имя: NAME: Имя:
EMAIL: Email: EMAIL: Email:
WRITTEN_ON: Написан в WRITTEN_ON: на
BY: от BY: От
pt-br: pt-br:
PLUGIN_COMMENTS: PLUGIN_COMMENTS:
@ -262,8 +262,8 @@ pt-br:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: Name: NAME: Name:
EMAIL: Email: EMAIL: Email:
WRITTEN_ON: Publicado em WRITTEN_ON: em
BY: por BY: Por
NAME_LABEL: "Nome" NAME_LABEL: "Nome"
NAME_PLACEHOLDER: "Escreva seu nome" NAME_PLACEHOLDER: "Escreva seu nome"
EMAIL_LABEL: "E-mail" EMAIL_LABEL: "E-mail"
@ -292,8 +292,8 @@ ro:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: 'Nume:' NAME: 'Nume:'
EMAIL: 'Adresă de email:' EMAIL: 'Adresă de email:'
WRITTEN_ON: 'Scris în data de' WRITTEN_ON: 'pe'
BY: 'de către' BY: 'De'
NAME_LABEL: "Numele" NAME_LABEL: "Numele"
NAME_PLACEHOLDER: "Introduceți numele Dvs." NAME_PLACEHOLDER: "Introduceți numele Dvs."
EMAIL_LABEL: "Email" EMAIL_LABEL: "Email"
@ -322,8 +322,8 @@ no:
EMAIL_FOOTER: '' EMAIL_FOOTER: ''
NAME: Navn: NAME: Navn:
EMAIL: Epost: EMAIL: Epost:
WRITTEN_ON: Skrevet WRITTEN_ON:
BY: av BY: Av
NAME_LABEL: "Navn" NAME_LABEL: "Navn"
NAME_PLACEHOLDER: "Skriv ditt navn" NAME_PLACEHOLDER: "Skriv ditt navn"
EMAIL_LABEL: "Epost" EMAIL_LABEL: "Epost"

View File

@ -18,14 +18,28 @@
{% if pingback.approved == "true" %} {% if pingback.approved == "true" %}
<tr> <tr>
<td> <td>
{{pingback.text}} <article id="pingback-{{loop.index0}}" class="pingback" itemtype="http://schema.org/UserComments">
<br /> <header class="pingback-meta">
{{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{pingback.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} <span class="pingback-author" itemprop="author" itemscope itemtype="http://schema.org/Person">
{{'PLUGIN_COMMENTS.BY'|t}}
<span itemprop="name">
{% if pingback.site %} {% if pingback.site %}
<a href="{{pingback.site}}">{{pingback.author}}</a> <a href="{{pingback.site}}">{{pingback.author}}</a>
{% else %} {% else %}
{{pingback.author}} {{pingback.author}}
{% endif %} {% endif %}
</span>
</span>
<a href="{{uri.url(true)}}#pingback-{{loop.index0}}" title="Link to this pingback" itemprop="url">
<time class="pingback-date" datetime="{{pingback.date|e}}" itemprop="commentTime">
{{pingback.date|nicetime(false)}}
</time>
</a>
</header>
<div class="pingback-content" itemprop="commentText">
{{pingback.text}}
</div>
</article>
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
@ -82,21 +96,36 @@
<h3>{{'PLUGIN_COMMENTS.COMMENTS'|t}}</h3> <h3>{{'PLUGIN_COMMENTS.COMMENTS'|t}}</h3>
<table> <table class="comments">
{% set comments_visible = false %} {% set comments_visible = false %}
{% for comment in grav.twig.comments %} {% for comment in grav.twig.comments %}
{% if comment.approved == "true" %} {% if comment.approved == "true" %}
{% set comments_visible = true %} {% set comments_visible = true %}
<tr> <tr>
<td> <td>
{{comment.text}} <article id="comment-{{loop.index0}}" class="comment" itemtype="http://schema.org/UserComments">
<br /> <header class="comment-meta">
{{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{comment.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} <span class="comment-author" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="comment-avatar" itemprop="image" src="https://www.gravatar.com/avatar/{{comment.email|ltrim()|rtrim()|md5}}?size=30&d=identicon">
{{'PLUGIN_COMMENTS.BY'|t}}
<span itemprop="name">
{% if comment.site %} {% if comment.site %}
<a href="{{comment.site}}">{{comment.author}}</a> <a href="{{comment.site}}">{{comment.author}}</a>
{% else %} {% else %}
{{comment.author}} {{comment.author}}
{% endif %} {% endif %}
</span>
</span>
<a href="{{uri.url(true)}}#comment-{{loop.index0}}" title="Link to this comment" itemprop="url">
<time class="comment-date" datetime="{{comment.date|e}}" itemprop="commentTime">
{{comment.date|nicetime(false)}}
</time>
</a>
</header>
<div class="comment-content" itemprop="commentText">
{{comment.text}}
</div>
</article>
</td> </td>
</tr> </tr>
{% endif %} {% endif %}