Skip to content

Commit

Permalink
Remove flag to hide candidates from the all page
Browse files Browse the repository at this point in the history
  • Loading branch information
tudoramariei committed Dec 4, 2024
1 parent 9cc07a3 commit 0b8fc8b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 40 deletions.
71 changes: 34 additions & 37 deletions backend/hub/templates/hub/candidate/all.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,45 @@

{% block left-side-view %}

{% if should_display_candidates %}

{% block domain-filters %}
{% endblock %}

<div class="search-wrapper container is-flex">
<form action="" method="GET">
<div class="field border-b">
<p class="control has-icons-right ">
<label class="search-icon">
<input
class="input search-input"
type="text"
name="q"
value="{{ current_search }}"
placeholder="{% trans 'Search...' %}">
<span class="icon is-small is-right"><i class="fas fa-search"></i></span>
<input type="submit" style="display: none;"/>
</label>
</p>
</div>
</form>
</div>

{% if current_domain %}
<h2 class="section-title uppercase">
<span class="is-4"><<</span> <a href="{% url 'candidates' %}">{% trans "Back" %}</a>
</h2>
{% endif %}

{% block domain-filters %}
{% endblock %}

<div class="search-wrapper container is-flex">
<form action="" method="GET">
<div class="field border-b">
<p class="control has-icons-right ">
<label class="search-icon">
<input
class="input search-input"
type="text"
name="q"
value="{{ current_search }}"
placeholder="{% trans 'Search...' %}">
<span class="icon is-small is-right"><i class="fas fa-search"></i></span>
<input type="submit" style="display: none;"/>
</label>
</p>
</div>
</form>
</div>

{% if current_domain %}
<h2 class="section-title uppercase">
{% trans "All candidates" %}
<span class="is-4"><<</span> <a href="{% url 'candidates' %}">{% trans "Back" %}</a>
</h2>
{% endif %}

<div class="container">
{% if page_obj %}
<h2 class="section-title uppercase">
{% trans "All candidates" %}
</h2>

{% include "hub/candidate/components/listing_detail.html" with candidates=page_obj.object_list display_status=True %}
<div class="container">
{% if page_obj %}

{% endif %}
</div>
{% endif %}
{% include "hub/candidate/components/listing_detail.html" with candidates=page_obj.object_list display_status=True %}

{% endif %}
</div>

{% endblock %}

Expand Down
4 changes: 2 additions & 2 deletions backend/hub/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.views.generic import RedirectView

from hub.views import (
AllCandidatesListView,
CandidatesAllListView,
BlogListView,
BlogPostView,
CandidateDetailView,
Expand Down Expand Up @@ -45,7 +45,7 @@
path(_("candidates/<int:pk>/revoke/"), candidate_revoke, name="candidate-revoke"),
path(_("candidates/<int:pk>/status-confirm/"), candidate_status_confirm, name="candidate-status-confirm"),
path(_("candidates/<int:pk>/update/"), CandidateUpdateView.as_view(), name="candidate-update"),
path(_("candidates/all/"), AllCandidatesListView.as_view(), name="all-proposed"),
path(_("candidates/all/"), CandidatesAllListView.as_view(), name="all-proposed"),
path(_("candidates/votes/"), ElectorCandidatesListView.as_view(), name="votes"),
path(_("candidates/results/"), CandidateResultsView.as_view(), name="results"),
path(
Expand Down
2 changes: 1 addition & 1 deletion backend/hub/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ def get_context_data(self, **kwargs):
return context


class AllCandidatesListView(CandidateListView):
class CandidatesAllListView(CandidateListView):
template_name = "hub/candidate/all.html"

def get_queryset(self):
Expand Down

0 comments on commit 0b8fc8b

Please sign in to comment.