Browse Source

Improvements in interface editing of Dispositivo

pull/10/head
LeandroRoberto 9 years ago
parent
commit
d919e1aa24
  1. 6
      compilacao/views.py
  2. 191
      static/js/compilacao.js
  3. 223
      static/styles/compilacao.scss
  4. 10
      static/styles/compilacao_tinymce.css
  5. 190
      templates/compilacao/edit.html
  6. 112
      templates/compilacao/edit_bloco.html

6
compilacao/views.py

@ -389,13 +389,13 @@ class DispositivoEditView(CompilacaoEditView, FormMixin):
else:
d_base = Dispositivo.objects.get(pk=self.pk_add)
result = [{'tipo_insert': 'Inserir Depois',
result = [{'tipo_insert': '↷  Inserir Depois',
'action': 'add_next',
'itens': []},
{'tipo_insert': 'TODO: Inserir Dentro',
{'tipo_insert': '⇲  TODO: Inserir Dentro',
'action': 'add_in',
'itens': []},
{'tipo_insert': 'TODO: Inserir Antes',
{'tipo_insert': '↶  TODO: Inserir Antes',
'action': 'add_prior',
'itens': []}
]

191
static/js/compilacao.js

@ -0,0 +1,191 @@
$(document).ready(function() {
var flag_add_next = false
var flag_add_next_pk = 0
var flag_add_next_pai = 0
var withTinymce = false
var onSubmitEditForm = function(event) {
var texto = ''
var editorTiny = tinymce.get('editdi_texto')
if (editorTiny != null)
texto = editorTiny.getContent();
else
texto = $('#editdi_texto').val();
var formData = {
'csrfmiddlewaretoken' : $('input[name=csrfmiddlewaretoken]').val(),
'texto' : texto
};
var url = $('.editdi_form form').attr( "action_ajax" );
$("#message_block").css("display", "block");
$.post(url,formData)
.done(function(data) {
$('.editselected').html(data);
clearEditSelected();
reloadFunctionClicks();
}).always(function() {
$("#message_block").css("display", "none");
});
event.preventDefault();
}
var clickEditDispositivo = function(event) {
var _pk = event.currentTarget.getAttribute('pk');
if ($('#de'+_pk).hasClass("editselected")) {
clearEditSelected();
return;
}
clearEditSelected();
clickUpdateDispositivo(event)
}
var clickUpdateDispositivo = function(event, __pk, __action, addeditselected) {
var _pk = __pk;
var _action = __action;
var _variacao = '';
var _tipo_pk = '';
if (event != null) {
_pk = event.currentTarget.getAttribute('pk');
_action = $(this).attr('action');
_variacao = $(this).attr('variacao');
_tipo_pk = $(this).attr('tipo_pk');
}
if (flag_add_next_pk == 0)
flag_add_next_pk = _pk
var url = ''
if (_action == '')
return
else if ( _action == null || _action.startsWith('refresh')) {
if (_action != null && _action.endsWith('tinymce'))
withTinymce = true;
else if (_action != null && _action.endsWith('textarea'))
withTinymce = false;
url = _pk+'/refresh?pkadd='+flag_add_next_pk+url;
}
else {
url = _pk+'/actions?action='+_action;
url += '&tipo_pk='+_tipo_pk;
url += '&variacao='+_variacao;
if (addeditselected == null || addeditselected) {
$("#message_block").css("display", "block");
}
}
$.get(url).done(function( data ) {
if ( _action == null || _action.startsWith('refresh')) {
if (flag_add_next) {
if (addeditselected)
clearEditSelected();
$( '#de' + _pk ).html( data);
flag_add_next = false
}
else {
clearEditSelected();
$( '#de' + _pk ).prepend( data );
}
reloadFunctionClicks();
if ( withTinymce ) {
initTinymce()
}
else {
$('.editdi_form form').submit(onSubmitEditForm);
}
if (addeditselected == null || addeditselected) {
$('#de'+flag_add_next_pk).addClass('editselected');
$('html, body').animate({
scrollTop: $('#de' + flag_add_next_pk ).offset().top - window.innerHeight / 10
}, 300);
flag_add_next_pk = 0;
}
}
else if (_action == 'add_next') {
clearEditSelected();
flag_add_next_pk = data.pk;
flag_add_next_pai = data.pai;
if (flag_add_next_pk != null)
for (var pai = 0; pai < flag_add_next_pai.length; pai++)
if (flag_add_next_pai[pai] != -1) {
flag_add_next = true;
flag_add_next_pk = data.pk;
clickUpdateDispositivo(null, flag_add_next_pai[pai], 'refresh', pai == 0);
}
else {
href = location.href.split('#')[0]
location.href = href+'#'+flag_add_next_pk
location.reload(true)
}
else {
alert('Erro na inserção!');
flag_add_next_pk = 0;
flag_add_next = false;
}
}
}).always(function() {
$("#message_block").css("display", "none");
});
}
function clearEditSelected() {
tinymce.remove();
$('.editselected').removeClass('editselected');
$('.editdi_form').remove();
$('.editselected .label_pai, .edit .label_pai').remove();
$('.editselected .actions_head, .edit .actions_head').remove();
$('.editselected .actions_footer, .edit .actions_footer').remove();
}
function reloadFunctionClicks() {
$('.dispositivo .edit .di').off();
$('.actions .btn-action').off();
$('.actions_head .btn-action').off();
$('.dispositivo .edit .di').on('click', clickEditDispositivo);
$('.actions .btn-action').on('click', clickEditDispositivo);
$('.actions_head .btn-action').on('click', clickUpdateDispositivo);
}
function initTinymce() {
tinymce.init({
mode : "textareas",
force_br_newlines : false,
force_p_newlines : false,
forced_root_block : '',
plugins: ["table save code"],
menubar: "edit format table tools",
toolbar: "save | undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent",
tools: "inserttable",
save_onsavecallback: onSubmitEditForm,
border_css: "/static/styles/compilacao_tinymce.css",
content_css: "/static/styles/compilacao_tinymce.css"
});
}
reloadFunctionClicks();
$("#message_block").css("display", "none");
});

223
static/styles/compilacao.scss

@ -241,12 +241,12 @@
color: #fff;
position: absolute;
padding: 0 0.2em;
left: -2.1em;
left: -2.2em;
opacity: 0;
transition: all 0.4s ease-in-out;
}
.compilacaoedit .edit > .actions a.btn-action {
.compilacaoedit .edit > .actions a.btn-inserts {
background: #3498db;
background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
background-image: -moz-linear-gradient(top, #3498db, #2980b9);
@ -256,14 +256,13 @@
-webkit-border-radius: 7;
-moz-border-radius: 7;
border-radius: 7px;
color: #ffffff !important;
font-size: 18px;
color: #ffffff !important;
font-weight: bold;
padding: 2px 6px 2px 7px;
text-decoration: none;
}
.compilacaoedit .edit > .actions a.btn-action:hover {
.compilacaoedit .edit > .actions a.btn-inserts:hover {
background: #3cb0fd;
background-image: -webkit-linear-gradient(top, #3cb0fd, #3498db);
background-image: -moz-linear-gradient(top, #3cb0fd, #3498db);
@ -310,9 +309,8 @@
}
.compilacaoedit .articulacao{
margin-left: -0.8em;
.compilacaoedit .articulacao{
margin-left: -0.8em;
margin-top: 2em;
}
@ -329,16 +327,9 @@
display: none;
}
.compilacaoedit .editselected > .editdi {
padding: 1em;
}
.compilacaoedit .editdi_form {
display: block;
clear: both;
padding: 1em;
padding-top: 1em;
}
.compilacaoedit .editselected > .label_pai {
position: absolute;
color: #999;
@ -350,9 +341,8 @@
}
.compilacaoedit .editselected {
border: 2.1em solid #eee;
padding: 0 0 1em 0;
padding-bottom: 0em;
border: 2.2em solid #eee;
padding: 1em;
margin: 1em -2em 1em -2.8em;
z-index: 1;
background-color: #fff !important;
@ -364,61 +354,56 @@
}
.compilacaoedit .actions_head {
.compilacaoedit .actions_inserts {
color: #fff;
position: relative;
opacity: 0;
transition: all 0.4s ease-in-out;
border-top: 1px solid #2980b9;
z-index: 9;
margin: 0em;
position: relative;
transition: all 0.4s ease-in-out;
margin: 0em;
}
.compilacaoedit .actions_head ul {
.compilacaoedit .actions_inserts ul {
margin-left: 0;
}
.compilacaoedit .actions_head li {
.compilacaoedit .actions_inserts li {
font-weight: normal !important;
display: inline-block;
position: relative;
white-space:nowrap;
max-width:something;
white-space:nowrap;
}
.compilacaoedit .actions_head > li.left {
.compilacaoedit .actions_inserts > li.left {
border-right: 1px solid white;
}
.compilacaoedit .actions_head > li.right {
width: 3em;
.compilacaoedit .actions_inserts > li.right {
min-width: 2em;
text-align: center;
}
.compilacaoedit .actions_head > li.right:nth-child(3n + 1) {
clear:right;
}
.compilacaoedit .actions_head li ul {
.compilacaoedit .actions_inserts li ul {
display: none;
position:absolute;
top: auto;
}
.compilacaoedit .actions_head li:hover ul{
.compilacaoedit .actions_inserts li:hover ul{
display: block;
}
.compilacaoedit .actions_head li:hover ul li{
.compilacaoedit .actions_inserts li:hover ul li{
display: block;
background: #3498db;
background-image: none;
}
.compilacaoedit .actions_head a.btn-action {
.compilacaoedit .actions_inserts {
z-index: 99;
}
.compilacaoedit a.btn-inserts {
background: #3498db;
background-image: -webkit-linear-gradient(top, #3498db, #2980b9);
background-image: -moz-linear-gradient(top, #3498db, #2980b9);
@ -430,12 +415,15 @@
border-radius: 0px;
color: #ffffff !important;
font-size: 0.8em;
padding: 1px 6px 2px 7px;
padding: 0 6px 0 7px;
text-decoration: none;
display: block;
display: block;
line-height: 1.7em;
min-height: 1.7em;
margin: 0;
}
.compilacaoedit .actions_head a.btn-action:hover {
.compilacaoedit a.btn-inserts:hover {
background: #3cb0fd;
background-image: -webkit-linear-gradient(top, #3cb0fd, #3498db);
background-image: -moz-linear-gradient(top, #3cb0fd, #3498db);
@ -443,22 +431,114 @@
background-image: -o-linear-gradient(top, #3cb0fd, #3498db);
background-image: linear-gradient(to bottom, #3cb0fd, #3498db);
text-decoration: none;
}
}
.compilacaoedit .actions_head > li > a.btn-action {
font-weight: bold;
.compilacaoedit .actions_inserts > li >a.btn-inserts {
line-height: 2.2em;
min-height: 2.2em;
font-size: 1em;
padding: 0 1em;
}
.compilacaoedit .editdi_form input[type=submit] {
margin: 0;
padding: 0.35em 2em;
}
.compilacaoedit .editdi_form a.alert {
background-image: none;
background-color: #A70808 !important;
color: #c99 !important;
font-weight: normal !important;
margin: 0;
padding: 0.35em 2em;
}
.compilacaoedit .actions_head {
z-index: 99;
opacity: 0.5;
.compilacaoedit .editdi_form a.alert:hover {
background-image: none;
background-color: #c70808 !important;
color: #ecc !important;
}
.compilacaoedit .actions_head:hover {
opacity: 1;
}
.compilacaoedit .actions_head {
margin: -2.2em -2.2em 0 0;
position: absolute;
top: 0;
right: 0;
list-style: none;
display: table;
z-index: 98;
}
.compilacaoedit .actions_head > li{
float: right;
}
.compilacaoedit a.btn-action {
display: table-cell;
font-size: 1em;
background-image: none;
background-color: transparent !important;
color: #615151 !important;
vertical-align: middle;
line-height: 2.2em;
min-width: 2.2em;
text-align: center;
text-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.compilacaoedit a.btn-action:hover {
background-color: rgba(0,0,0,0.1) !important;
text-shadow: 0 0 5px #777;
color: #fff !important;
}
.compilacaoedit .actions_right {
margin: 0 -2.2em 0 0;
position: absolute;
top: 0;
right: 0;
list-style: none;
display: table;
z-index: 9;
}
.compilacaoedit .editdi_form {
display: block;
clear: both;
margin: -1em;
}
.compilacaoedit .editdi_form textarea {
margin: 0;
resize: vertical;
min-height: 12.5em;
}
.compilacaoedit .actions_insert {
opacity: 1;
@ -471,21 +551,15 @@
}
.compilacaoedit .actions_insert > li.right{
opacity: 1;
width: 3em;
text-align: center;
}
.compilacaoedit .actions_insert > li.right:nth-child(3n + 1) {
clear:right;
}
opacity: 1;
text-align: center;
}
.compilacaoedit .actions_insert > li.left:nth-child(1),
.compilacaoedit .actions_insert > li.left:nth-child(2) {
opacity: 1;
display: block;
min-width: 30%;
max-width: 30%;
min-width: 33%;
max-width: 33%;
}
.compilacaoedit .actions_insert li.left:nth-child(1) ul,
.compilacaoedit .actions_insert li.left:nth-child(2) ul {
@ -518,18 +592,15 @@
display: block;
height: auto !important;
}
.clear {
clear:both;
height: 0;
width: 0;
}
#tinymce .mceContentBody p {
font-family: "Open Sans" "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif !important;
.mce-container {
border-color: #ccc !important;
}
@media only screen and (max-width: 40.0625em) {
.compilacao .fixed{

10
static/styles/compilacao_tinymce.css

@ -0,0 +1,10 @@
.mce-content-body {
font-family: "Open Sans" "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif;
font-style: normal;
font-weight: normal;
line-height: 1.5;
font-size: 1em;
color: #444444;
}

190
templates/compilacao/edit.html

@ -1,196 +1,24 @@
{% extends "base.html" %}
{% load i18n %}
{% load compilacao_filters %}
{% load staticfiles %}
{% load sass_tags %}
{% block head_content %}{{block.super}}
<script type="text/javascript" src="{% static 'js/compilacao.js' %}"></script>
{% endblock %}
{% block title%}
<h1><b>Edição:</b> {{ view.get_norma }} - <i>Texto Multivigente</i></h1>
<h1><b>Edição:</b> {{ view.get_norma }} - <i>{% trans 'Texto Multivigente' %}</i></h1>
{% endblock %}
{% block base_content %}
<script type="text/javascript">
$(document).ready(function() {
var flag_add_next = false
var flag_add_next_pk = 0
var flag_add_next_pai = 0
var withTinymce = false
clickEditDispositivo = function(event) {
var _pk = event.currentTarget.getAttribute('pk');
if ($('#de'+_pk).hasClass("editselected")) {
clearEditSelected();
return;
}
clearEditSelected();
clickUpdateDispositivo(event)
}
clickUpdateDispositivo = function(event, __pk, __action, addeditselected) {
var _pk = __pk;
var _action = __action;
var _variacao = '';
var _tipo_pk = '';
if (event != null) {
_pk = event.currentTarget.getAttribute('pk');
_action = $(this).attr('action');
_variacao = $(this).attr('variacao');
_tipo_pk = $(this).attr('tipo_pk');
}
if (flag_add_next_pk == 0)
flag_add_next_pk = _pk
var url = ''
if (_action == '')
return
else if ( _action == null || _action.startsWith('refresh')) {
if (_action != null && _action.endsWith('tinymce'))
withTinymce = true;
else if (_action != null && _action.endsWith('textarea'))
withTinymce = false;
url = _pk+'/refresh?pkadd='+flag_add_next_pk+url;
}
else {
url = _pk+'/actions?action='+_action;
url += '&tipo_pk='+_tipo_pk;
url += '&variacao='+_variacao;
if (addeditselected == null || addeditselected) {
$("#message_block").css("display", "block");
}
}
$.get(url).done(function( data ) {
if ( _action == null || _action.startsWith('refresh')) {
if (addeditselected)
clearEditSelected();
if (flag_add_next) {
$( '#de' + _pk ).html( data);
flag_add_next = false
}
else {
clearEditSelected();
$( '#de' + _pk ).prepend( data );
}
reloadFunctionClicks();
if ( withTinymce )
tinymce.init({
mode : "textareas",
force_br_newlines : false,
force_p_newlines : false,
forced_root_block : '',
plugins: "table",
tools: "inserttable",
});
if (addeditselected == null || addeditselected) {
$('#de'+flag_add_next_pk).addClass('editselected');
$('html, body').animate({
scrollTop: $('#de' + flag_add_next_pk ).offset().top - window.innerHeight / 10
}, 300);
flag_add_next_pk = 0;
}
}
<div id="message_block"><div id="msg">{% trans 'Aguarde... Atualizando informações!!!'%}</div></div>
else if (_action == 'add_next') {
clearEditSelected();
flag_add_next_pk = data.pk;
flag_add_next_pai = data.pai;
if (flag_add_next_pk != null)
for (var pai = 0; pai < flag_add_next_pai.length; pai++)
if (flag_add_next_pai[pai] != -1) {
flag_add_next = true;
flag_add_next_pk = data.pk;
clickUpdateDispositivo(null, flag_add_next_pai[pai], 'refresh', pai == 0);
}
else {
href = location.href.split('#')[0]
location.href = href+'#'+flag_add_next_pk
location.reload(true)
}
else {
alert('Erro na inserção!');
flag_add_next_pk = 0;
flag_add_next = false;
}
}
}).always(function() {
$("#message_block").css("display", "none");
});
}
function clearEditSelected() {
tinymce.remove();
$('.editselected').removeClass('editselected');
$('.editdi_form').remove();
$('.editselected .label_pai, .edit .label_pai').remove();
$('.editselected .actions_head, .edit .actions_head').remove();
$('.editselected .actions_footer, .edit .actions_footer').remove();
}
function reloadFunctionClicks() {
$('.dispositivo .edit .di').off();
$('.actions .btn-action').off();
$('.actions_head .btn-action').off();
$('.dispositivo .edit .di').on('click', clickEditDispositivo);
$('.actions .btn-action').on('click', clickEditDispositivo);
$('.actions_head .btn-action').on('click', clickUpdateDispositivo);
$('.editdi_form form').submit(function(event) {
var texto = ''
var editorTiny = tinymce.get('editdi_texto')
if (editorTiny != null)
texto = editorTiny.getContent();
else
texto = $('#editdi_texto').val();
var formData = {
'csrfmiddlewaretoken' : $('input[name=csrfmiddlewaretoken]').val(),
'texto' : texto
};
var $form = $( this ),
url = $form.attr( "action" );
$("#message_block").css("display", "block");
$.post(url,formData)
.done(function(data) {
$('.editselected').html(data);
clearEditSelected();
reloadFunctionClicks();
}).always(function() {
$("#message_block").css("display", "none");
});
event.preventDefault();
});
}
reloadFunctionClicks();
$("#message_block").css("display", "none");
});
</script>
<div id="message_block"><div id="msg">Aguarde... Atualizando informações!!!</div></div>
<div class="compilacaoedit">
{% include 'compilacao/edit_bloco.html'%}
</div>
{% endblock base_content %}

112
templates/compilacao/edit_bloco.html

@ -13,59 +13,70 @@
<div class="dispositivo edit" id="de{{dispositivo.pk}}" pk="{{dispositivo.pk}}">
{% endif%}
{% if view|render_actions_head:dispositivo %}
<ul class="right actions_head {% if dispositivo.texto == ''%}actions_insert{%endif%}">
<div class="editdi_form">
<form method="post" action="" action_ajax="{{dispositivo.pk}}/refresh">
<ul class="actions_head {% if dispositivo.tipo_dispositivo.dispositivo_de_articulacao %}actions_insert{%endif%}">
{% if not dispositivo.tipo_dispositivo.dispositivo_de_articulacao %}
<li class=""><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh:detail" title="TODO: Edição detalhada">E*</a></li>
<li class=""><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh:tinymce" title="Editar o texto com TinyMCE">E+</a></li>
<li class=""><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh:textarea" title="Edição simples apenas do texto">E</a></li>
{%endif%}
</ul>
<ul class="actions_right {% if dispositivo.tipo_dispositivo.dispositivo_de_articulacao %}actions_insert{%endif%}">
<li class="right clear"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Reduzir nível do Dispositivo">&#10092;</a></li>
<li class="right clear"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Aumentar nível do Dispositivo">&#10093;</a></li>
<li class="right clear"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Descer uma posição">&#8595;</a></li>
<li class="right clear"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Subir uma posição">&#8593;</a></li>
<li class="right clear"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Subir uma posição com todos os subniveis">&#8648;</a></li>
<li class="right clear"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Descer uma posição com todos os subniveis">&#8650;</a></li>
</ul>
{% if not dispositivo.tipo_dispositivo.dispositivo_de_articulacao %}
{% csrf_token %}
<textarea id="editdi_texto" name="texto" rows="7">{{ dispositivo.texto|safe }}</textarea>
{%endif%}
{% if not dispositivo.tipo_dispositivo.dispositivo_de_articulacao %}
<li class="right"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh:detail" title="TODO: Edição detalhada">E++</a></li>
<li class="right"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh:tinymce" title="Editar o texto com TinyMCE">E+</a></li>
<li class="right"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh:textarea" title="Edição simples apenas do texto">E</a></li>
{% endif%}
<li class="right"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Subir uma posição com todos os subniveis">&#8593;&#8593;</a></li>
<li class="right"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Subir uma posição">&#8593;</a></li>
<li class="right"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Aumentar nível do Dispositivo">&gt;</a></li>
<li class="right"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Descer uma posição com todos os subniveis">&#8595;&#8595;</a></li>
<li class="right"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Descer uma posição">&#8595;</a></li>
<li class="right"><a class="btn-action" pk="{{dispositivo.pk}}" action="refresh" title="TODO: Reduzir nível do Dispositivo">&lt;</a></li>
</ul>
<ul class="actions_inserts {% if dispositivo.texto == ''%}actions_insert{%endif%}">
{% for inserts in view.select_provaveis_inserts%}
<li class="left" ><a class="btn-inserts" action="" pk="{{dispositivo.pk}}">{{inserts|get_field:'tipo_insert'|safe}}</a>
<ul id="afe{{dispositivo.id}}" >
{% for item in inserts|get_field:'itens' %}
<li><a class="btn-inserts" action="{{inserts|get_field:'action'}}" pk="{{item|get_field:'dispositivo_base'}}" variacao="{{item|get_field:'variacao'}}" tipo_pk="{{item|get_field:'tipo_pk'}}">{{item|get_field:'provavel'}}</a></li>
{% endfor %}
</ul>
</li>
{% endfor %}
{% if not dispositivo.tipo_dispositivo.dispositivo_de_articulacao %}
<li class="right"><input type="submit" value="Salvar" class="button primary btn-action" /></li>
{%endif%}
<li class="right"><a href="#" class="button alert">Excluir</a></li>
<ul class="actions_head {% if dispositivo.texto == ''%}actions_insert{%endif%}">
{% for inserts in view.select_provaveis_inserts%}
<li class="left" ><a class="btn-action" action="" pk="{{dispositivo.pk}}">{{inserts|get_field:'tipo_insert'}}</a>
<ul id="afe{{dispositivo.id}}" >
{% for item in inserts|get_field:'itens' %}
<li><a class="btn-action" action="{{inserts|get_field:'action'}}" pk="{{item|get_field:'dispositivo_base'}}" variacao="{{item|get_field:'variacao'}}" tipo_pk="{{item|get_field:'tipo_pk'}}">{{item|get_field:'provavel'}}</a></li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
<div class="actions_footer" >
<div class="left">Ordem: {{dispositivo.ordem}}, nivel: {{dispositivo.nivel}}</div>
<div class="right">Número: {{dispositivo.get_numero_completo}}</div>
</div>
<div class="label_pai">
<div class="left">Em Edição: {% nomenclatura_heranca dispositivo %} </div>
<div class="right"></div>
</div>
</ul>
</form>
</div>
<div class="actions_footer" >
<div class="left">Ordem: {{dispositivo.ordem}}, nivel: {{dispositivo.nivel}}</div>
<div class="right">Número: {{dispositivo.get_numero_completo}}</div>
</div>
<div class="label_pai">
<div class="left">Em Edição: {% nomenclatura_heranca dispositivo %} </div>
<div class="right"></div>
</div>
{% endif%}
{% if view.pk_view == 0 and view.pk_add == 0 or view.pk_add != view.pk_view %}
<div class="actions">
<a class="btn-action" pk="{{dispositivo.pk}}" title="Edição do dispositivo: {{ dispositivo.tipo_dispositivo.nome }} {{ dispositivo.rotulo }}">E</a>
<a class="btn-inserts" pk="{{dispositivo.pk}}" title="Edição do dispositivo: {{ dispositivo.tipo_dispositivo.nome }} {{ dispositivo.rotulo }}">E</a>
</div>
<div class="editdi {% dispositivo_desativado dispositivo view.inicio_vigencia view.fim_vigencia %} {{ dispositivo.tipo_dispositivo.class_css }}">
{% spaceless %}
@ -88,22 +99,7 @@
{%endwith%}
{% endif%}
</div>
{% else%}
{% if not dispositivo.tipo_dispositivo.dispositivo_de_articulacao %}
<div class="editdi_form">
<form style="text-align: center;" method="post" action="{{dispositivo.pk}}/refresh">
{% csrf_token %}
<textarea id="editdi_texto" name="texto" rows="10">{{ dispositivo.texto|safe }}</textarea>
<br>
<input type="submit" value="Salvar" class="button primary" />
</form>
<div class="clear"></div>
</div>
{%endif%}
{% endif%}
{% set_nivel_old view dispositivo.nivel %}

Loading…
Cancel
Save