From e56e6d3574edc508753fc822e9db4a06765d91c1 Mon Sep 17 00:00:00 2001 From: Guilherme Gondim Date: Tue, 15 Dec 2009 14:11:06 +0000 Subject: [PATCH] =?UTF-8?q?Menus=20agora=20utilizam=20o=20django-treemenus?= =?UTF-8?q?,=20al=C3=A9m=20de=20outras=20melhorias=20nos=20mesmos.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- media/css/app_index.css | 8 +- media/css/base_site.css | 102 +++++++++++++++++----- media/images/menu/hover.gif | Bin 0 -> 49 bytes media/images/menu/hover_sub.gif | Bin 0 -> 50 bytes media/images/menu/seperator.gif | Bin 0 -> 155 bytes media/images/menu/sub_sep.gif | Bin 0 -> 864 bytes sigi/settings.py | 6 +- sigi/sites.py | 4 + sigi/templates/admin/base_site.html | 31 ++++--- sigi/templates/app_index.html | 2 + sigi/templates/snippets/modules/user.html | 16 +--- sigi/templates/treemenus/menu.html | 9 ++ sigi/templates/treemenus/menu_item.html | 20 +++++ sigi/urls.py | 3 - 14 files changed, 136 insertions(+), 65 deletions(-) create mode 100644 media/images/menu/hover.gif create mode 100644 media/images/menu/hover_sub.gif create mode 100644 media/images/menu/seperator.gif create mode 100644 media/images/menu/sub_sep.gif create mode 100644 sigi/templates/treemenus/menu.html create mode 100644 sigi/templates/treemenus/menu_item.html diff --git a/media/css/app_index.css b/media/css/app_index.css index 7bfab7e..47d2836 100644 --- a/media/css/app_index.css +++ b/media/css/app_index.css @@ -1,7 +1 @@ -.dashboard #content-main .module { - width: 100%; -} - -.dashboard #content-main caption { - width: 100%; -} +.dashboard #content-main .module, .dashboard #content-main .module caption, .dashboard #content-main .module table { width:100%; } diff --git a/media/css/base_site.css b/media/css/base_site.css index 834627b..20524f0 100644 --- a/media/css/base_site.css +++ b/media/css/base_site.css @@ -1,38 +1,90 @@ -a:link, a:visited { - color: #0f3361; -} - -a:hover { - color: #11488d; -} +a:link, a:visited { color:#0f3361; } +a:hover { color:#11488d; } /* HEADER */ -#header { background: #003351; } -#branding h1 { color: #fff; } +#header { background:#003351; } +#site-name a:hover { text-decoration: none; } #nav-global { - color: #b87912; - background-color: #101a20; - border-top: 1px solid #252525; - border-bottom: 1px solid #999; - width: 100%; + border:none; + border:0px; + margin:0px; + padding:0px; + font-size:14px; + font-weight:bold; +} +#nav-global ul { + background:#222; + height:25px; + margin:0; + padding:0; } -#nav-global ul { margin: 0; padding: 3px; } #nav-global li { - display: inline; - font-size: 1em; + float:left; + list-style:none; + padding:0px; } #nav-global li a { - color: #dfdfdf !important; - margin: 0 5px 0 5px; + background:#222 url("../images/menu/seperator.gif") bottom right no-repeat; + color:#cccccc; + display:block; + font-weight:normal; + line-height:25px; + margin:0px; + padding:0px 15px; + text-align:center; + text-decoration:none; +} +#nav-global li a:hover, #nav-global ul li:hover a { + background: #333 url("../images/menu/hover.gif") bottom center no-repeat; + color:#FFFFFF; + text-decoration:none; +} +#nav-global li ul { + background:#333; + display:none; + height:auto; + padding:0px; + margin:0px; + border:0px; + position:absolute; + width:225px; + z-index:200; + /*top:1em; + /*left:0;*/ +} +#nav-global li:hover ul { display:block; } +#nav-global li li { + background:url('../images/menu/sub_sep.gif') bottom left no-repeat; + display:block; + float:none; + margin:0px; + padding:0px; + width:225px; } -#nav-global li a:hover { - color: #fff !important; - margin: 0 5px 0 5px; - text-decoration: none; +#nav-global li:hover li a { background:none; } +#nav-global li ul a { + display:block; + height:25px; + font-style:normal; + margin:0px; + padding:0px 10px 0px 15px; + text-align:left; } +#nav-global li ul a:hover, #nav-global li ul li:hover a { + background:#444 url('../images/menu/hover_sub.gif') center left no-repeat; + border:0px; + color:#ffffff; + text-decoration:none; +} +#nav-global p { + clear:left; +} + +div.breadcrumbs { display:none; } + /* CONTENT */ @@ -43,6 +95,10 @@ a:hover { .row1 { background: #f5f6fc none repeat scroll 0 0; } +.align-center { text-align: center; } + +img.chart { margin: 20px 0; } + .dashboard #content { width: auto; } diff --git a/media/images/menu/hover.gif b/media/images/menu/hover.gif new file mode 100644 index 0000000000000000000000000000000000000000..b7d3acca2e979c6f9b99f6687d773a4fca76ce27 GIT binary patch literal 49 xcmZ?wbhEHbGZ)%(O!*A4AuaE7!N1_ literal 0 HcmV?d00001 diff --git a/media/images/menu/seperator.gif b/media/images/menu/seperator.gif new file mode 100644 index 0000000000000000000000000000000000000000..8f7aedf7e4d37c172e6bf26d80d649975f5eb904 GIT binary patch literal 155 zcmZ?wbhEHbWMoigIKseSZ*Om7W8>!L=H%pLW@hH#;9zTOYh`6+Zf@@4;$mWAVrOS( zZEfxB?Cj|1XklUD>gsA~X=!R|YHV!GKm<_y$pTiT10q3oGO$WKQ0ZH&G?(R*O<;*Z T<3@(o$2`819VQ4cF<1itnrs{h literal 0 HcmV?d00001 diff --git a/media/images/menu/sub_sep.gif b/media/images/menu/sub_sep.gif new file mode 100644 index 0000000000000000000000000000000000000000..4bd87f69aee08480fe7b112cb28c7f60d0a1141e GIT binary patch literal 864 zcmZ?wbhEHbOkrST_|Cv!Z*Om7W8>!L=H%pLW@hH#;9zTOYh`6+Zf@@4;$mWAVrOS( zZEfxB?Cj|1XklUD>gsA~X=!R|YHV!GFbYOPV2Fo+;!hT^4|G5zC{HkO*fOwkv^Y#i zXlmva(vmrFq497#D;L9z9SasUb~73o-KbcQ+|n;E-yzevK&5fAP|zx$l?$G>OgBhA LHAmA}fx#L8H1;dI literal 0 HcmV?d00001 diff --git a/sigi/settings.py b/sigi/settings.py index d1c880f..011aec1 100644 --- a/sigi/settings.py +++ b/sigi/settings.py @@ -86,9 +86,9 @@ INSTALLED_APPS = ( 'django.contrib.sites', 'django.contrib.databrowse', 'django.contrib.admin', - 'django.contrib.admindocs', - 'django_extensions', # http://django-command-extensions.googlecode.com/ - 'googlecharts', + 'django_extensions', # http://django-command-extensions.googlecode.com + 'googlecharts', # http://github.com/jacobian/django-googlecharts + 'treemenus', # http://django-treemenus.googlecode.com 'sigi.apps.casas', 'sigi.apps.contatos', 'sigi.apps.convenios', diff --git a/sigi/sites.py b/sigi/sites.py index f50abb2..febd61f 100644 --- a/sigi/sites.py +++ b/sigi/sites.py @@ -1,6 +1,7 @@ from django.contrib.auth.admin import Group, GroupAdmin, User, UserAdmin from django.contrib.sites.admin import Site, SiteAdmin from django.contrib.admin.sites import AdminSite +from treemenus.admin import Menu, MenuAdmin from sigi.apps.casas.admin import CasaLegislativa, CasaLegislativaAdmin from sigi.apps.contatos.admin import (UnidadeFederativa, UnidadeFederativaAdmin, Municipio, MunicipioAdmin, Telefone, @@ -36,6 +37,9 @@ default.register(User, UserAdmin) # django.contrib.sites default.register(Site, SiteAdmin) +# treemenus +default.register(Menu, MenuAdmin) + # sigi.apps.casas default.register(CasaLegislativa, CasaLegislativaAdmin) diff --git a/sigi/templates/admin/base_site.html b/sigi/templates/admin/base_site.html index 01acd8a..b6989ce 100644 --- a/sigi/templates/admin/base_site.html +++ b/sigi/templates/admin/base_site.html @@ -1,4 +1,5 @@ {% extends "admin/base.html" %} +{% load tree_menu_tags %} {% block title %}{{ title }} | SIGI{% endblock %} @@ -13,7 +14,9 @@ {% endblock %} {% block branding %} -

Sistema de Informações Gerenciais do Interlegis

+

+ Sistema de Informações Gerenciais do Interlegis +

{% endblock %} {% block userlinks %} @@ -22,23 +25,19 @@ {% block nav-global %} {% endblock %} -{% block footer %} - +{% block footer %} + {% if not is_popup %} + + {% endif %} {% endblock %} + diff --git a/sigi/templates/app_index.html b/sigi/templates/app_index.html index 41b570c..580e1be 100644 --- a/sigi/templates/app_index.html +++ b/sigi/templates/app_index.html @@ -7,6 +7,8 @@ href="{{ MEDIA_URL }}css/app_index.css" /> {% endblock %} +{% block breadcrumbs %}{% endblock %} + {% block sidebar %}