-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathreactions.twig
47 lines (47 loc) · 1.9 KB
/
reactions.twig
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
<div id="{{reactionId}}" class="reactions-container">
{% if titleTag != 'h5' %}
<h6>
{% block title %}
{% if connected %}
{{ title }} <small><span class="max-reaction">{{maxReaction}}</span> {{_t('REACTION_NB_REACTIONS_LEFT')}}</small>
{% else %}
{{ _t('REACTION_TO_ALLOW_REACTION') }}, <a href="#LoginModal" class="btn btn-default" data-toggle="modal"><i class="fas fa-user"></i>
{{ _t('REACTION_PLEASE_LOGIN') }}</a>
{% endif %}
{% endblock title %}
</h6>
{% else %}
<h5>
{{ block('title') }}
</h5>
{% endif %}
<div class="reactions-flex">
{% for reaction in reactionItems %}
<div class="reaction-content">
{% if connected -%}
<a href="{{ url({tag:'api/reactions'}) }}"
title="{{reaction.label}}"
data-id="{{reaction.id}}" data-reactionId="{{reactionId}}" data-pageTag="{{pageTag}}" data-maxReaction="{{maxReaction}}" data-userName="{{userName}}"
class="link-reaction{{ (userReaction and reaction.id in userReaction) ? ' user-reaction' : '' }}"
{% if reaction.id in oldIdsUserReactions %}data-old-id="true"{% endif %}>
{% block reactionBlock %}
<div class="reaction-image">
{{ include('@core/_reactions_images.twig',{
image: reaction.image,
id: reaction.id
}) }}
</div>
<h6 class="reaction-title">{{ reaction.label }}</h6>
<div class="reaction-numbers">{{ reaction.nbReactions }}</div>
{% endblock %}
</a>
{% else %}
<a href="#" onclick="return false;" title="{{_t('REACTION_LOGIN_TO_REACT')}}" class="disabled link-reaction">
{{- block('reactionBlock') -}}
</a>
{% endif %}
</div>
{% endfor %}
</div>
{% block extra %}{% endblock extra %}
</div>