Browse Source

Iniciando novo layout c bootstrap: change_list parlamentar

Conflicts:
	templates/admin/base.html
producao
Marcio Mazza 10 years ago
parent
commit
2d36288b2e
  1. 15
      sigi/apps/parlamentares/templates/admin/parlamentares/parlamentar/change_list.html
  2. 4
      sigi/settings/base.py
  3. 166
      templates/admin/base.html
  4. 16
      templates/admin/base_site.html
  5. 122
      templates/admin/change_list.html
  6. 2
      templates/treemenus/menu.html
  7. 8
      templates/treemenus/menu_item.html

15
sigi/apps/parlamentares/templates/admin/parlamentares/parlamentar/change_list.html

@ -1,13 +1,10 @@
{% extends "admin/change_list.html" %}
{% load admin_list i18n reporting_tags %}
{% block object-tools %}
<ul class="object-tools">
<li><a onclick="return showRelatedObjectLookupPopup(this);" href="carrinho/{{query_str}}">Carrinho / Exportar</a></li>
<li>
<a href="add/{% if is_popup %}?_popup=1{% endif %}" class="addlink">
{% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
</a>
</li>
</ul>
{% block object-tools-items %}
<li><a class="btn" onclick="return showRelatedObjectLookupPopup(this);" href="carrinho/{{query_str}}">
<span class="glyphicon glyphicon-shopping-cart"></span>
Carrinho / Exportar
</a></li>
{{ block.super }}
{% endblock %}

4
sigi/settings/base.py

@ -40,6 +40,10 @@ TEMPLATE_LOADERS = ('django.template.loaders.filesystem.Loader',
# Application definition
INSTALLED_APPS = (
'django_admin_bootstrapped.bootstrap3',
'django_admin_bootstrapped',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',

166
templates/admin/base.html

@ -1,80 +1,170 @@
{% load admin_static %}{% load firstof from future %}
<!DOCTYPE html>
<html lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
{% load admin_static bootstrapped_goodies_tags %}
{% load tree_menu_tags %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE|default:"en-us" }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
<head>
<title>{% block title %}{% endblock %}</title>
<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
{% block extrastyle %}{% endblock %}
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="{% block stylesheet_ie %}{% static "admin/css/ie.css" %}{% endblock %}" /><![endif]-->
{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% static "admin/css/rtl.css" %}{% endblock %}" />{% endif %}
<script type="text/javascript">window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";</script>
<!-- Le styles, placed after extrastyle to correctly override default styling -->
<link href="{% static "bootstrap/css/bootstrap.min.css" %}" rel="stylesheet"/>
<style type="text/css">
body {
padding-top: 10px;
padding-bottom: 40px;
}
</style>
<link href="{% static "bootstrap/css/bootstrap-theme.min.css" %}" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="{% static "admin/css/overrides.css" %}" />
<!-- <link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% static "admin/css/base.css" %}{% endblock %}" /> -->
<script type="text/javascript">
//<![CDATA[
window.__admin_media_prefix__ = "{% filter escapejs %}{% static "admin/" %}{% endfilter %}";
//]]>
</script>
<script src="{% static "admin/js/jquery-1.9.1.min.js" %}"></script>
<script src="{% static "admin/js/jquery-migrate-1.2.1.min.js" %}"></script>
<script src="{% static "bootstrap/js/bootstrap.min.js" %}"></script>
{% block extrahead %}{% endblock %}
{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
<script type="text/javascript">
//<![CDATA[
(function($) {
$(document).ready(function() {
$('input[type="submit"]').addClass('btn');
$('[title]').tooltip();
});
}(jQuery));
//]]>
</script>
</head>
{% load i18n %}
<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}">
<!-- Container -->
<div id="container">
<div class="container">
{% if not is_popup %}
{% block container-top %}{% endblock %}
{% if not is_popup %}
<!-- Header -->
<div id="header">
<div id="branding">
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
{% block branding %}{% endblock %}
</div>
<div class="navbar-collapse collapse navbar-right">
<ul class="nav navbar-nav">
{% if user.is_active and user.is_staff %}
<div id="user-tools">
{% trans 'Welcome,' %}
<strong>{% firstof user.get_short_name user.get_username %}</strong>.
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans 'Welcome,' %} <strong>{% filter force_escape %}{% firstof user.get_short_name user.get_username user.first_name user.username %}{% endfilter %}</strong> <span class="caret"></span></a>
<ul class="dropdown-menu">
{% if user.has_usable_password %}
<li><a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a></li>
{% endif %}
<li><a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a></li>
</ul>
</li>
{% block languages %}
<li class="divider-vertical"></li>
{% language_selector %}
{% endblock languages %}
{% block logs %}
<li class="dropdown" id="recent-actions-module">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans 'Recent Actions' %} <b class="caret"></b></a>
{% load log %}
{% get_admin_log 10 as admin_log for_user user %}
<ul class="dropdown-menu">
{% for entry in admin_log %}
<li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
<a href="{% if entry.is_deletion or not entry.get_admin_url %}#{% else %}{{ entry.get_admin_url }}{% endif %}">
<i class="icon-{% if entry.is_addition %}plus{% endif %}{% if entry.is_change %}edit{% endif %}{% if entry.is_deletion %}remove{% endif %}"></i>
{{ entry.object_repr }}
{% if entry.content_type %}
<span class="mini quiet">({% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %})</span>
{% else %}
<span class="mini quiet">({% trans 'Unknown content' %})</span>
{% endif %}
</a>
</li>
{% empty %}
<li class="disabled"><a href="#">{% trans 'None available' %}</a></li>
{% endfor %}
</ul>
</li>
{% endblock %}
{% block userlinks %}
{% url 'django-admindocs-docroot' as docsroot %}
{% if docsroot %}
<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
<li class="divider-vertical"></li>
<li><a href="{{ docsroot }}">{% trans 'Documentation' %}</a></li>
{% endif %}
{% if user.has_usable_password %}
<a href="{% url 'admin:password_change' %}">{% trans 'Change password' %}</a> /
{% endif %}
<a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
{% endblock %}
</div>
{% endif %}
{% block nav-global %}{% endblock %}
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<!-- END Header -->
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
{% if title %} &rsaquo; {{ title }}{% endif %}
<div role="navigation" class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle collapsed" type="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse">
{% show_menu "Barra de navegação" "unordered-list" %}
</div><!--/.nav-collapse -->
</div><!--/.container-fluid -->
</div>
{% endblock %}
{% endif %}
<!-- Content -->
<div id="content" class="{% block coltype %}colM{% endblock %}">
{% block navbar %}
{% block pretitle %}{% endblock %}
{% block object-tools %}{% endblock %}
{% endblock navbar %}
{% block messages %}
{% if messages %}
<ul class="messagelist">{% for message in messages %}
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li>
{% endfor %}</ul>
<div class="row">
<div class="col-sm-12">
{% for message in messages %}
<div class="alert alert-info {% if message.tags %}{{ message.tags }}{% endif %}">
{{ message }}
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% endblock messages %}
<!-- Content -->
<div id="content" class="{% block coltype %}colM{% endblock %}">
{% block pretitle %}{% endblock %}
{% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
{% block content %}
{% block object-tools %}{% endblock %}
{{ content }}
{% endblock %}
{% block content %}{{ content }}{% endblock %}
{% block sidebar %}{% endblock %}
<br class="clear" />
</div>
<!-- END Content -->
{% block footer %}<div id="footer"></div>{% endblock %}
{% block footer %}<footer id="footer"></footer>{% endblock %}
</div>
<!-- END Container -->

16
templates/admin/base_site.html

@ -1,4 +1,5 @@
{% extends "admin/base.html" %}
{% load i18n %}{% load admin_static bootstrapped_goodies_tags %}
{% load tree_menu_tags %}
{% load static from staticfiles %}
@ -32,22 +33,9 @@
{% endblock %}
{% block branding %}
<h1 id="site-name">
<a href="/">Sistema de Informações Gerenciais do Interlegis</a>
</h1>
<a class="navbar-brand" href="/">Sistema de Informações Gerenciais do Interlegis</a>
{% endblock %}
{% block userlinks %}
<a href="{% url 'admin:logout' %}">Encerrar sessão</a>
{% endblock %}
{% block nav-global %}
<div id="nav-global">
{% show_menu "Barra de navegação" "unordered-list" %}
</div>
{% endblock %}
{% block footer %}
{% if not is_popup %}

122
templates/admin/change_list.html

@ -0,0 +1,122 @@
{% extends "admin/base_site.html" %}
{% load i18n admin_urls admin_static admin_list bootstrapped_goodies_tags %}
{% block extrastyle %}
{{ block.super }}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/changelists.css" %}" />
{% if cl.formset %}
<link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}" />
{% endif %}
{% if cl.formset or action_form %}
{% url 'admin:jsi18n' as jsi18nurl %}
<script type="text/javascript" src="{{ jsi18nurl|default:'../../jsi18n/' }}"></script>
{% endif %}
{{ media.css }}
{% endblock %}
{% block extrahead %}
{{ block.super }}
{{ media.js }}
{% if action_form %}{% if actions_on_top or actions_on_bottom %}
<script type="text/javascript">
(function($) {
$(document).ready(function($) {
$("tr input.action-select").actions();
});
})(django.jQuery);
</script>
{% endif %}{% endif %}
{% endblock %}
{% block bodyclass %}_change-list{% endblock %}
{% block coltype %}flex{% endblock %}
{% block object-tools %}
<ul class="object-tools pull-left nav nav-pills">
{% block object-tools-items %}
{% if has_add_permission %}
<li>
{% url cl.opts|admin_urlname:'add' as add_url %}
<a href="{% add_preserved_filters add_url is_popup %}">
<span class="glyphicon glyphicon-plus"></span> {% blocktrans with cl.opts.verbose_name as name %}Add {{ name }}{% endblocktrans %}
</a>
</li>
{% endif %}
{% endblock %}
</ul>
{% if cl.has_filters %}
<ul class="nav navbar-nav pull-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans 'Filter' %} <span class="caret"></span></a>
<ul class="dropdown-menu pull-right">
{% for spec in cl.filter_specs %}
{% admin_list_filter cl spec %}
{% endfor %}
</ul>
</li>
</ul>
{% endif %}
{% block search %}{% search_form cl %}{% endblock %}
{% endblock %}
{% block content %}
<form class="" id="changelist-form" action="" method="post"{% if cl.formset.is_multipart %} enctype="multipart/form-data"{% endif %}>{% csrf_token %}
{% if cl.formset.errors %}
<div class="alert alert-danger">
<p class="errornote">
{% blocktrans count cl.formset.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
</p>
{{ cl.formset.non_form_errors }}
</div>
{% endif %}
{% with app_name=cl.opts.module_name|lower|slugify %}
{% render_with_template_if_exist cl.opts.app_label|lower|add:"/admin_app_"|add:app_name|add:"_description.html" "" %}
{% endwith %}
{% if action_form and actions_on_top and cl.full_result_count %}
<div class='pull-right'>{% admin_actions %}</div>
{% endif %}
<div id="content-main">
<div class="module{% if cl.has_filters %} filtered{% endif %}" id="_changelist">
{% block date_hierarchy %}
{% date_hierarchy cl %}
{% endblock %}
{% if cl.formset %}
<div>{{ cl.formset.management_form }}</div>
{% endif %}
{% block result_list %}
{% result_list cl %}
{% endblock %}
</div>
</div>
{# {% if cl.formset and cl.result_count %} #}
<div class="navbar navbar-default">
<div class="navbar-inner">
<div class="navbar-form pull-left">
{% if action_form and actions_on_bottom and cl.full_result_count %}
{% admin_actions %}
{% endif %}
</div>
<div class="navbar-form pull-right">
<input type="submit" name="_save" class="btn btn-primary default" value="{% trans 'Save' %}"/>
</div>
</div>
</div>
{# {% endif %} #}
{% block pagination %}
{% pagination cl %}
{% endblock %}
</form>
{% endblock %}

2
templates/treemenus/menu.html

@ -1,7 +1,7 @@
{% load tree_menu_tags %}
{% ifequal menu_type "unordered-list" %}
<ul>
<ul class="nav navbar-nav">
{% for menu_item in menu.root_item.children %}
{% show_menu_item menu_item %}
{% endfor %}

8
templates/treemenus/menu_item.html

@ -2,13 +2,13 @@
{% ifequal menu_type "unordered-list" %}
{% if menu_item.has_children %}
<li>
<li class="dropdown">
{% if menu_item.url %}
<a href="{{ menu_item.url }}">{{ menu_item.caption }}</a>
<a href="{{ menu_item.url }}" class="dropdown-toggle" data-toggle="dropdown">{{ menu_item.caption }} <span class="caret"></span></a>
{% else %}
{{ menu_item.caption }}
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ menu_item.caption }} <span class="caret"></span></a>
{% endif %}
<ul>
<ul class="dropdown-menu" role="menu">
{% for child in menu_item.children %}
{% show_menu_item child %}
{% endfor %}

Loading…
Cancel
Save