diff --git a/sapl/sessao/views.py b/sapl/sessao/views.py index f2256e5e7..7dfe8c2f8 100644 --- a/sapl/sessao/views.py +++ b/sapl/sessao/views.py @@ -922,17 +922,18 @@ class ResumoView(SessaoCrud.CrudDetailView): return self.render_to_response(context) -class ExpedienteView(PermissionRequiredMixin, - FormMixin, +class ExpedienteView(FormMixin, SessaoCrud.CrudDetailView): template_name = 'sessao/expediente.html' form_class = ExpedienteForm - permission_required = permissoes_sessao() def post(self, request, *args, **kwargs): self.object = self.get_object() form = ExpedienteForm(request.POST) + if not self.request.user.has_perms(permissoes_sessao()): + return self.form_invalid(form) + if form.is_valid(): list_tipo = request.POST.getlist('tipo') list_conteudo = request.POST.getlist('conteudo') diff --git a/sapl/static/js/app.js b/sapl/static/js/app.js index 4a8853cd3..127bf2b86 100644 --- a/sapl/static/js/app.js +++ b/sapl/static/js/app.js @@ -1,4 +1,4 @@ -function initTinymce(elements) { +function initTinymce(elements, readonly=false) { removeTinymce(); var config_tinymce = { force_br_newlines : false, @@ -11,6 +11,11 @@ function initTinymce(elements) { border_css: "/static/styles/style_tinymce.css", content_css: "/static/styles/style_tinymce.css", } + + if (readonly) { + config_tinymce.readonly = 1 + } + if (elements != null) { config_tinymce['elements'] = elements; config_tinymce['mode'] = "exact"; diff --git a/sapl/templates/sessao/expediente.html b/sapl/templates/sessao/expediente.html index 0ef0c6e2d..66aacb226 100644 --- a/sapl/templates/sessao/expediente.html +++ b/sapl/templates/sessao/expediente.html @@ -1,29 +1,50 @@ {% extends "crud/detail.html" %} {% load i18n %} {% load crispy_forms_tags %} +{% load common_tags %} {% block detail_content %} -
+ +{% else %} {% for e in expedientes %} - + {% endfor %} -