modularize comment template

This commit is contained in:
Jesús
2019-11-21 22:20:38 -05:00
parent e05ca491ce
commit ae29915343
7 changed files with 460 additions and 312 deletions

View File

@@ -132,128 +132,7 @@
<!-- 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}}" title='Permalink'>
<abbr title='{{ comment.date|strftime("%Y-%m-%d-T%H-%M-%S") }}'>{{ _('Enlace Permanente') }}</abbr>
</a> | {{ comment.date|strftime("%H:%M:%S") }}</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 }}">
{% if RELATIVE_URLS == False %}
<input type="hidden" name="return_url" value="{{ SITEURL }}/{{ article.url }}" />
{% else %}
<input type="hidden" name="return_url" value="../../{{ article.url }}" />
{% endif %}
<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>
{% include 'comments.html' %}
<!-- end of comments -->
</article>