From 2d552ca2fcc025671ff39c5aa706a4f9ddf9884d Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Mon, 11 Jan 2016 11:31:02 -0200 Subject: [PATCH] =?UTF-8?q?Refatora=C3=A7=C3=A3o=20do=20design=20do=20sect?= =?UTF-8?q?ion-nav?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/app.js | 33 +++++++++ static/styles/app.scss | 67 ++++++++++++++++--- templates/base.html | 60 +++++++---------- .../compilacao/textoarticulado_detail.html | 28 ++++---- .../tipotextoarticulado_detail.html | 16 ++--- templates/crud/detail.html | 2 +- .../materia/materialegislativa_detail.html | 22 +++--- .../parlamentares/parlamentares_detail.html | 5 +- 8 files changed, 151 insertions(+), 82 deletions(-) create mode 100644 static/js/app.js diff --git a/static/js/app.js b/static/js/app.js new file mode 100644 index 000000000..9f265dd7d --- /dev/null +++ b/static/js/app.js @@ -0,0 +1,33 @@ + +tinymce.init({selector:'textarea'}); +$(document).foundation(); + +$(document).ready(function(){ + + + $('.dateinput').fdatepicker({ + // TODO localize + format: 'dd/mm/yyyy', + language: 'pt', + endDate: '31/12/2100', + todayBtn: true + }); + + $('.telefone').mask("(99) 9999-9999", {placeholder:"(__) ____ -____"}); + $('.cpf').mask("000.000.000-00", {placeholder:"___.___.___-__"}); + $('.cep').mask("00000-000", {placeholder:"_____-___"}); + $('.rg').mask("0.000.000", {placeholder:"_.___.___"}); + $('.titulo_eleitor').mask("0000.0000.0000.0000", {placeholder:"____.____.____.____"}); + $('.hora').mask("00:00", {placeholder:"hh:mm"}); + $('.hora_hms').mask("00:00:00", {placeholder:"hh:mm:ss"}); + + var href = location.href.split('?') + $('.masthead .sub-nav a').each(function() { + + if (href.length >= 1) { + if (href[0].endsWith($(this).attr('href'))) + $(this).parent().addClass('active') + } + }); + +}); diff --git a/static/styles/app.scss b/static/styles/app.scss index 884572eb1..4368dccc9 100644 --- a/static/styles/app.scss +++ b/static/styles/app.scss @@ -175,7 +175,7 @@ position: relative; display: table; width: 100%; height: 100%; -background-color: #e9eaed; +background-color: #fafafa; color: #444444; } @@ -202,10 +202,15 @@ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 1px 4px rgba(0, 0, 0, 0.23); vertical-align: top; } - .masthead > .container { - padding-top: 20px; - border-bottom: 20px solid $primary-color; - background-color: #ffffff; + .masthead .container { + padding: 10px 0; + background-color: #e3e3e3; + } + + .masthead > .container { + padding: 0px; + max-width: none; + border-bottom: 1px solid $primary-color; } .masthead__logo { @@ -219,19 +224,19 @@ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 1px 4px rgba(0, 0, 0, 0.23); .masthead__logo img { width: auto; - height: 95px; + height: 85px; } .masthead__heading { display: inline-block; - margin-left: 15px; - vertical-align: middle; + margin-left: 10px; + vertical-align: top; } .masthead__heading h1 { color: #333333; text-shadow: 1px 1px 3px #dadada; - font-size: 150%; + font-size: 130%; } .masthead__heading h2 { @@ -239,9 +244,51 @@ box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 1px 4px rgba(0, 0, 0, 0.23); color: #444444; text-shadow: 1px 1px 3px #dadada; font-weight: normal; - font-size: 100%; + font-size: 90%; } + + .masthead .sub-nav { + display: block; + overflow: hidden; + padding-top: 0.25rem; + width: auto; + position: absolute; + bottom: -1px; + margin: 0; + right: 0; + + + dd { + margin: 0; + border: 1px solid transparent; + border-bottom: 1px solid $primary-color; + border-top: 2px solid transparent; + border-radius: 5px 5px 0px 0px; + + a { + color: #18577A; + background-color: transparent; + display: inline-block; + padding: 2px 6px 0; + position: relative; + font-size: 90%; + &:hover { + color: #444; + background-color: transparent; + } + } + + &:hover, &.active { + background: #fff; + border: 1px solid $primary-color; + border-bottom: 1px solid #fff; + border-top: 2px solid $primary-color; + + } + } + } + .content { position: relative; display: table-cell; diff --git a/templates/base.html b/templates/base.html index 503b3bbfb..9c84d5c98 100644 --- a/templates/base.html +++ b/templates/base.html @@ -116,20 +116,28 @@ {# Header #} {% block main_header %}
-
- -
- {# XXX Make better use of translation tags in html blocks ie. actually use the proper blocktrans tag efficiently #} -

{{ parliament_type }} {% trans 'de' %} {{ city }} - {{ state }}

-

{% trans 'Sistema de Apoio ao Processo Legislativo' %}

+
+
+ +
+ {# XXX Make better use of translation tags in html blocks ie. actually use the proper blocktrans tag efficiently #} +

{{ parliament_type }} {% trans 'de' %} {{ city }} - {{ state }}

+

{% trans 'Sistema de Apoio ao Processo Legislativo' %}

+
+ + + {% block sections_nav %} + {% endblock sections_nav %} + + +
-
{% endblock main_header %} @@ -211,33 +219,11 @@ - - - - + {% block extra_js %} diff --git a/templates/compilacao/textoarticulado_detail.html b/templates/compilacao/textoarticulado_detail.html index 8f8a9d1c1..d37f4ffc0 100644 --- a/templates/compilacao/textoarticulado_detail.html +++ b/templates/compilacao/textoarticulado_detail.html @@ -1,5 +1,21 @@ {% extends "base.html" %} {% load i18n %} {% load compilacao_filters %} + + {% block sections_nav %} + + {% endblock %} + {% block base_content %} {# FIXME is this the best markup to use? #}
{% block actions %} @@ -19,19 +35,7 @@ {% endblock actions %} -
{% block detail_content %} {# TODO replace fieldset for something semantically correct, but with similar visual grouping style #} diff --git a/templates/compilacao/tipotextoarticulado_detail.html b/templates/compilacao/tipotextoarticulado_detail.html index 95add3856..acb29c333 100644 --- a/templates/compilacao/tipotextoarticulado_detail.html +++ b/templates/compilacao/tipotextoarticulado_detail.html @@ -1,6 +1,9 @@ {% extends "base.html" %} {% load i18n %} {% load compilacao_filters %} {% block base_content %} {# FIXME is this the best markup to use? #} + + {% block sections_nav %} + {% endblock %}
{% block actions %} {% endblock actions %} - +
{% block detail_content %} {# TODO replace fieldset for something semantically correct, but with similar visual grouping style #}
{%trans 'Identificação Básica'%} - +
- +

{{ object.sigla}}

- +

{{ object.descricao}}

- +
diff --git a/templates/crud/detail.html b/templates/crud/detail.html index f6b89bb8d..b0fc0c6ce 100644 --- a/templates/crud/detail.html +++ b/templates/crud/detail.html @@ -11,7 +11,7 @@
{% trans 'Excluir' %}
{% endblock actions %} - {% block sections_nav %}{% endblock %} +
{% block detail_content %} diff --git a/templates/materia/materialegislativa_detail.html b/templates/materia/materialegislativa_detail.html index f76aa2a26..aaa0a1bcd 100644 --- a/templates/materia/materialegislativa_detail.html +++ b/templates/materia/materialegislativa_detail.html @@ -2,16 +2,16 @@ {% load i18n %} {% block sections_nav %} -