Browse Source

Muda forma como é mostrado os autores que podem ser selecionados'

pull/903/head
Eduardo Edson Batista Cordeiro Alves 8 years ago
parent
commit
81d33fd238
  1. 4
      sapl/materia/forms.py
  2. 55
      sapl/templates/materia/adicionar_varias_autorias.html

4
sapl/materia/forms.py

@ -74,8 +74,8 @@ class AdicionarVariasAutoriasFilterSet(django_filters.FilterSet):
self.form.helper = FormHelper()
self.form.helper.form_method = 'GET'
self.form.helper.layout = Layout(
Fieldset(_('Pesquisar Autores'),
row1, form_actions(save_label='Pesquisar'))
Fieldset(_('Filtrar Autores'),
row1, form_actions(save_label='Filtrar'))
)

55
sapl/templates/materia/adicionar_varias_autorias.html

@ -16,39 +16,28 @@
{% endif %}
{% endblock buttons %}
{% if not filter_url %}
{% crispy filter.form %}
{% endif %}
{% crispy filter.form %}
{% if filter_url %}
<table class="table table-striped table-bordered">
<thead class="thead-default">
<tr><td><h3>{% trans "Autor" %}</h3></td></tr>
</thead>
{% if filter.qs|length > 1 %}
<h3>{% blocktrans with filter.qs|length as total_autores %}Pesquisa concluída com sucesso! Foram encontrados {{total_autores}} autores.{% endblocktrans %}</h3>
{% elif filter.qs|length == 1 %}
<h3>{% trans 'Pesquisa concluída com sucesso! Foi encontrado 1 autor.'%}</h3>
{% else %}
<tr><td><h3>Nenhum autor encontrado.</h3></td></tr>
{% endif %}
<table class="table table-striped table-bordered">
<thead class="thead-default">
<tr><td><h3>{% trans "Autor" %}</h3></td></tr>
</thead>
<br />
<form method="POST" enctype="application/x-www-form-urlencoded">
{% csrf_token %}
{% for m in filter.qs %}
<tr>
<td>
<input type="checkbox" name="autor_id" id="{{m.id}}" value="{{m.id}}" {% if check %} checked {% endif %}>
&nbsp;&nbsp;
<strong>{{m}}</strong></a></br>
</td>
</tr>
{% endfor %}
<form method="POST" enctype="application/x-www-form-urlencoded">
{% csrf_token %}
{% for m in filter.qs %}
<tr>
<td>
<input type="checkbox" name="autor_id" id="{{m.id}}" value="{{m.id}}" {% if check %} checked {% endif %}>
&nbsp;&nbsp;
<strong>{{m}}</strong></a></br>
</td>
</tr>
{% endfor %}
</table>
<div class="btn-group" style="float:right;">
<input type="submit" value="Adicionar autores selecionados" class="btn btn-primary">
</div>
</form>
{% endif %}
</table>
<div class="btn-group" style="float:right;">
<input type="submit" value="Adicionar autores selecionados" class="btn btn-primary">
</div>
</form>
{% endblock detail_content %}

Loading…
Cancel
Save