Browse Source

corrige actions de compilação em normajuridica_detail

pull/3039/head
Leandro Roberto 5 years ago
parent
commit
285d917547
  1. 12
      sapl/norma/views.py
  2. 2
      sapl/static/sapl/frontend/js/compilacao.77fbad73.js
  3. BIN
      sapl/static/sapl/frontend/js/compilacao.77fbad73.js.gz
  4. BIN
      sapl/static/sapl/frontend/js/compilacao.a90234d6.js.gz
  5. 1
      sapl/templates/compilacao/subnav.html
  6. 6
      sapl/templates/compilacao/text_edit.html
  7. 6
      sapl/templates/compilacao/text_list__embedded.html
  8. 1
      sapl/templates/compilacao/textoarticulado_detail.html
  9. 3
      sapl/templates/norma/normajuridica_detail.html
  10. 2
      sapl/webpack-stats.json

12
sapl/norma/views.py

@ -267,7 +267,8 @@ class NormaCrud(Crud):
pk=self.kwargs['pk'] pk=self.kwargs['pk']
) )
# Feito desta forma para que sejam materializados os assuntos antigos # Feito desta forma para que sejam materializados os assuntos
# antigos
assuntos_antigos = set(norma_antiga.assuntos.all()) assuntos_antigos = set(norma_antiga.assuntos.all())
dict_objeto_antigo = norma_antiga.__dict__ dict_objeto_antigo = norma_antiga.__dict__
@ -288,7 +289,8 @@ class NormaCrud(Crud):
self.object.save() self.object.save()
break break
# Campo Assuntos não veio no __dict__, então é comparado separadamente # Campo Assuntos não veio no __dict__, então é comparado
# separadamente
assuntos_novos = set(self.object.assuntos.all()) assuntos_novos = set(self.object.assuntos.all())
if assuntos_antigos != assuntos_novos: if assuntos_antigos != assuntos_novos:
self.object.user = self.request.user self.object.user = self.request.user
@ -384,7 +386,8 @@ class ImpressosView(PermissionRequiredMixin, TemplateView):
def gerar_pdf_impressos(request, context, template_name): def gerar_pdf_impressos(request, context, template_name):
template = loader.get_template(template_name) template = loader.get_template(template_name)
html = template.render(context, request) html = template.render(context, request)
pdf = weasyprint.HTML(string=html, base_url=request.build_absolute_uri()).write_pdf() pdf = weasyprint.HTML(
string=html, base_url=request.build_absolute_uri()).write_pdf()
response = HttpResponse(pdf, content_type='application/pdf') response = HttpResponse(pdf, content_type='application/pdf')
response['Content-Disposition'] = 'inline; filename="relatorio_impressos.pdf"' response['Content-Disposition'] = 'inline; filename="relatorio_impressos.pdf"'
@ -411,7 +414,8 @@ class NormaPesquisaSimplesView(PermissionRequiredMixin, FormView):
kwargs.update({'data__gte': form.cleaned_data['data_inicial'], kwargs.update({'data__gte': form.cleaned_data['data_inicial'],
'data__lte': form.cleaned_data['data_final']}) 'data__lte': form.cleaned_data['data_final']})
normas = NormaJuridica.objects.filter(**kwargs).order_by('-numero', 'ano') normas = NormaJuridica.objects.filter(
**kwargs).order_by('-numero', 'ano')
quantidade_normas = normas.count() quantidade_normas = normas.count()
normas = normas[:2000] if quantidade_normas > 2000 else normas normas = normas[:2000] if quantidade_normas > 2000 else normas

2
sapl/static/sapl/frontend/js/compilacao.a90234d6.js → sapl/static/sapl/frontend/js/compilacao.77fbad73.js

File diff suppressed because one or more lines are too long

BIN
sapl/static/sapl/frontend/js/compilacao.77fbad73.js.gz

Binary file not shown.

BIN
sapl/static/sapl/frontend/js/compilacao.a90234d6.js.gz

Binary file not shown.

1
sapl/templates/compilacao/subnav.html

@ -19,7 +19,6 @@
<li class="nav-item"><a class="nav-link" href="{% url 'sapl.compilacao:ta_text_notificacoes' object.pk %}">{% trans 'Notificações' %}</a></li> <li class="nav-item"><a class="nav-link" href="{% url 'sapl.compilacao:ta_text_notificacoes' object.pk %}">{% trans 'Notificações' %}</a></li>
{% endif %} {% endif %}
{% block extra_sections_nav %} {% block extra_sections_nav %}
<li class="nav-item"><a class="nav-link" href="{% url 'sapl.compilacao:ta_text' object.pk %}">{% trans 'Texto Articulado' %}</a></li>
{% endblock %} {% endblock %}
{% endif %} {% endif %}
</ul> </ul>

6
sapl/templates/compilacao/text_edit.html

