diff --git a/compilacao/forms.py b/compilacao/forms.py index 1c6f59762..6e387e29a 100644 --- a/compilacao/forms.py +++ b/compilacao/forms.py @@ -218,6 +218,7 @@ class VideForm(ModelForm): widget=forms.HiddenInput()) tipo_ta = forms.ModelChoiceField( + label='Tipo do Texto Articulado', queryset=TipoTextoArticulado.objects.all(), required=False) num_ta = forms.IntegerField( diff --git a/compilacao/views.py b/compilacao/views.py index 210aeb301..65f8ebb03 100644 --- a/compilacao/views.py +++ b/compilacao/views.py @@ -446,7 +446,7 @@ class NotasCreateView(NotaMixin, CreateView): return self.form_invalid(form) except Exception as e: print(e) - return HttpResponse("post") + return HttpResponse("error post") class NotasEditView(NotaMixin, UpdateView): @@ -489,11 +489,13 @@ class VideMixin(DispositivoSuccessUrlMixin): class VideCreateView(VideMixin, CreateView): + model = Vide template_name = 'compilacao/ajax_form.html' form_class = forms.VideForm - def post(self, request, *args, **kwargs): + def post_old(self, request, *args, **kwargs): try: + self.object = None ta_id = kwargs.pop('ta_id') dispositivo_id = kwargs.pop('dispositivo_id') form = forms.VideForm(request.POST, request.FILES, **kwargs) @@ -509,7 +511,7 @@ class VideCreateView(VideMixin, CreateView): return self.form_invalid(form) except Exception as e: print(e) - return HttpResponse("post") + return HttpResponse("error post") class VideEditView(VideMixin, UpdateView): diff --git a/sapl/settings.py b/sapl/settings.py index cc0b6ed57..c3971715d 100644 --- a/sapl/settings.py +++ b/sapl/settings.py @@ -59,8 +59,8 @@ INSTALLED_APPS = ( 'crispy_forms_foundation', 'sass_processor', ) -if DEBUG: - INSTALLED_APPS += ('debug_toolbar',) +# if DEBUG: +# INSTALLED_APPS += ('debug_toolbar',) MIDDLEWARE_CLASSES = ( 'django.contrib.sessions.middleware.SessionMiddleware', diff --git a/static/styles/compilacao.scss b/static/styles/compilacao.scss index 5d8abca8a..42c33e747 100644 --- a/static/styles/compilacao.scss +++ b/static/styles/compilacao.scss @@ -1,7 +1,8 @@ $color_actions: #16407c; $color_actions_border: #CCC; +$color_buttons: #2980B9; + @mixin background-top-down($top, $bottom) { - background: $top; background-image: -webkit-linear-gradient(top, $top, $bottom); background-image: -moz-linear-gradient(top, $top, $bottom); background-image: -ms-linear-gradient(top, $top, $bottom); @@ -220,7 +221,7 @@ a:link:after, a:visited:after { font-size: 1.15em; float:left; .dptt { - z-index: 89; + z-index: 8; position: relative; } } @@ -383,16 +384,22 @@ a:link:after, a:visited:after { .dptt { .dne { text-decoration: none; - position: relative; + position: absolute; display: block; font-size: 0.8rem; font-weight: normal; line-height: 1rem; text-align: left; height: 0; - transform: scaleY(0); - transform-origin: top; + transform: scaleX(0); + transform-origin: right; transition: all 0.3s ease; + top: 0; + left: -1.6em; + right: -1.6em; + background-color: #2980b9; + z-index: 8; + * { font-size: 0.8rem; font-weight: normal; @@ -408,27 +415,22 @@ a:link:after, a:visited:after { clip: rect(0,0,0,0); opacity: 0; transition: opacity 1.5s linear, clip 1s linear; - transition-delay: 0s; border-collapse:separate; - border-spacing:0.5em; + border-spacing: 0; + top: 0px; + right: 0px; + z-index: 9; li { display: table-cell; + background-color: $color_buttons; a { - background-color: #DDD; - border-radius: 50%; - width: 3rem; - height: 3rem; + font-size: 155%; + padding: 0.4em 0.8em; display: inline-block; - font-size: 203%; - line-height: 3rem; - text-align: center; - &.btn-nota-create { - background: #ddd url(/static/img/hand-note.png) no-repeat 50% 50%; - } - &.btn-vide-create { - } + float: right; + color: #fff !important; &:hover { - background-color: #Cdc ; + background-color: rgba(0, 0, 0, 0.15); } } } @@ -437,12 +439,15 @@ a:link:after, a:visited:after { .dne-nota { box-shadow: -4px 15px 15px rgba(0, 0, 0, 0.1), 0px 6px 6px rgba(0, 0, 0, 0.23); @include background-top-down(#f5f5f5, #eee); - - transform: scaleY(1); + position: relative; + transform: scaleX(1); height: auto; - transition-delay: 0s; + left: 0; + right: 0; margin: 1em 0 2em 0; padding: 0em; + border: 0px; + z-index: 9; ul.btns-action { display: none; } @@ -590,15 +595,13 @@ a:link:after, a:visited:after { } &:hover { .dne { - height: 4.3em; - transform: scaleY(1); - transition-delay: 1s; + height: 0.1667rem; + transform: scaleX(1); ul.btns-action { clip: rect(-100px, 2000px, 2000px, -100px); opacity: 1; transition: opacity 0.5s linear, clip 0s 0.3s; - transition-delay: 0.5s; li { a { } @@ -606,7 +609,6 @@ a:link:after, a:visited:after { } } .dne-nota { - transition-delay: 0s; height: auto; } diff --git a/templates/compilacao/dispositivo_search_fragment_form.html b/templates/compilacao/dispositivo_search_fragment_form.html index 6de6ba32d..be999ad8d 100644 --- a/templates/compilacao/dispositivo_search_fragment_form.html +++ b/templates/compilacao/dispositivo_search_fragment_form.html @@ -14,8 +14,7 @@
Vide:
- {% if dpt.is_relative_auto_insert %} + {% if vide.dispositivo_ref.dispositivo_pai.nivel != 0 and vide.dispositivo_ref.dispositivo_pai.tipo_dispositivo.dispositivo_de_articulacao %} {{ vide.dispositivo_ref.dispositivo_pai}} {% else %} {{ vide.dispositivo_ref}} @@ -80,6 +80,7 @@ {% endif %} {% if citado and citado|lookup:dpt.pk %} + {% if cita and cita|lookup:dpt.pk %}
  • {%endif%} {% for vide in citado|lookup:dpt.pk %} {%if not forloop.first %}
  • {%endif%}
  • @@ -90,7 +91,7 @@
    Citado em:
    - {% if dpt.is_relative_auto_insert %} + {% if vide.dispositivo_base.dispositivo_pai.nivel != 0 and vide.dispositivo_base.dispositivo_pai.tipo_dispositivo.dispositivo_de_articulacao%} {{ vide.dispositivo_base.dispositivo_pai}} {% else %} {{ vide.dispositivo_base}} @@ -98,13 +99,9 @@ {% if vide.texto %} - {{vide.texto}}{% endif %}
  • - {% endfor %} {% endif %} - - - {%if notas and dpt.pk in notas and dpt.pk in cita or dpt.pk in citado and notas%}
  • {%endif%} - + {%if notas and notas|lookup:dpt.pk and cita and cita|lookup:dpt.pk or notas and notas|lookup:dpt.pk and citado and citado|lookup:dpt.pk %}
  • {%endif%} {% if notas and notas|lookup:dpt.pk %} {% for nota in notas|lookup:dpt.pk %} @@ -131,16 +128,11 @@ {%if nota.titulo %}
    - {%if nota.url_externa %}{%endif%} - {{nota.titulo}} - - {%if nota.url_externa %}{%endif%} + {%if nota.url_externa %}{%endif%}{{nota.titulo}} - {%if nota.url_externa %}{%endif%}
    {%endif%} -
    - {%if nota.url_externa %}{%endif%} - {{ nota.texto}} - {%if nota.url_externa %}{%endif%} + {%if nota.url_externa %}{%endif%}{{ nota.texto}}{%if nota.url_externa %}{%endif%}
    {%comment%}