mirror of https://github.com/interlegis/sigi.git
Sesostris Vieira
3 years ago
12 changed files with 171 additions and 77 deletions
@ -1,18 +1,42 @@ |
|||
{% extends 'admin/base_site.html' %} |
|||
{% load i18n %} |
|||
|
|||
{% block content_title %}<h1>{% trans 'Importar dados do Gescon' %}</h1>{% endblock %} |
|||
{% block object-tools-items %} |
|||
<li class="nav-item"><a class="nav-link active" href="{% url 'importar-gescon' %}?action=importar">Importar</a></li> |
|||
<li class="nav-item"><a class="nav-link" href="{% url 'admin:convenios_gescon_change' gescon.id %}">Configurações</a></li> |
|||
{% block breadcrumbs %} |
|||
<div class="breadcrumbs"> |
|||
<h6>{% trans 'Importar dados do Gescon' %}</h6> |
|||
</div> |
|||
{% endblock %} |
|||
|
|||
{% block object-tools-items %}{% endblock %} |
|||
|
|||
{% block content %} |
|||
<div class="module filtered" id="changelist"> |
|||
<p class="paginator"></p> |
|||
<ul class="pagination"> |
|||
<li class="active"> |
|||
<a href="{% url 'importar-gescon' %}?action=importar"> |
|||
<i class="material-icons left">cloud_download</i> |
|||
{% trans "Importar" %} |
|||
</a> |
|||
</li> |
|||
<li class="active"> |
|||
<a href="{% url 'admin:convenios_gescon_change' gescon.id %}"> |
|||
<i class="material-icons left">perm_data_setting</i> |
|||
{% trans "Configurações" %} |
|||
</a> |
|||
</li> |
|||
</ul> |
|||
{% if gescon.ultima_importacao %} |
|||
<blockquote> |
|||
<pre><code>{{ gescon.ultima_importacao }}</code></pre> |
|||
</blockquote> |
|||
{% else %} |
|||
{% blocktrans %} |
|||
<p class="alert alert-danger"><strong>Nenhuma importação anterior foi realizada!</strong></p> |
|||
<p class="">Configure a conexão com o Gescon para realizar a primeira importação.</p> |
|||
<blockquote> |
|||
<p><strong>Nenhuma importação anterior foi realizada!</strong></p> |
|||
<p>Configure a conexão com o Gescon para realizar a primeira importação.</p> |
|||
</blockquote> |
|||
{% endblocktrans %} |
|||
{% endif %} |
|||
</div> |
|||
{% endblock %} |
@ -0,0 +1,17 @@ |
|||
from django import template |
|||
|
|||
register = template.Library() |
|||
|
|||
ACTION_LIST = { |
|||
'delete_selected': 'delete_forever', |
|||
'add_to_cart': 'add_shopping_cart', |
|||
'remove_from_cart': 'remove_shopping_cart', |
|||
'calcular_data_uso': 'functions', |
|||
} |
|||
|
|||
@register.simple_tag |
|||
def action_icon(action_name): |
|||
if action_name in ACTION_LIST: |
|||
return ACTION_LIST[action_name] |
|||
else: |
|||
return "play_arrow" |
@ -1,44 +1,36 @@ |
|||
{% load i18n %} |
|||
{% load i18n action_icons %} |
|||
|
|||
<div class="actions"> |
|||
{% block actions %} |
|||
<div class="card-content"> |
|||
{% block actions-form %} |
|||
{% block actions-form %} |
|||
<input type="hidden" form="changelist-form" name="index" value="{{ action_index|default:0 }}"/> |
|||
{% for field in action_form %} |
|||
{% if field.label %} |
|||
<label class="label">{{ field.label }} |
|||
{% if field.field.widget.choices %} |
|||
{% for option in field.field.widget.choices %} |
|||
{% if option.0 != "" %} |
|||
<button type="submit" form="changelist-form" class="waves-effect waves-light btn action-button" title="{{ option.1 }}" name="action" value="{{ option.0 }}"> |
|||
<i class="material-icons">{% action_icon option.0 %}</i> |
|||
</button> |
|||
{% endif %} |
|||
{% endfor %} |
|||
{% else %} |
|||
<input type="hidden" name="{{ field.name }}" value="{{ field.value }}" class="select-across" form="changelist-form"/> |
|||
{% 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 %} |
|||
{% 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"> |
|||
<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> |
|||
</span> |
|||
<span class="clear"><a href="#">{% trans "Clear selection" %}</a></span> |
|||
{% endif %} |
|||
{% 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,36 @@ |
|||
{% load i18n static %} |
|||
|
|||
{% block extrastyle %} |
|||
<link href="{% static 'material/admin/css/search_form.min.css' %}" rel="stylesheet"> |
|||
{% endblock %} |
|||
|
|||
{% if cl.search_fields %} |
|||
<form id="changelist-search" method="get"> |
|||
<div class="input-field col s6"> |
|||
<input id="icon_prefix" class="validate" type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}"> |
|||
<label for="icon_prefix">{% trans 'Search' %} {{ cl.opts.verbose_name }}</label> |
|||
<button class="search-cta" type="submit"><i class="material-icons" aria-hidden="true">search</i></button> |
|||
{% if show_result_count %} |
|||
<span class="small quiet"> |
|||
{% blocktrans count counter=cl.result_count %}{{ counter }} |
|||
result{% plural %}{{ counter }} results |
|||
{% endblocktrans %} |
|||
(<a href="?{% if cl.is_popup %}_popup=1{% endif %}"> |
|||
{% if cl.show_full_result_count %} |
|||
{% blocktrans with full_result_count=cl.full_result_count %} |
|||
{{ full_result_count }} total |
|||
{% endblocktrans %} |
|||
{% else %} |
|||
{% trans "Show all" %} |
|||
{% endif %} |
|||
</a>) |
|||
</span> |
|||
{% endif %} |
|||
{% for pair in cl.params.items %} |
|||
{% if pair.0 != search_var %} |
|||
<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"> |
|||
{% endif %} |
|||
{% endfor %} |
|||
</div> |
|||
</form> |
|||
{% endif %} |
Loading…
Reference in new issue