@ -10,11 +10,9 @@
{% block actions %} {% block actions %}
{% if perms.compilacao.change_textoarticulado %} {% if perms.compilacao.change_textoarticulado %}
<div class="container-actions mt-4 mb-4 justify-content-between d-flex"> <div class="container-actions mt-4 mb-4 justify-content-between d-flex">
<div class="actions btn-group" role="group"> <div class="actions btn-group" role="group">
<a class="btn btn-success" href="{% url 'sapl.compilacao:ta_text' object.pk %}">PreView</a>
{% if perms.compilacao.lock_unlock_textoarticulado and not object.editable_only_by_owners%} {% if perms.compilacao.lock_unlock_textoarticulado and not object.editable_only_by_owners%}
<a href="{% url 'sapl.compilacao:ta_text_edit' object.pk %}?{% if object.editing_locked %}unlock{%else%}lock{% endif %}" class="btn {% if object.editing_locked %}btn-outline-danger{%else%}btn-outline-primary{% endif %}">{% if object.editing_locked %}{% trans 'Desbloquear Edição' %}{%else%}{% trans 'Publicar Texto' %}{% endif %}</a> <a href="{% url 'sapl.compilacao:ta_text_edit' object.pk %}?{% if object.editing_locked %}unlock{%else%}lock{% endif %}" class="btn {% if object.editing_locked %}btn-outline-danger{%else%}btn-outline-primary{% endif %}">{% if object.editing_locked %}{% trans 'Desbloquear Edição' %}{%else%}{% trans 'Publicar Texto' %}{% endif %}</a>
{% endif %} {% endif %}

6
sapl/templates/compilacao/text_list__embedded.html

@ -4,12 +4,14 @@
<div class="cp"> <div class="cp">
{% if object_list %} {% if object_list %}
<div class="clearfix"> <div class="actions btn-group" role="group">
<a href="{{base_url}}?print" class="btn btn-outline-primary">{% trans 'Preparar para impressão' %}</a>
</div>
<div class="actions btn-group float-right" role="group"> <div class="actions btn-group float-right" role="group">
<a class="btn btn-outline-primary" id="btn_font_menos" title="Diminuir tamanho da letra">a</a> <a class="btn btn-outline-primary" id="btn_font_menos" title="Diminuir tamanho da letra">a</a>
<a class="btn btn-outline-primary" id="btn_font_mais" title="Aumentar tamanho da Letra">A</a> <a class="btn btn-outline-primary" id="btn_font_mais" title="Aumentar tamanho da Letra">A</a>
</div> </div>
</div>
{% endif %} {% endif %}
{% for key, values in view.get_vigencias.items %} {% for key, values in view.get_vigencias.items %}

1
sapl/templates/compilacao/textoarticulado_detail.html

@ -12,6 +12,7 @@
{% block actions %} {% block actions %}
<div class="context-actions justify-content-between mb-4"> <div class="context-actions justify-content-between mb-4">
<div class="actions btn-group" role="group"> <div class="actions btn-group" role="group">
<a class="btn btn-success" href="{% url 'sapl.compilacao:ta_text' object.pk %}">PreView</a>
{% if perms.compilacao.change_textoarticulado and object|can_use_dynamic_editing:user %} {% if perms.compilacao.change_textoarticulado and object|can_use_dynamic_editing:user %}
<a href="{% url 'sapl.compilacao:ta_edit' object.pk %}" class="btn btn-outline-primary">{% trans 'Editar Metadados do Texto Articulado' %}</a> <a href="{% url 'sapl.compilacao:ta_edit' object.pk %}" class="btn btn-outline-primary">{% trans 'Editar Metadados do Texto Articulado' %}</a>
{% endif %} {% endif %}

3
sapl/templates/norma/normajuridica_detail.html

@ -147,9 +147,10 @@
$.get("{% url 'sapl.compilacao:ta_text' object.texto_articulado.first.id %}?embedded", $.get("{% url 'sapl.compilacao:ta_text' object.texto_articulado.first.id %}?embedded",
function(data, status) { function(data, status) {
$('#textomultivigente').html(data) $('#textomultivigente').html(data)
$('cp a[data-toggle="dropdown"]').dropdown() //$('cp a[data-toggle="dropdown"]').dropdown()
$('.dne').remove() $('.dne').remove()
$('.dnli ul').remove() $('.dnli ul').remove()
InitViewTAs()
}); });
} }
</script> </script>

2
sapl/webpack-stats.json

