Skip to content

Commit

Permalink
64 mal comportamiento del filtro de tags y ofertas inactivas (#552)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Oct 13, 2022
1 parent f2d2639 commit aac4e02
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
10 changes: 6 additions & 4 deletions community/templates/_tags_filtering_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
<div class="input-group col-md-12">
<input type="search" name="search" placeholder="Buscar ofertas..." class="form-control input-lg" value="{% if search %}{{search}}{% endif %}">
<span class="input-group-btn">
<button class="btn btn-default btn-lg" type="submit">
<button id="buscar" class="btn btn-default btn-lg" type="submit">
{% trans 'Buscar' %}
</button>
</span>
</div>
<div class="ma-5" style="margin-top:15px;">
<input name="active" type="hidden" value="{% if not active %}true{% else %}false{% endif %}">
<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 %}>
<span>{% trans 'Mostrar solo ofertas activas' %}</span>
<label>
<input name="active" type="hidden" value="{{ active|yesno:'false,true' }}">
<input id="show-active" type="checkbox" {% if not active %}checked{% endif %} />
{% trans 'Mostrar solo ofertas activas' %}
</label>
</div>
</article>
<header class="list-group-item">
Expand Down
2 changes: 1 addition & 1 deletion joboffers/templates/joboffers/joboffer_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h4>
</h4>
<p>{{ object.short_description}}</p>
<div class="text-muted">
{% include "jobs/_jobs_tags.html" %}
{% include "joboffers/_tags.html" %}
<p><a href="{{ object.get_absolute_url }}">{% trans 'Leer más...' %}</a></p>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions static/js/tag_filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ $("#tags-form").submit(function() {
).prop('disabled', true);
return true;
});


$("#show-active").click(function() {
this.form.active.value=this.checked;
$("#buscar").click();
});

0 comments on commit aac4e02

Please sign in to comment.