Skip to content

Commit

Permalink
Remove own support for NGOs
Browse files Browse the repository at this point in the history
  • Loading branch information
tudoramariei committed Oct 21, 2024
1 parent d595fd7 commit 5032b34
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
31 changes: 20 additions & 11 deletions backend/hub/templates/hub/candidate/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,17 @@

{% if can_support_candidate %}
<div class="buttons">
{% if supported_candidate %}
<a href="{% url 'candidate-support' candidate.id %}" class="button is-danger">
Retrage susținerea
</a>
{% else %}
<a href="{% url 'candidate-support' candidate.id %}" class="button is-success">
Susține
</a>

{% if not own_candidate %}
{% if supported_candidate %}
<a href="{% url 'candidate-support' candidate.id %}" class="button is-danger">
Retrage susținerea
</a>
{% else %}
<a href="{% url 'candidate-support' candidate.id %}" class="button is-success">
Susține
</a>
{% endif %}
{% endif %}

<span style="width: 100%; padding: 10px;">{% trans "Supporters:" %} {{ candidate.count_supporters }}</span>
Expand All @@ -83,11 +86,17 @@

{% if can_vote_candidate %}
{% if voted_candidate %}
<span class="tag is-success">{% trans "✔ VOTED" %}</span>
<span class="tag is-success">
{% trans "✔ VOTED" %}
</span>
{% elif used_all_domain_votes %}
<span class="tag is-warning">{% trans "You have used all the votes allotted for this domain." %}</span>
<span class="tag is-warning">
{% trans "You have used all the votes allotted for this domain." %}
</span>
{% else %}
<a href="{% url 'candidate-vote' candidate.id %}" class="button is-success">{% trans "Vote" %}</a>
<a href="{% url 'candidate-vote' candidate.id %}" class="button is-success">
{% trans "Vote" %}
</a>
{% endif %}

{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion backend/hub/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def candidate_support(request, pk):
if not FeatureFlag.flag_enabled("enable_candidate_supporting"):
raise PermissionDenied

user = request.user
user: User = request.user
user_org = user.organization
if user_org.status != Organization.STATUS.accepted:
raise PermissionDenied
Expand Down

0 comments on commit 5032b34

Please sign in to comment.