Browse Source

corrige actions de compilação em normajuridica_detail

pull/2996/head
Leandro Roberto 5 years ago
parent
commit
cf9e882e20
  1. 24
      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. 3
      sapl/templates/compilacao/textoarticulado_detail.html
  9. 3
      sapl/templates/norma/normajuridica_detail.html
  10. 1
      sapl/webpack-stats.json

24
sapl/norma/views.py

@ -274,7 +274,8 @@ class NormaCrud(Crud):
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())
dict_objeto_antigo = norma_antiga.__dict__
@ -282,11 +283,11 @@ class NormaCrud(Crud):
dict_objeto_novo = self.object.__dict__
atributos = ['tipo_id', 'numero', 'ano', 'data', 'esfera_federacao',
'complemento', 'materia_id', 'numero',
'data_publicacao', 'data_vigencia',
'veiculo_publicacao', 'pagina_inicio_publicacao',
'pagina_fim_publicacao', 'ementa', 'indexacao',
'observacao', 'texto_integral']
'complemento', 'materia_id', 'numero',
'data_publicacao', 'data_vigencia',
'veiculo_publicacao', 'pagina_inicio_publicacao',
'pagina_fim_publicacao', 'ementa', 'indexacao',
'observacao', 'texto_integral']
for atributo in atributos:
if dict_objeto_antigo[atributo] != dict_objeto_novo[atributo]:
@ -294,8 +295,9 @@ class NormaCrud(Crud):
self.object.ip = get_client_ip(self.request)
self.object.save()
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())
if assuntos_antigos != assuntos_novos:
self.object.user = self.request.user
@ -391,7 +393,8 @@ class ImpressosView(PermissionRequiredMixin, TemplateView):
def gerar_pdf_impressos(request, context, template_name):
template = loader.get_template(template_name)
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['Content-Disposition'] = 'inline; filename="relatorio_impressos.pdf"'
@ -418,7 +421,8 @@ class NormaPesquisaSimplesView(PermissionRequiredMixin, FormView):
kwargs.update({'data__gte': form.cleaned_data['data_inicial'],
'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()
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>
{% endif %}
{% 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 %}
{% endif %}
</ul>

6
sapl/templates/compilacao/text_edit.html

@ -10,11 +10,9 @@
{% block actions %}
{% if perms.compilacao.change_textoarticulado %}
<div class="container-actions mt-4 mb-4 justify-content-between d-flex">
<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%}
<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 %}

6
sapl/templates/compilacao/text_list__embedded.html

@ -4,12 +4,14 @@
<div class="cp">
{% 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">
<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>
</div>
</div>
{% endif %}
{% for key, values in view.get_vigencias.items %}

3
sapl/templates/compilacao/textoarticulado_detail.html

@ -11,7 +11,8 @@
{% block actions %}
<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 %}
<a href="{% url 'sapl.compilacao:ta_edit' object.pk %}" class="btn btn-outline-primary">{% trans 'Editar Metadados do Texto Articulado' %}</a>
{% endif %}

3
sapl/templates/norma/normajuridica_detail.html

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

1
sapl/webpack-stats.json

@ -1 +0,0 @@
{"status":"done","publicPath":"/static/sapl/frontend/","chunks":{"null":[{"name":"css/chunk-681dd124.3d0928b2.css","publicPath":"/static/sapl/frontend/css/chunk-681dd124.3d0928b2.css","path":"../sapl/sapl/static/sapl/frontend/css/chunk-681dd124.3d0928b2.css"},{"name":"js/chunk-681dd124.64f6fdc0.js","publicPath":"/static/sapl/frontend/js/chunk-681dd124.64f6fdc0.js","path":"../sapl/sapl/static/sapl/frontend/js/chunk-681dd124.64f6fdc0.js"},{"name":"css/chunk-681dd124.3d0928b2.css.map","publicPath":"/static/sapl/frontend/css/chunk-681dd124.3d0928b2.css.map","path":"../sapl/sapl/static/sapl/frontend/css/chunk-681dd124.3d0928b2.css.map"}],"chunk-vendors":[{"name":"css/chunk-vendors.7da9088b.css","publicPath":"/static/sapl/frontend/css/chunk-vendors.7da9088b.css","path":"../sapl/sapl/static/sapl/frontend/css/chunk-vendors.7da9088b.css"},{"name":"js/chunk-vendors.7a4ea0f9.js","publicPath":"/static/sapl/frontend/js/chunk-vendors.7a4ea0f9.js","path":"../sapl/sapl/static/sapl/frontend/js/chunk-vendors.7a4ea0f9.js"},{"name":"css/chunk-vendors.7da9088b.css.map","publicPath":"/static/sapl/frontend/css/chunk-vendors.7da9088b.css.map","path":"../sapl/sapl/static/sapl/frontend/css/chunk-vendors.7da9088b.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"}],"online":[{"name":"css/online.b7332556.css","publicPath":"/static/sapl/frontend/css/online.b7332556.css","path":"../sapl/sapl/static/sapl/frontend/css/online.b7332556.css"},{"name":"js/online.9ef5423a.js","publicPath":"/static/sapl/frontend/js/online.9ef5423a.js","path":"../sapl/sapl/static/sapl/frontend/js/online.9ef5423a.js"},{"name":"css/online.b7332556.css.map","publicPath":"/static/sapl/frontend/css/online.b7332556.css.map","path":"../sapl/sapl/static/sapl/frontend/css/online.b7332556.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