@ -1 +1 @@
{"status":"done","publicPath":"/static/sapl/frontend/","chunks":{"chunk-vendors":[{"name":"css/chunk-vendors.77f33f1f.css","publicPath":"/static/sapl/frontend/css/chunk-vendors.77f33f1f.css","path":"../sapl/sapl/static/sapl/frontend/css/chunk-vendors.77f33f1f.css"},{"name":"js/chunk-vendors.9d25b83a.js","publicPath":"/static/sapl/frontend/js/chunk-vendors.9d25b83a.js","path":"../sapl/sapl/static/sapl/frontend/js/chunk-vendors.9d25b83a.js"},{"name":"css/chunk-vendors.77f33f1f.css.map","publicPath":"/static/sapl/frontend/css/chunk-vendors.77f33f1f.css.map","path":"../sapl/sapl/static/sapl/frontend/css/chunk-vendors.77f33f1f.css.map"}],"compilacao":[{"name":"css/compilacao.eff62463.css","publicPath":"/static/sapl/frontend/css/compilacao.eff62463.css","path":"../sapl/sapl/static/sapl/frontend/css/compilacao.eff62463.css"},{"name":"js/compilacao.a90234d6.js","publicPath":"/static/sapl/frontend/js/compilacao.a90234d6.js","path":"../sapl/sapl/static/sapl/frontend/js/compilacao.a90234d6.js"},{"name":"css/compilacao.eff62463.css.map","publicPath":"/static/sapl/frontend/css/compilacao.eff62463.css.map","path":"../sapl/sapl/static/sapl/frontend/css/compilacao.eff62463.css.map"}],"global":[{"name":"css/global.a77827ad.css","publicPath":"/static/sapl/frontend/css/global.a77827ad.css","path":"../sapl/sapl/static/sapl/frontend/css/global.a77827ad.css"},{"name":"js/global.e051cc2f.js","publicPath":"/static/sapl/frontend/js/global.e051cc2f.js","path":"../sapl/sapl/static/sapl/frontend/js/global.e051cc2f.js"},{"name":"css/global.a77827ad.css.map","publicPath":"/static/sapl/frontend/css/global.a77827ad.css.map","path":"../sapl/sapl/static/sapl/frontend/css/global.a77827ad.css.map"}],"painel":[{"name":"css/painel.5d957a9b.css","publicPath":"/static/sapl/frontend/css/painel.5d957a9b.css","path":"../sapl/sapl/static/sapl/frontend/css/painel.5d957a9b.css"},{"name":"js/painel.35e9809a.js","publicPath":"/static/sapl/frontend/js/painel.35e9809a.js","path":"../sapl/sapl/static/sapl/frontend/js/painel.35e9809a.js"},{"name":"css/painel.5d957a9b.css.map","publicPath":"/static/sapl/frontend/css/painel.5d957a9b.css.map","path":"../sapl/sapl/static/sapl/frontend/css/painel.5d957a9b.css.map"}]}} {"status":"done","publicPath":"/static/sapl/frontend/","chunks":{"chunk-vendors":[{"name":"css/chunk-vendors.77f33f1f.css","publicPath":"/static/sapl/frontend/css/chunk-vendors.77f33f1f.css","path":"../sapl/sapl/static/sapl/frontend/css/chunk-vendors.77f33f1f.css"},{"name":"js/chunk-vendors.9d25b83a.js","publicPath":"/static/sapl/frontend/js/chunk-vendors.9d25b83a.js","path":"../sapl/sapl/static/sapl/frontend/js/chunk-vendors.9d25b83a.js"},{"name":"css/chunk-vendors.77f33f1f.css.map","publicPath":"/static/sapl/frontend/css/chunk-vendors.77f33f1f.css.map","path":"../sapl/sapl/static/sapl/frontend/css/chunk-vendors.77f33f1f.css.map"}],"compilacao":[{"name":"css/compilacao.eff62463.css","publicPath":"/static/sapl/frontend/css/compilacao.eff62463.css","path":"../sapl/sapl/static/sapl/frontend/css/compilacao.eff62463.css"},{"name":"js/compilacao.77fbad73.js","publicPath":"/static/sapl/frontend/js/compilacao.77fbad73.js","path":"../sapl/sapl/static/sapl/frontend/js/compilacao.77fbad73.js"},{"name":"css/compilacao.eff62463.css.map","publicPath":"/static/sapl/frontend/css/compilacao.eff62463.css.map","path":"../sapl/sapl/static/sapl/frontend/css/compilacao.eff62463.css.map"}],"global":[{"name":"css/global.a77827ad.css","publicPath":"/static/sapl/frontend/css/global.a77827ad.css","path":"../sapl/sapl/static/sapl/frontend/css/global.a77827ad.css"},{"name":"js/global.e051cc2f.js","publicPath":"/static/sapl/frontend/js/global.e051cc2f.js","path":"../sapl/sapl/static/sapl/frontend/js/global.e051cc2f.js"},{"name":"css/global.a77827ad.css.map","publicPath":"/static/sapl/frontend/css/global.a77827ad.css.map","path":"../sapl/sapl/static/sapl/frontend/css/global.a77827ad.css.map"}],"painel":[{"name":"css/painel.5d957a9b.css","publicPath":"/static/sapl/frontend/css/painel.5d957a9b.css","path":"../sapl/sapl/static/sapl/frontend/css/painel.5d957a9b.css"},{"name":"js/painel.35e9809a.js","publicPath":"/static/sapl/frontend/js/painel.35e9809a.js","path":"../sapl/sapl/static/sapl/frontend/js/painel.35e9809a.js"},{"name":"css/painel.5d957a9b.css.map","publicPath":"/static/sapl/frontend/css/painel.5d957a9b.css.map","path":"../sapl/sapl/static/sapl/frontend/css/painel.5d957a9b.css.map"}]}}
Loading…
Cancel
Save