Browse Source

Menus agora utilizam o django-treemenus, além de outras melhorias nos mesmos.

0.2
Guilherme Gondim 15 years ago
parent
commit
e56e6d3574
  1. 8
      media/css/app_index.css
  2. 102
      media/css/base_site.css
  3. BIN
      media/images/menu/hover.gif
  4. BIN
      media/images/menu/hover_sub.gif
  5. BIN
      media/images/menu/seperator.gif
  6. BIN
      media/images/menu/sub_sep.gif
  7. 6
      sigi/settings.py
  8. 4
      sigi/sites.py
  9. 31
      sigi/templates/admin/base_site.html
  10. 2
      sigi/templates/app_index.html
  11. 16
      sigi/templates/snippets/modules/user.html
  12. 9
      sigi/templates/treemenus/menu.html
  13. 20
      sigi/templates/treemenus/menu_item.html
  14. 3
      sigi/urls.py

8
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%; }

102
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;
}

BIN
media/images/menu/hover.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 B

BIN
media/images/menu/hover_sub.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 B

BIN
media/images/menu/seperator.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 B

BIN
media/images/menu/sub_sep.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

6
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',

4
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)

31
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 %}
<h1 id="site-name">Sistema de Informações Gerenciais do Interlegis</h1>
<h1 id="site-name">
<a href="/">Sistema de Informações Gerenciais do Interlegis</a>
</h1>
{% endblock %}
{% block userlinks %}
@ -22,23 +25,19 @@
{% block nav-global %}
<div id="nav-global">
<ul>
<li><a href="/">Dashboard</a></li>
<li>| <a href="/casas/">Casa Legislativas</a></li>
<li>| <a href="/parlamentares/">Parlamentares</a></li>
<li>| <a href="/mesas/">Mesas Diretoras</a></li>
<li>| <a href="/convenios/">Convênios</a></li>
<li>| <a href="/servicos/">Serviços</a></li>
<li>| <a href="/inventario/">Inventário</a></li>
</ul>
{% show_menu "Barra de navegação" "unordered-list" %}
</div>
{% endblock %}
{% block footer %}
<div id="footer">
<img src="/media/images/logo-interlegis.png">
<p>Copyright &copy; 2008 Interlegis. Todos os Direitos Reservados.<br />
É proibido o uso das informações aqui fornecidas fora do âmbito do Interlegis.
</div>
{% block footer %}
{% if not is_popup %}
<div id="footer">
<img src="/media/images/logo-interlegis.png">
<p>Copyright &copy; 2008&ndash;2010 Interlegis. Todos os Direitos Reservados.<br />
É proibido o uso das informações aqui fornecidas fora do âmbito do Interlegis.
</div>
{% endif %}
{% endblock %}

2
sigi/templates/app_index.html

@ -7,6 +7,8 @@
href="{{ MEDIA_URL }}css/app_index.css" />
{% endblock %}
{% block breadcrumbs %}{% endblock %}
{% block sidebar %}
<div id="content-related">
{% include "snippets/modules/user.html" %}

16
sigi/templates/snippets/modules/user.html

@ -1,21 +1,11 @@
{% load i18n %}
{% load i18n tree_menu_tags %}
<div class="module" id="user-module">
<h2>Meu espaço</h2>
<h3>{{ user.get_full_name }}</h3>
{% url django-admindocs-docroot as docsroot %}
<ul>
<li><a href="{{ root_path }}password_change/">Alterar
senha</a></li>
{% if docsroot %}<li><a href="{{ docsroot }}">Documentação</a></li>{% endif %}
<li><a href="{{ root_path }}logout/">Encerrar sessão</a></li>
</ul>
{% show_menu "Usuário" "unordered-list" %}
{% if user.is_superuser %}
<h3>Administração</h3>
<ul>
<li><a href="/auth/">Usuários & Grupos</a></li>
<li><a href="/sites/">Sites</a></li>
<li><a href="/contatos/">Contatos</a></li>
</ul>
{% show_menu "Administrador" "unordered-list" %}
{% endif %}
</div>

9
sigi/templates/treemenus/menu.html

@ -0,0 +1,9 @@
{% load tree_menu_tags %}
{% ifequal menu_type "unordered-list" %}
<ul>
{% for menu_item in menu.root_item.children %}
{% show_menu_item menu_item %}
{% endfor %}
</ul>
{% endifequal %}

20
sigi/templates/treemenus/menu_item.html

@ -0,0 +1,20 @@
{% load tree_menu_tags %}
{% ifequal menu_type "unordered-list" %}
{% if menu_item.has_children %}
<li>
{% if menu_item.url %}
<a href="{{ menu_item.url }}">{{ menu_item.caption }}</a>
{% else %}
{{ menu_item.caption }}
{% endif %}
<ul>
{% for child in menu_item.children %}
{% show_menu_item child %}
{% endfor %}
</ul>
</li>
{% else %}
<li><a href="{{ menu_item.url }}">{{ menu_item.caption }}</a></li>
{% endif %}
{% endifequal %}

3
sigi/urls.py

@ -15,9 +15,6 @@ urlpatterns = patterns(
# databrowse
(r'^databrowse/(.*)', databrowse.site.root),
# admin docs
(r'^doc/', include('django.contrib.admindocs.urls')),
# automatic interface based on admin
(r'^(.*)', sites.default.root),
)

Loading…
Cancel
Save