mirror of https://github.com/interlegis/sigi.git
Sesostris Vieira
3 years ago
9 changed files with 305 additions and 73 deletions
@ -1,24 +1,35 @@ |
|||||
{% extends "admin/import_export/change_list_export.html" %} |
{% extends "admin/change_list.html" %} |
||||
{% load admin_list admin_urls i18n %} |
{% load admin_list admin_urls i18n %} |
||||
|
|
||||
{% block content_title %} |
{% block messages %} |
||||
{% if viewing_cart %} |
{{ block.super }} |
||||
{% blocktrans with s=opts.verbose_name_plural|lower c=cart_item_count %} |
{% if viewing_cart %} |
||||
<h1>Visualizando carrinho de {{ s }} <span class="badge">{{ c }}</span></h1> |
<ul> |
||||
{% endblocktrans %} |
<li class="amber lighten-4 flow-text valign-wrapper"> |
||||
|
<i class="material-icons medium">shopping_cart</i> |
||||
|
{% if cart_item_count > 0 %} |
||||
|
{% blocktrans with s=opts.verbose_name_plural|lower c=cart_item_count %} |
||||
|
{{ c }} {{ s }} no carrinho |
||||
|
{% endblocktrans %} |
||||
{% else %} |
{% else %} |
||||
{% if title %}<h1>{{ title }}</h1>{% endif %} |
Carrinho vazio |
||||
{% endif %} |
{% endif %} |
||||
|
</li> |
||||
|
</ul> |
||||
|
{% endif %} |
||||
{% endblock %} |
{% endblock %} |
||||
|
|
||||
{{ block.super }} |
|
||||
|
|
||||
{% block object-tools-items %} |
{% block object-tools-items %} |
||||
{% if viewing_cart %} |
{% if viewing_cart %} |
||||
{% include "admin/import_export/change_list_export_item.html" %} |
{% include "admin/import_export/change_list_export_item.html" %} |
||||
{% include "admin/cart/change_list_cart_item.html" %} |
{% include "admin/cart/change_list_cart_item.html" %} |
||||
{% else %} |
{% else %} |
||||
<li><a class="btn" href="?cart=1"><span class="glyphicon glyphicon-shopping-cart"></span>{% blocktrans with c=cart_item_count %}Ver Carrinho <span class="badge">{{ c }}</span>{% endblocktrans %}</a></li> |
{{ block.super }} |
||||
{{ block.super }} |
<li> |
||||
{% endif %} |
<a class="btn-floating tooltipped waves-effect waves-light" href="?cart=1" data-position="left" data-tooltip="{% trans "Ver itens no carrinho" %}"> |
||||
|
<i class="material-icons">shopping_cart</i> |
||||
|
</a> |
||||
|
</li> |
||||
|
{% endif %} |
||||
{% endblock %} |
{% endblock %} |
||||
|
@ -1,5 +1,13 @@ |
|||||
{% load i18n %} |
{% load i18n %} |
||||
{% load admin_urls %} |
{% load admin_urls %} |
||||
|
|
||||
<li><a role="button" class="btn" href="?cart=0"><span class="glyphicon glyphicon-chevron-left"></span>{% trans 'Voltar à lista completa' %}</a></li> |
<li> |
||||
<li><a role="button" class="btn" href="{% url opts|admin_urlname:'clearcart' %}"><span class="glyphicon glyphicon-trash"></span>{% trans "Esvaziar carrinho" %}</a></li> |
<a class="btn-floating tooltipped waves-effect waves-light" href="?cart=0" data-position="left" data-tooltip="{% trans 'Voltar à lista completa' %}"> |
||||
|
<i class="material-icons">undo</i> |
||||
|
</a> |
||||
|
</li> |
||||
|
<li> |
||||
|
<a class="btn-floating tooltipped waves-effect waves-light" href="{% url opts|admin_urlname:'clearcart' %}" data-position="left" data-tooltip="{% trans "Esvaziar carrinho" %}"> |
||||
|
<i class="material-icons">remove_shopping_cart</i> |
||||
|
</a> |
||||
|
</li> |
||||
|
@ -1,33 +0,0 @@ |
|||||
{% extends "admin/base_site.html" %} |
|
||||
{% load i18n admin_urls %} |
|
||||
|
|
||||
{% block coltype %}flex{% endblock %} |
|
||||
{% block content_title %}<h1>{% trans "Exportar para CSV" %}</h1>{% endblock %} |
|
||||
{% block content %} |
|
||||
<form class="form-horizontal" id="changelist-form" action="" method="post">{% csrf_token %} |
|
||||
<div class="panel panel-default"> |
|
||||
<div class="panel-heading"> |
|
||||
<h3 class="panel-title">{% trans "Selecione os campos para exportar" %}</h3> |
|
||||
</div> |
|
||||
<div class="panel-body"> |
|
||||
<div class="form-group"> |
|
||||
{% for field, label in export_fields %} |
|
||||
<div class="checkbox"> |
|
||||
<label> |
|
||||
<input type="checkbox" name="selected_fields" value="{{ field }}" checked/> |
|
||||
{{ label }} |
|
||||
</label> |
|
||||
</div> |
|
||||
{% endfor %} |
|
||||
</div> |
|
||||
</div> |
|
||||
<div class="panel-footer"> |
|
||||
<div class="form-group"> |
|
||||
<button type="submit" class="btn">{% trans "Exportar" %}</button> |
|
||||
<a role="button" class="btn" href="{% url opts|admin_urlname:'changelist' %}">{% trans "Voltar" %}</a> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</div> |
|
||||
</form> |
|
||||
{% endblock %} |
|
@ -0,0 +1,10 @@ |
|||||
|
{% load i18n %} |
||||
|
{% load admin_urls %} |
||||
|
|
||||
|
{% if has_export_permission %} |
||||
|
<li> |
||||
|
<a class="btn-floating tooltipped waves-effect waves-light" href="{% url opts|admin_urlname:'export' %}{{cl.get_query_string}}" data-position="left" data-tooltip="{% trans "Export" %}"> |
||||
|
<i class="material-icons">open_in_new</i> |
||||
|
</a> |
||||
|
</li> |
||||
|
{% endif %} |
@ -0,0 +1,47 @@ |
|||||
|
{% extends "admin/base_site.html" %} |
||||
|
{% load i18n admin_urls %} |
||||
|
|
||||
|
{% block extrastyle %} |
||||
|
{{ block.super }} |
||||
|
<style> |
||||
|
#content { |
||||
|
display: block; |
||||
|
} |
||||
|
.submit-row>a { |
||||
|
color: #fff; |
||||
|
} |
||||
|
</style> |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block breadcrumbs %}{% endblock %} |
||||
|
{% block content_title %}<h6>{% blocktrans with name=opts.verbose_name_plural %}Exportar {{ name }}{% endblocktrans %}</h6>{% endblock %} |
||||
|
{% block content %} |
||||
|
<form action="" method="POST" novalidate>{% csrf_token %} |
||||
|
<div class="container"> |
||||
|
<fieldset> |
||||
|
{% for field in form %} |
||||
|
<div class="form-row"> |
||||
|
{{ field.errors }} |
||||
|
|
||||
|
{{ field.label_tag }} |
||||
|
{{ field }} |
||||
|
|
||||
|
{% if field.field.help_text %} |
||||
|
<p class="help">{{ field.field.help_text|safe }}</p> |
||||
|
{% endif %} |
||||
|
</div> |
||||
|
{% endfor %} |
||||
|
</fieldset> |
||||
|
|
||||
|
<div class="submit-row"> |
||||
|
<button class="btn waves-effect waves-light" type="submit" name="export"> |
||||
|
<i class="material-icons left">done</i> |
||||
|
{% trans "Export" %} |
||||
|
</button> |
||||
|
<a class="btn waves-effect waves-light" href="{% url opts|admin_urlname:'changelist' %}"> |
||||
|
<i class="material-icons left">navigate_before</i> |
||||
|
{% trans "Voltar" %} |
||||
|
</a> |
||||
|
</div> |
||||
|
</form> |
||||
|
{% endblock %} |
@ -0,0 +1,68 @@ |
|||||
|
{% extends "admin/import_export/export.html" %} |
||||
|
{% load i18n admin_urls %} |
||||
|
|
||||
|
{% block content %} |
||||
|
<div class="row"> |
||||
|
<div class="col s12"> |
||||
|
<ul class="tabs"> |
||||
|
{% block tab-items %} |
||||
|
<li class="tab col"><a href="#export">{% trans "Exportar" %}</a></li> |
||||
|
<li class="tab col"><a href="#report">{% trans "Relatórios" %}</a></li> |
||||
|
{% endblock %} |
||||
|
</ul> |
||||
|
</div> |
||||
|
{% block tabs %} |
||||
|
<div id="export" class="col s12"> |
||||
|
<form action="" method="POST" novalidate>{% csrf_token %} |
||||
|
<div class="container"> |
||||
|
<fieldset> |
||||
|
{% for field in form %} |
||||
|
<div class="form-row"> |
||||
|
{{ field.errors }} |
||||
|
|
||||
|
{{ field.label_tag }} |
||||
|
{{ field }} |
||||
|
|
||||
|
{% if field.field.help_text %} |
||||
|
<p class="help">{{ field.field.help_text|safe }}</p> |
||||
|
{% endif %} |
||||
|
</div> |
||||
|
{% endfor %} |
||||
|
</fieldset> |
||||
|
<div class="submit-row"> |
||||
|
<button class="btn waves-effect waves-light" type="submit" name="export"> |
||||
|
<i class="material-icons left">done</i> |
||||
|
{% trans "Export" %} |
||||
|
</button> |
||||
|
<a class="btn waves-effect waves-light" href="{% url opts|admin_urlname:'changelist' %}"> |
||||
|
<i class="material-icons left">navigate_before</i> |
||||
|
{% trans "Voltar" %} |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
<div id="report" class="col s12"> |
||||
|
<div class="container"> |
||||
|
<div class="collection"> |
||||
|
{% for report in reports %} |
||||
|
<a class="collection-item" href="{% url opts|admin_urlname:'report' report.name %}"> |
||||
|
<i class="material-icons left">{{ report.icon }}</i> |
||||
|
{{ report.title }} |
||||
|
</a> |
||||
|
{% endfor %} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
{% endblock %} |
||||
|
</div> |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block footer %} |
||||
|
{{ block.super }} |
||||
|
<script> |
||||
|
$(document).ready(function(){ |
||||
|
var instance = M.Tabs.init($('.tabs'), {}); |
||||
|
}); |
||||
|
</script> |
||||
|
{% endblock %} |
@ -0,0 +1,44 @@ |
|||||
|
{% load i18n %} |
||||
|
|
||||
|
<div class="actions"> |
||||
|
{% block actions %} |
||||
|
<div class="card-content"> |
||||
|
{% block actions-form %} |
||||
|
{% for field in action_form %} |
||||
|
{% if field.label %} |
||||
|
<label class="label">{{ field.label }} |
||||
|
{% endif %} |
||||
|
{% if field.field.widget.choices %} |
||||
|
<select form="changelist-form" name="action" required tabindex="-1"> |
||||
|
{% for option in field.field.widget.choices %} |
||||
|
<option value="{{ option.0 }}">{{ option.1 }}</option> |
||||
|
{% endfor %} |
||||
|
</select> |
||||
|
{% else %} |
||||
|
<input type="hidden" name="{{ field.name }}" value="{{ field.value }}" class="select-across" form="changelist-form"/> |
||||
|
{% endif %} |
||||
|
{% if field.label %}</label>{% endif %} |
||||
|
{% endfor %} |
||||
|
{% endblock %} |
||||
|
{% block actions-submit %} |
||||
|
{% block actions-counter %} |
||||
|
{% if actions_selection_counter %} |
||||
|
<span class="action-counter" data-actions-icnt="{{ cl.result_list|length }}">{{ selection_note }}</span> |
||||
|
{% if cl.result_count != cl.result_list|length %} |
||||
|
<span class="all">{{ selection_note_all }}</span> |
||||
|
<span class="question"> |
||||
|
<a href="#" title="{% trans "Click here to select the objects across all pages" %}">{% blocktrans with cl.result_count as total_count %}Select all {{ total_count }} {{ module_name }}{% endblocktrans %}</a> |
||||
|
</span> |
||||
|
<span class="clear"><a href="#">{% trans "Clear selection" %}</a></span> |
||||
|
{% endif %} |
||||
|
{% endif %} |
||||
|
{% endblock %} |
||||
|
</div> |
||||
|
<div class="card-action"> |
||||
|
<div class="right-align"> |
||||
|
<button type="submit" form="changelist-form" class="waves-effect waves-light btn action-button" title="{% trans "Run the selected action" %}" name="index" value="{{ action_index|default:0 }}">{% trans "Go" %}</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
{% endblock %} |
||||
|
{% endblock %} |
||||
|
</div> |
@ -0,0 +1,46 @@ |
|||||
|
{% extends "admin/change_list.html" %} |
||||
|
{% load i18n static admin_list %} |
||||
|
{% load i18n admin_urls %} |
||||
|
|
||||
|
{% block breadcrumbs %}{% endblock %} |
||||
|
|
||||
|
{% block object-tools %} |
||||
|
<div class="fixed-action-btn"> |
||||
|
<a class="btn-floating btn-large"> |
||||
|
<i class="large material-icons">build</i> |
||||
|
</a> |
||||
|
<ul> |
||||
|
{% 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 to_field %}" class="btn-floating tooltipped waves-effect waves-light" data-position="left" data-tooltip="{% trans 'Add' %}"> |
||||
|
<i class="material-icons" aria-hidden="true">add</i> |
||||
|
</a> |
||||
|
</li> |
||||
|
{% endif %} |
||||
|
{% endblock %} |
||||
|
</ul> |
||||
|
</div> |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block footer %} |
||||
|
{{ block.super }} |
||||
|
<script> |
||||
|
$(document).ready(function(){ |
||||
|
$('.fixed-action-btn').floatingActionButton(); |
||||
|
M.Tooltip.init($('.tooltipped'), {}); |
||||
|
}); |
||||
|
</script> |
||||
|
{% endblock footer %} |
||||
|
|
||||
|
|
||||
|
|
||||
|
{% comment %} |
||||
|
$(window).scroll(function() { |
||||
|
$('.tooltipped')._positionTooltip(); |
||||
|
}) |
||||
|
|
||||
|
<ul> |
||||
|
</ul> |
||||
|
{% endcomment %} |
Loading…
Reference in new issue