/
_likers.html
103 lines (100 loc) · 4.29 KB
/
_likers.html
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
{% load staticfiles %}
{% load votainteligente_extras %}
{% load i18n %}
{% load thumbnail %}
<!-- _likers.html -->
{% if not avoid_counter %}
<div class="apoyo">
{% endif %}
{% if not is_embedded %}
{% if user.is_authenticated %}
{% if user|is_candidate %}
<!-- escandidato -->
{% for candidacy in user.candidacies.all %}
<div class="apoyo-btn">
{% if not avoid_counter %}
<div class="apoyo-contador text-center">
<p class="nota">Esta propuesta tiene <span id='likers_count_{{proposal.id}}' class="conteo">{{proposal.likers.count}}</span> apoyo(s)</p>
</div>
{% endif %}
</div>
<!-- candidatos no apoyan, se compromete -->
{% if candidacy.candidate %}
{% get_commitment candidacy proposal as commitment %}
{% if commitment %}
<div class="btn_pronunciarme {{support_button_extra_class}}">
<a href="#" class="btn btn-apoyo" disabled="disabled">Comprometido</a>
</div>
{% else %}
{% with proposal.get_absolute_url as detail_url %}
<div class="btn_pronunciarme {{support_button_extra_class}}">
<a href="{% url 'popular_proposals:commit_yes' candidate_pk=candidacy.candidate.id proposal_pk=proposal.id %}" class="btn btn-apoyo">Comprometerme</a>
</div>
{% endwith %}
{% endif %}
{% endif %}
{% endfor %}
{% else %}
<!-- noescandidato -->
{% if not user|likes:proposal %}
{% url 'popular_proposals:like_a_proposal' pk=proposal.id as like_this_proposal_url %}
{% with "supportProposal"|add:proposal.slug as modalid %}
<!-- "logueado sin support" -->
{% if not avoid_counter %}
<div class="apoyo-contador text-center">
<p class="nota">Esta propuesta tiene <span id='likers_count_{{proposal.id}}' class="conteo">{{proposal.likers.count}}</span> apoyo(s)</p>
</div>
{% endif %}
<span class="corazon-{{proposal.id}}">
<a class="btn btn-apoyo text-center {{support_button_extra_class}}" data-toggle="modal" data-target="#{{modalid}}" onclick="ga('send','event','apoyo-propuesta-usuario','click')">
Apoyar <i class="fa fa-heart" aria-hidden="true"></i>
</a>
</span>
{% if not avoid_counter %}
{% include 'modal_like_proposal.html' with modalId=modalid title='Apoya una propuesta' url=like_this_proposal_url next_url=request.path %}
{% endif %}
<!-- end of "logueado sin support" -->
{% endwith %}
{% else %}
{% with user|support:proposal as support %}
<!-- apoyando -->
{% if not avoid_counter %}
<div class="apoyo-contador text-center">
<p class="nota">Esta propuesta tiene <span id='likers_count_{{proposal.id}}' class="conteo">{{proposal.likers.count}}</span> apoyo(s)</p>
</div>
{% endif %}
{% if not proposals_list %}
<span class="corazon-{{proposal.id}} btn btn-no-apoyo text-center {{support_button_extra_class}}" style="cursor:auto;">
Estoy apoyando <i class="fa fa-heart" aria-hidden="true"></i>
</span>
{% endif %}
{% if support_button_extra_class %}
<div class="col-md-6">
<div class="share pull-left">
{% include 'popular_proposal/_share.html' with popular_proposal=proposal %}
</div>
</div>
{% endif %}
<!-- eoapoyando -->
{% endwith %}
{% endif %}
<!-- eonoescandidato -->
{% endif %}
{% else %}
<!-- usuario no logueado -->
{% if not avoid_counter %}
<div class="apoyo-contador text-center">
<p class="nota">Esta propuesta tiene <span id='likers_count_{{proposal.id}}' class="conteo">{{proposal.likers.count}}</span> apoyo(s)</p>
</div>
{% endif %}
<span class="corazon-{{proposal.id}}">
<a href="{% url 'auth_login' %}" class="btn btn-apoyo text-center {{support_button_extra_class}}" onclick="ga('send','event','apoyo-propuesta-no-usuario','click')">
Apoyar <i class="fa fa-heart" aria-hidden="true"></i>
</a>
</span>
{% endif %}
{% endif %}
{% if not avoid_counter %}
</div>
{% endif %}
<!-- end of _likers.html -->