Browse Source

Add chamadas do botão fechar e excluir dispositivos

pull/590/head
LeandroRoberto 9 years ago
parent
commit
63ac63b179
  1. 4
      sapl/compilacao/forms.py
  2. 8
      sapl/static/js/compilacao_edit.js
  3. 14
      sapl/static/styles/compilacao.scss
  4. 4
      sapl/templates/compilacao/dispositivo_form.html

4
sapl/compilacao/forms.py

@ -656,8 +656,8 @@ class DispositivoEdicaoBasicaForm(ModelForm):
buttons = FormActions(*more, css_class='form-group')
_fields = [to_row([(buttons, 12)])] + \
[Div(*layout, css_class="row-fluid")]
_fields = [Div(*layout, css_class="row-fluid")] + \
[to_row([(buttons, 12)])]
self.helper.layout = Layout(*_fields)

8
sapl/static/js/compilacao_edit.js

@ -44,13 +44,15 @@ function DispositivoEdit() {
instance.scrollTo(_this);
_this.off('get_form_base')
var btn_fechar = _this.find('.btns-excluir');
_this.find('.dpt-actions-bottom').last().append(btn_fechar);
var btn_fechar = _this.find('.btn-fechar');
btn_fechar.on('click', function() {
instance.clearEditSelected();
});
btn_fechar.on('click', function() {
var btns_excluir = _this.find('.btns-excluir');
_this.find('.dpt-actions-bottom').last().append(btns_excluir);
btns_excluir.find('.btn-excluir').on('click', function() {
var action = this.getAttribute('action');
var pk = $(this).closest('.dpt-selected').attr('pk');
if (pk !== undefined) {

14
sapl/static/styles/compilacao.scss

@ -623,9 +623,9 @@ a:link:after, a:visited:after {
background-color: #fafafa;
border-radius: 3px;
z-index: 2;
& > .dpt-text {
& > .dpt-text1 {
opacity: 1;
border: 1px solid #e0e0e0 !important;
border: 0px solid #e0e0e0 !important;
margin: 1em;
padding: 0.3em;
position: relative;
@ -635,24 +635,24 @@ a:link:after, a:visited:after {
&:before {
border-width: 1rem;
border-style: solid;
border-color: #e0e0e0 #e0e0e0 transparent transparent;
border-color: transparent transparent #e0e0e0 #e0e0e0 ;
content: "";
display: block;
height: 0px;
width: 0px;
position: absolute;
top: 0rem;
right: 0rem;
bottom: 0rem;
left: 0rem;
}
}
& > .dpt-form {
margin-bottom: 1em;
margin-bottom: 0em;
}
& > .dpt-actions, & > .dpt-actions-bottom {
display: table;
background-color: #e5e5e5;
padding: 1em;
margin-bottom: 1em;
margin-bottom: 0em;
width: 100%;
& > .btn-action {
display: table-cell;

4
sapl/templates/compilacao/dispositivo_form.html

@ -5,7 +5,7 @@
<link rel="stylesheet" href="{% sass_src 'styles/compilacao.scss' %}" type="text/css">
{% endblock %}
{% block sections_nav %}
<ul class="nav nav-pills navbar-right">
<ul class="nav nav-pills navbar-right">
{% url 'sapl.compilacao:dispositivo_edit' object.ta_id object.pk as edit_url%}
{% url 'sapl.compilacao:dispositivo_edit_vigencia' object.ta_id object.pk as edit_vigencia_url %}
{% url 'sapl.compilacao:dispositivo_edit_alteracao' object.ta_id object.pk as edit_alteracao_url %}
@ -15,7 +15,7 @@
<li {% if request.get_full_path == edit_definidor_vigencia_url %}class="active"{%endif%}><a class="btn-danger" href="{{ edit_definidor_vigencia_url }}" >{% trans 'Definidor de Vigência' %}</a></li>
<li {% if request.get_full_path == edit_alteracao_url %}class="active"{%endif%}><a class="btn-danger" href="{{ edit_alteracao_url }}" >{% trans 'Alteração' %}</a></li>
<li><a href="#" class="btn-danger">{% trans 'Alterador' %}</a></li>
</ul>
</ul>
{% endblock sections_nav %}{% trans '' %}
{% block title %}

Loading…
Cancel
Save