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: ''
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
BY: av
WRITTEN_ON:
BY: Av
NAME_LABEL: "Navn"
NAME_PLACEHOLDER: "Skriv ditt navn"
EMAIL_LABEL: "Epost"

View File

@ -18,14 +18,28 @@
{% if pingback.approved == "true" %}
<tr>
<td>
{{pingback.text}}
<br />
{{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{pingback.date|e}} {{'PLUGIN_COMMENTS.BY'|t}}
<article id="pingback-{{loop.index0}}" class="pingback" itemtype="http://schema.org/UserComments">
<header class="pingback-meta">
<span class="pingback-author" itemprop="author" itemscope itemtype="http://schema.org/Person">
{{'PLUGIN_COMMENTS.BY'|t}}
<span itemprop="name">
{% if pingback.site %}
<a href="{{pingback.site}}">{{pingback.author}}</a>
{% else %}
{{pingback.author}}
{% 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>
</tr>
{% endif %}
@ -82,21 +96,36 @@
<h3>{{'PLUGIN_COMMENTS.COMMENTS'|t}}</h3>
<table>
<table class="comments">
{% set comments_visible = false %}
{% for comment in grav.twig.comments %}
{% if comment.approved == "true" %}
{% set comments_visible = true %}
<tr>
<td>
{{comment.text}}
<br />
{{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{comment.date|e}} {{'PLUGIN_COMMENTS.BY'|t}}
<article id="comment-{{loop.index0}}" class="comment" itemtype="http://schema.org/UserComments">
<header class="comment-meta">
<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 %}
<a href="{{comment.site}}">{{comment.author}}</a>
{% else %}
{{comment.author}}
{% 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>
</tr>
{% endif %}