modularize comment template
This commit is contained in:
@@ -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>
|
||||
|
||||
169
cl-theme/templates/comments.html
Normal file
169
cl-theme/templates/comments.html
Normal file
@@ -0,0 +1,169 @@
|
||||
<div class="comments-content">
|
||||
<!-- comment header -->
|
||||
<div class="comments-header has-text-centered">
|
||||
<p class="title is-4">{{ _('Comentarios') }}</p>
|
||||
</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 %}
|
||||
|
||||
<div class="media">
|
||||
<!-- Left empty for line -->
|
||||
</div>
|
||||
|
||||
<!-- form begin -->
|
||||
<form 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 %}
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label is-normal">
|
||||
<label class="has-text-white" for="name">{{ _('Nombre') }}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<input id="name"
|
||||
class="input"
|
||||
type="text"
|
||||
name="name"
|
||||
placeholder="{{ _('Su nombre o nick') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label is-normal">
|
||||
<label class="has-text-white" for="email">{{ _('Email') }}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<input id="email"
|
||||
class="input"
|
||||
type="email"
|
||||
name="email"
|
||||
placeholder="{{ _('E-mail (requerido, no será publicado)') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label is-normal">
|
||||
<label class="has-text-white" for="web">{{ _('Sitio Web') }}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<input id="web"
|
||||
class="input"
|
||||
type="url"
|
||||
name="link"
|
||||
placeholder="{{ _('Su sitio web (opcional)') }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label is-normal">
|
||||
<label class="has-text-white" for="comment">{{ _('Comentario') }}</label>
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<textarea id="comment"
|
||||
class="textarea"
|
||||
name="comment"
|
||||
placeholder="{{ _('Agrega un comentario...') }}"></textarea>
|
||||
</div>
|
||||
<p>{{ _('Puede formatear su comentario con') }}
|
||||
<a href="https://en.wikipedia.org/wiki/Markdown"
|
||||
rel="noopener noreferrer" target="_blank">Markdown</a>.
|
||||
{{ _('Avatar desde') }}
|
||||
<a href="https://libravatar.org"
|
||||
rel="noopener noreferrer" target="_blank" >Libravatar</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="field is-horizontal">
|
||||
<div class="field-label">
|
||||
<!-- Left empty for spacing -->
|
||||
</div>
|
||||
<div class="field-body">
|
||||
<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 %}
|
||||
</p>
|
||||
<!-- /Política de Uso -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user