Skip to content

Commit aac4e02

Browse files
germanpskalanuxIanPuchetti
authored
64 mal comportamiento del filtro de tags y ofertas inactivas (#552)
* Added pytest as a runner * Added pytest as a runner on Makefile * Added joboffers app * Some fixes to the JobOffer model * Added initial joboffer detail * Added initial job offer add form * Changed joboffer's urls to use their namespace * Added some basic pytest's fixtures * Updated JobOffer's factory to include all the needed fields * Added joboffer creation test * Added joboffer admin page * Moved add button to bottom of the page (joboffers) * Added search button in admin page (joboffers) * Added joboffer edit view * Changed joboffer's choices to their long version * Fixed javascript filtering tags for joboffers Co-authored-by: Juan Manuel Schillaci <[email protected]> Co-authored-by: Ian Puchetti <[email protected]>
1 parent f2d2639 commit aac4e02

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

community/templates/_tags_filtering_form.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
<div class="input-group col-md-12">
77
<input type="search" name="search" placeholder="Buscar ofertas..." class="form-control input-lg" value="{% if search %}{{search}}{% endif %}">
88
<span class="input-group-btn">
9-
<button class="btn btn-default btn-lg" type="submit">
9+
<button id="buscar" class="btn btn-default btn-lg" type="submit">
1010
{% trans 'Buscar' %}
1111
</button>
1212
</span>
1313
</div>
1414
<div class="ma-5" style="margin-top:15px;">
15-
<input name="active" type="hidden" value="{% if not active %}true{% else %}false{% endif %}">
16-
<input type="checkbox" style="vertical-align: top;" onclick="this.form.active.value=!JSON.parse(this.form.active.value);this.form.submit();" {% if not active %} checked {% endif %}>
17-
<span>{% trans 'Mostrar solo ofertas activas' %}</span>
15+
<label>
16+
<input name="active" type="hidden" value="{{ active|yesno:'false,true' }}">
17+
<input id="show-active" type="checkbox" {% if not active %}checked{% endif %} />
18+
{% trans 'Mostrar solo ofertas activas' %}
19+
</label>
1820
</div>
1921
</article>
2022
<header class="list-group-item">

joboffers/templates/joboffers/joboffer_list.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h4>
2222
</h4>
2323
<p>{{ object.short_description}}</p>
2424
<div class="text-muted">
25-
{% include "jobs/_jobs_tags.html" %}
25+
{% include "joboffers/_tags.html" %}
2626
<p><a href="{{ object.get_absolute_url }}">{% trans 'Leer más...' %}</a></p>
2727
</div>
2828
</div>

static/js/tag_filtering.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,9 @@ $("#tags-form").submit(function() {
3232
).prop('disabled', true);
3333
return true;
3434
});
35+
36+
37+
$("#show-active").click(function() {
38+
this.form.active.value=this.checked;
39+
$("#buscar").click();
40+
});

0 commit comments

Comments
 (0)