diff --git a/sapl/compilacao/views.py b/sapl/compilacao/views.py index 7e36b32ae..e1eea02f4 100644 --- a/sapl/compilacao/views.py +++ b/sapl/compilacao/views.py @@ -2894,13 +2894,15 @@ class TextNotificacoesView(CompMixin, ListView, FormView): _('Dispositivo está substituindo um Dispositivo de outro ' 'Texto Articulado.')) - padd(r, type_notificacao, 'compilacao:dispositivo_edit_alteracao', + padd(r, type_notificacao, + 'sapl.compilacao:dispositivo_edit_alteracao', r.dispositivo_substituido and r.dispositivo_substituido.dispositivo_subsequente != r, _('Dispositivo está substituindo um Dispositivo que não ' 'possui este como seu Dispositivo Subsequente.')) - padd(r, type_notificacao, 'compilacao:dispositivo_edit_alteracao', + padd(r, type_notificacao, + 'sapl.compilacao:dispositivo_edit_alteracao', r.dispositivo_subsequente and r.dispositivo_subsequente.dispositivo_substituido != r, _('Dispositivo foi substituído por outro que não ' diff --git a/sapl/static/js/compilacao_edit.js b/sapl/static/js/compilacao_edit.js index 47632da05..a94a43f6c 100644 --- a/sapl/static/js/compilacao_edit.js +++ b/sapl/static/js/compilacao_edit.js @@ -15,7 +15,17 @@ function DispositivoEdit() { return instance; }; - instance.bindActionClick = function(event) { + instance.bindActionsEditorType = function(event) { + editortype = this.getAttribute('editortype'); + SetCookie("editortype", editortype, 30); + var dpt = $(this).closest('.dpt'); + + var pk = dpt.attr('pk'); + instance.clearEditSelected(); + instance.triggerBtnDptEdit(pk); + } + + instance.bindActionsClick = function(event) { var pk = this.getAttribute('pk'); var form_data = { @@ -68,7 +78,6 @@ function DispositivoEdit() { instance.clearEditSelected(); instance.loadActionsEdit(dpt); - dpt.on('get_form_base', function () { var _this = $(this); _this.addClass('dpt-selected'); @@ -83,7 +92,7 @@ function DispositivoEdit() { var btns_excluir = _this.find('.btns-excluir'); _this.find('.dpt-actions-bottom').last().append(btns_excluir); - btns_excluir.find('.btn-excluir').on('click', instance.bindActionClick); + btns_excluir.find('.btn-excluir').on('click', instance.bindActionsClick); }); instance.loadForm(dpt, 'get_form_base'); } @@ -93,23 +102,27 @@ function DispositivoEdit() { var url = pk+'/refresh?action=get_actions'; $.get(url).done(function(data) { dpt.find('.dpt-actions').first().html(data); - dpt.find('.btn-inserts').on('click', instance.bindActionClick); + dpt.find('.btn-inserts').on('click', instance.bindActionsClick); + dpt.find('.btn-editor-type').on('click', instance.bindActionsEditorType); + + if (editortype == 'construct') + dpt.find('.btn-group-inserts').first().addClass('open'); + }); } - instance.loadForm = function(dpt, trigger) { var pk = dpt.attr('pk'); - if (editortype == "construct") - return; var dpt_form = dpt.children().filter('.dpt-form'); if (dpt_form.length == 1) { var url = pk+'/refresh?action='+trigger; $.get(url).done(function(data) { - dpt_form.html(data); - dpt_form.find('form').submit(instance.onSubmitEditFormBase); - if (editortype == 'tinymce' ) { - initTinymce(); + if (editortype != "construct") { + dpt_form.html(data); + dpt_form.find('form').submit(instance.onSubmitEditFormBase); + if (editortype == 'tinymce' ) { + initTinymce(); + } } dpt.trigger(trigger); }).always(function() { @@ -230,6 +243,7 @@ function DispositivoEdit() { var dpt = $('#id'+pk).closest('.dpt'); dpt = $('#'+dpt.replaceWith(data).attr('id')); instance.onClicks(dpt); + instance.reloadFunctionsDraggables(); if (trigger_edit_pk > 0) instance.triggerBtnDptEdit(trigger_edit_pk) @@ -320,7 +334,7 @@ function DispositivoEdit() { editortype = "textarea" SetCookie("editortype", editortype, 30) } - editortype = "textarea"; + //editortype = "textarea"; instance.offClicks(); instance.onClicks(); instance.reloadFunctionsDraggables(); diff --git a/sapl/static/styles/app.scss b/sapl/static/styles/app.scss index 88cb0cebf..27830c7e1 100644 --- a/sapl/static/styles/app.scss +++ b/sapl/static/styles/app.scss @@ -145,11 +145,6 @@ fieldset { } } } -.btn-primary, .btn-danger{ - font-size: 16px; - height: 40px !important; - display: inline-block; -} /* INDEX */ #conteudo { diff --git a/sapl/static/styles/compilacao.scss b/sapl/static/styles/compilacao.scss index 03f100fdb..77ae12e84 100644 --- a/sapl/static/styles/compilacao.scss +++ b/sapl/static/styles/compilacao.scss @@ -529,12 +529,20 @@ a:link:after, a:visited:after { right: 0px; z-index: 3; opacity: 0; + + .activate { + display:none; + } + .deactivate { + display:inline; + } } & > .dpt-actions, & > .dpt-actions-bottom { display: none; } & > .dpt-text { cursor: pointer; + min-height: 31px; &:hover { color: $color_buttons; transition: color 0.3s ease; @@ -550,6 +558,7 @@ a:link:after, a:visited:after { } &:hover { + background-color: rgba(0, 0, 0, 0.01); & > .dpt-actions-fixed { opacity: 1; } @@ -610,10 +619,11 @@ a:link:after, a:visited:after { } .dpt-selected { &.dpt { - margin: -0.2em -0.5em; + margin: 0em -0.5em; } } } /* fim dpt-alts */ + .dpt-selected { &.dpt { width: auto !important; @@ -699,21 +709,34 @@ a:link:after, a:visited:after { .dpt { box-shadow: 0 0 0; } - - } & > .dpt-actions-fixed { - display: none; - + opacity: 1; + margin-top: -1em; + margin-right: -0.5em; + .activate { + display:inline; + } + .deactivate { + display:none; + } + .btn-dpt-edit { + background-color: #02baf2; + color: white; + border: 0; + font-weight: bold; + } } .dropdown-menu { - right: auto !important; - left: 0; - padding: 2px 0; - & > .top.arrow { - right: 88%; - left: auto; + &.dropdown-menu-left { + right: auto !important; + left: 0; + padding: 2px 0; + & > .top.arrow { + right: 88%; + left: auto; + } } li { a { @@ -723,11 +746,16 @@ a:link:after, a:visited:after { } } } + .btn-group { + .radius-right { + border-bottom-right-radius: 4px !important; + border-top-right-radius: 4px !important; + } + + } &:hover { - .dpt-actions-fixed { - margin-top: 1em; - margin-right: 1em; + .dpt-actions-fixed { } } diff --git a/sapl/templates/compilacao/ajax_actions_dinamic_edit.html b/sapl/templates/compilacao/ajax_actions_dinamic_edit.html index efab7f4ee..96ddf65d6 100644 --- a/sapl/templates/compilacao/ajax_actions_dinamic_edit.html +++ b/sapl/templates/compilacao/ajax_actions_dinamic_edit.html @@ -1,19 +1,19 @@ {% load i18n %} -