[pelican_comments] Add support comment_system

This commit is contained in:
Jesús
2019-11-18 12:16:28 -05:00
parent f1407c4463
commit 1bad59aa45
16 changed files with 1435 additions and 97 deletions

View File

@@ -1,3 +1,4 @@
{# {% import 'pcs/comments.html' as pcs with context %} #}
{% extends "base.html" %}
{% block html_lang %}{{ article.lang }}{% endblock %}
@@ -167,6 +168,126 @@
</div>
<!-- end of post content -->
<!-- post comments -->
<div class="comments-content">
<!-- comment header -->
<div class="comments-header has-text-centered">
<h4 class="title is-4">{{ _('Comentarios') }} </h4>
</div>
<div class="comments-wrapper">
<!-- comments content -->
<div class="comments-content">
<!-- end of comment header -->
{% if article.comments %}
{% for comment in article.comments %}
<!-- start of comment -->
<div class="media" id="comment-{{comment.slug}}">
<!-- comment user image -->
<figure class="media-left">
<p class="image is-64x64">
{% if comment.avatar %}
<img src="{{ comment.avatar }}"
alt="{{ comment.author }}"
title="{{ comment.author }}">
{% else %}
<img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/avatar/avatar.png"
alt="{{ comment.author }}"
title="{{ comment.author }}">
{% endif %}
</p>
</figure>
<!-- end of comment user image -->
<!-- comment content -->
<div class="media-content">
<div class="content">
{% if comment.web %}
<p>
<strong>
<a href="{{ comment.web }}"
rel="noopener noreferrer"
target="_blank">{{ comment.author }}</a>
</strong>
</p>
{% else %}
<p><strong>{{ comment.author }}</strong></p>
{% endif %}
{{ comment.content }}
<small><a href="{{ SITEURL }}/{{ article.url }}#comment-{{comment.slug}}">Permalink</a>
| {{ comment.date }}</small>
</div>
</div>
<!-- end of comment content -->
</div>
<!-- end of comments -->
{% endfor %}
{% endif %}
<!-- form begin -->
<form class="media" id="commentform" method="POST" action="{{ SITEURL }}/vendor/form-comments/commentsubmit.php">
<input type="hidden" name="post_id" value="{{ article.url }}">
<input type="hidden" name="return_url" value="{{ SITEURL }}/{{ article.url }}" />
<figure class="media-left">
<p class="image is-64x64">
<img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/avatar/avatar.png" alt="placeholder">
</p>
</figure>
<div class="media-content">
<div class="field">
<div class="control">
<input class="input" type="text" placeholder="{{ _('Su nombre o nick') }}" name="name">
</div>
</div>
<div class="field">
<div class="control">
<input class="input" type="email"
placeholder="{{ _('E-mail (requerido, no será publicado)') }}"
name="email">
</div>
</div>
<div class="field">
<div class="control">
<input class="input" type="url"
placeholder="{{ _('Su sitio web (opcional)') }}"
name="link">
</div>
</div>
<div class="field">
<p class="control">
<textarea class="textarea" placeholder="{{ _('Agrega un comentario...') }}" name="comment"></textarea>
</p>
</div>
<div class="field">
<div class="control">
<p>{{ _('Puede formatear su comentario con') }}
<a href="https://en.wikipedia.org/wiki/Markdown"
rel="noopener noreferrer" target="_blank">Markdown</a>.
</p>
</div>
</div>
<div class="field">
<p class="control">
<button class="button is-button-grey" name="submit">{{ _('Enviar comentario') }}</button>
<!-- Política de Uso -->
{% if DEFAULT_LANG == 'en' %}
<a href="{{ SITEURL}}/pages/politica-de-uso-es.html">{{ _('Política de uso') }}</a>
{% elif DEFAULT_LANG == 'fr' %}
<a href="{{ SITEURL}}/pages/politica-de-uso-es.html">{{ _('Política de uso') }}</a>
{% else %}
<a href="{{ SITEURL}}/pages/politica-de-uso.html">{{ _('Política de uso') }}</a>
{% endif %}
<!-- /Política de Uso -->
</p>
</div>
</div>
</form>
<!-- form end -->
</div>
</div>
</div>
<!-- end of comments -->
</article>
<!-- end of post -->
</div>