Browse Source

front-end de alternancia de dispositivos alterados

pull/469/head
LeandroRoberto 9 years ago
parent
commit
4392b97d45
  1. 5
      compilacao/views.py
  2. 4
      parlamentares/views.py
  3. 16
      static/js/compilacao_edit.js
  4. 7
      static/styles/compilacao.scss

5
compilacao/views.py

@ -1,6 +1,6 @@
import sys
from collections import OrderedDict
from datetime import datetime, timedelta
import sys
from braces.views import FormMessagesMixin
from django import forms
@ -37,7 +37,6 @@ from compilacao.models import (Dispositivo, Nota,
from compilacao.utils import DISPOSITIVO_SELECT_RELATED
from crud.base import Crud, CrudListView, make_pagination
TipoNotaCrud = Crud.build(TipoNota, 'tipo_nota')
TipoVideCrud = Crud.build(TipoVide, 'tipo_vide')
TipoPublicacaoCrud = Crud.build(TipoPublicacao, 'tipo_publicacao')
@ -134,7 +133,7 @@ def choice_models_in_extenal_views():
class CompMixin:
@property
def title(self):
def title(self):
try:
return self.get_object()
except:

4
parlamentares/views.py

@ -10,8 +10,8 @@ import crud.masterdetail
from crud.base import Crud
from crud.masterdetail import MasterDetailCrud
from .forms import (FiliacaoForm, LegislaturaForm,
ParlamentarCreateForm, ParlamentarForm)
from .forms import (FiliacaoForm, LegislaturaForm, ParlamentarCreateForm,
ParlamentarForm)
from .models import (CargoMesa, Coligacao, ComposicaoMesa, Dependente,
Filiacao, Legislatura, Mandato, NivelInstrucao,
Parlamentar, Partido, SessaoLegislativa, SituacaoMilitar,

16
static/js/compilacao_edit.js

@ -266,17 +266,23 @@ function reloadFunctionClicks() {
$('#editdi_texto').focus();
$( ".bloco_alteracao" ).sortable({
revert: true,
stop: function( event, ui ) {
var pk = ui.item.attr('pk');
var pk_bloco = ui.item.closest('.bloco').closest('.dpt').attr('pk');
console.log(pk+ ' - '+ pk_bloco);
},
stop: function( event, ui ) {
var pk = ui.item.attr('pk');
var pk_bloco = ui.item.closest('.bloco').closest('.dpt').attr('pk');
console.log(pk+ ' - '+ pk_bloco);
},
});
$( ".bloco_alteracao .dpt" ).draggable({
connectToSortable: ".bloco_alteracao",
revert: 'invalid',
zIndex: 1,
drag: function( event, ui ) {
$( ".bloco_alteracao" ).css('border-width', '2px');
},
stop: function( event, ui ) {
$( ".bloco_alteracao" ).css('border-width', '0px');
},
});
$( ".bloco_alteracao" ).disableSelection();

7
static/styles/compilacao.scss

@ -563,12 +563,13 @@ a:link:after, a:visited:after {
.bloco_alteracao {
margin: 1em 0;
padding: 0em ;
background-color: #edf0f1;
min-height: 36px;
background-color: transparent;
min-height: 100px;
border: 0px dashed #d9ddde;
.dpt {
width: 100% !important;
box-shadow: 0 -1px 0 #e5e5e5, 0 0 2px rgba(0,0,0,.12),0 2px 4px rgba(0,0,0,.24);
padding: 0em 1em;
padding: 0.3em 1em;
margin: 1px 0;
background-color: #edf0f1;
z-index: 1;

Loading…
Cancel
Save