+
+
+ {% if anexos.count == 0 %}
+
{% trans "Nenhum anexo registrado" %}
+ {% else %}
+ {% if active %}
+
+ {% trans "Mostrando apenas anexos recem-criados" %}
+
+
{% trans "Ver todos" %}
+ {% endif %}
+
+
+
+ {% with anexos.first as anexo %}
+ {{ anexo|verbose_name:"descricao"|title }} |
+ {{ anexo|verbose_name:"data_pub"|title }} |
+ {{ anexo|verbose_name:"arquivo"|title }} |
+ {% endwith %}
+
+
+
+ {% for anexo in anexos.all %}
+
+ {{ anexo.descricao }} |
+ {{ anexo.data_pub|date:"SHORT_DATE_FORMAT" }} |
+
+
+ picture_as_pdf
+
+ |
+
+ {% endfor %}
+
+
+ {% endif %}
+
diff --git a/sigi/apps/home/views.py b/sigi/apps/home/views.py
index c5d8265..282b035 100644
--- a/sigi/apps/home/views.py
+++ b/sigi/apps/home/views.py
@@ -208,12 +208,16 @@ def openmapsearch(request):
tipo__legislativo=True, search_text__icontains=to_ascii(q)
)[:10]
dados = dados.values(
- "id", "nome", "municipio__latitude", "municipio__longitude"
+ "id",
+ "nome",
+ "municipio__uf__sigla",
+ "municipio__latitude",
+ "municipio__longitude",
)
dados = [
{
"id": d["id"],
- "label": d["nome"],
+ "label": f"{d['nome']} - {d['municipio__uf__sigla']}",
"lat": d["municipio__latitude"],
"lng": d["municipio__longitude"],
}
diff --git a/sigi/static/js/search.js b/sigi/static/js/search.js
index a5a7eb0..6d696fd 100644
--- a/sigi/static/js/search.js
+++ b/sigi/static/js/search.js
@@ -12,17 +12,16 @@ $(document).ready(function () {
query_param[param_name] = term;
if (term.length < 3) {
- $resultbox.html("");
+ $resultbox.empty();
$resultbox.addClass("hide");
return;
}
$.get(url, query_param, function (data) {
- $resultbox.html("");
+ $resultbox.empty();
for (i in data) {
var plain = JSON.stringify(data[i]);
- var $item = $(`
`);
- $item.html(data[i].label);
+ var $item = $(`
${data[i].label}`);
$resultbox.append($item);
}
$resultbox.removeClass("hide");
@@ -31,7 +30,7 @@ $(document).ready(function () {
var plain = $(this).attr("data-retrieved");
var obj = JSON.parse(plain);
$this.val(obj.label);
- $resultbox.html("").addClass("hide");
+ $resultbox.empty().addClass("hide");
callback(obj);
});
});