[FIX] RECRUITMENT: Close filter tag option for default filter

This commit is contained in:
Horilla
2024-02-22 11:16:38 +05:30
parent 65df7d7aa0
commit 0bd6a841bb
3 changed files with 16 additions and 15 deletions

View File

@@ -178,14 +178,6 @@ class RecruitmentFilter(FilterSet):
widget=forms.DateInput(attrs={"type": "date"}),
)
search = django_filters.CharFilter(method="filter_by_name")
closed = django_filters.ChoiceFilter(
choices=[
(True, "Yes"),
(None, "No"),
],
initial="no",
empty_label="No",
)
is_active = django_filters.ChoiceFilter(
choices=[
(True, "Yes"),

View File

@@ -13,9 +13,16 @@
<label class="oh-label">{% trans "Start Date" %}</label>
{{f.form.start_date}}
</div>
<div class="oh-input-group">
<label class="oh-label">{% trans "Is Closed" %}</label>
{% comment %} {{f.form.closed}} {% endcomment %}
<select name="closed" id="closed" class="oh-select oh-select-2 w-100">
<option value="unknown">{% trans "Unknown" %}</option>
<option value="true">{% trans "True" %}</option>
<option value="false" selected>{% trans "False" %}</option>
</select>
</div>
</div>
<div hidden>{{f.form.closed}}</div>
<div class="col-sm-12 col-md-12 col-lg-6">
<div class="oh-input-group">
<label class="oh-label">{% trans "Company" %}</label>
@@ -25,8 +32,10 @@
<label class="oh-label">{% trans "End Date" %}</label>
{{f.form.end_date}}
</div>
<div class="oh-input-group">
<label class="oh-label">{% trans "Is Published" %}</label>
{{f.form.is_published}}
</div>
</div>
</div>
</div>

View File

@@ -4,11 +4,11 @@
<!-- start of quick filters -->
<div class="d-flex flex-row-reverse">
<span class="m-3" onclick="$('[name=closed]').val(''); $('[name=closed]').first().change(); $('.filterButton').click()" style="cursor: pointer">
<span class="oh-dot oh-dot--small me-1" style="background-color:yellowgreen""></span>
<span class="m-1" style="margin-left: 15px;cursor: pointer;" onclick="$('[name=closed]').val('false'); $('[name=closed]').first().change(); $('.filterButton').click()" style="cursor: pointer">
<span class="oh-dot oh-dot--small me-1" style="background-color:yellowgreen"></span>
{% trans "Open" %}
</span>
<span class="m-3" onclick="$('[name=closed]').val('True'); $('[name=closed]').first().change(); $('.filterButton').click()" style="cursor: pointer">
<span class="m-1" style="margin-left: 15px;cursor: pointer;" onclick="$('[name=closed]').val('true'); $('[name=closed]').first().change(); $('.filterButton').click()" style="cursor: pointer">
<span class="oh-dot oh-dot--small me-1" style="background-color:red" ></span>
{% trans "Closed" %}
</span>