aboutsummaryrefslogtreecommitdiffstats
path: root/cl-theme/templates/comments.html
blob: 92f1e6d20d4f34a649355f1b64f5ce73f8e2c04e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<div class="comments-content">
    <!-- comment header -->
    <div class="comments-header has-text-centered">
        <p class="title is-4">{{ _('Publicar un comentario en "%(title)s"', title=article.title) }}</p>
    </div>
    <div class="comments-wrapper">
        <!-- comments content -->
        <div class="comments-content">
            <!-- 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">
                                <input class="button is-button-grey" name="submit" type="submit" value="{{ _('Enviar comentario') }}"/>
                                <!-- 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>

{% if article.comments %}
    <div class="comments-content" itemscope itemtype="https://schema.org/UserComments">
        <!-- 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 -->
                {% 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="{{ _('Avatar de %(user)s', user=comment.author) }}"
                                         title="{{ _('Avatar de %(user)s', user=comment.author) }}">
                                {% else %}
                                    <img src="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/images/avatar/avatar.png"
                                         alt="{{ _('Avatar predeterminado para %(user)s', user=comment.author) }}"
                                         title="{{ _('Avatar predeterminado para %(user)s', user=comment.author) }}">
                                {% endif %}
                            </p>
                        </figure>
                        <!-- end of comment user image -->

                        <!-- comment content -->
                        <div class="media-content">
                            <div class="content">
                                <div class="content" itemprop="creator" itemscope itemtype="https://schema.org/Person">
                                    {% if comment.web %}
                                        <p itemprop="name">
                                            <strong>
                                                <a href="{{ comment.web }}"
                                                   rel="noopener noreferrer"
                                                   target="_blank">{{ comment.author }}</a>
                                            </strong>
                                        </p>
                                    {% else %}
                                        <p itemprop="name"><strong>{{ comment.author }}</strong></p>
                                    {% endif %}
                                </div>
                                <div class="content" itemprop="commentText">
                                    {{ comment.content }}
                                </div>
                                <time class="entry-date published" itemprop="commentTime" datetime="{{ comment.date.isoformat() }}">
                                    <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>
                                </time>
                            </div>
                        </div>
                        <!-- end of comment content -->
                    </div>
                    <!-- end of comments -->
                {% endfor %}
            </div>
        </div>
    </div>
{% endif %}