mirror of https://github.com/interlegis/sapl.git
LeandroRoberto
9 years ago
12 changed files with 598 additions and 34 deletions
@ -0,0 +1,39 @@ |
|||
# -*- coding: utf-8 -*- |
|||
from __future__ import unicode_literals |
|||
|
|||
from django.db import migrations, models |
|||
|
|||
|
|||
class Migration(migrations.Migration): |
|||
|
|||
dependencies = [ |
|||
('compilacao', '0040_auto_20160106_1956'), |
|||
] |
|||
|
|||
operations = [ |
|||
migrations.RenameField( |
|||
model_name='publicacao', |
|||
old_name='publicacao', |
|||
new_name='data', |
|||
), |
|||
migrations.AddField( |
|||
model_name='publicacao', |
|||
name='ano', |
|||
field=models.PositiveIntegerField(null=True, verbose_name='Pg. Início', blank=True), |
|||
), |
|||
migrations.AddField( |
|||
model_name='publicacao', |
|||
name='edicao', |
|||
field=models.PositiveIntegerField(null=True, verbose_name='Pg. Início', blank=True), |
|||
), |
|||
migrations.AddField( |
|||
model_name='publicacao', |
|||
name='numero', |
|||
field=models.PositiveIntegerField(null=True, verbose_name='Pg. Início', blank=True), |
|||
), |
|||
migrations.AddField( |
|||
model_name='publicacao', |
|||
name='url_externa', |
|||
field=models.CharField(max_length=1024, verbose_name='Link para Versão Eletrônica', blank=True), |
|||
), |
|||
] |
@ -0,0 +1,38 @@ |
|||
{% extends "base.html" %} |
|||
{% load i18n %} |
|||
|
|||
{% block base_content %} |
|||
|
|||
{# FIXME is this the best markup to use? #} |
|||
<div class="clearfix"> |
|||
{% block actions %} |
|||
<dl class="sub-nav right"> |
|||
<dd><a href="{{ view.update_url }}" class="button">{% trans 'Editar' %}</a></dd> |
|||
<dd><a href="{{ view.delete_url }}" class="button alert">{% trans 'Excluir' %}</a></dd> |
|||
</dl> |
|||
{% endblock actions %} |
|||
{% block sections_nav %}{% endblock %} |
|||
</div> |
|||
|
|||
{% block detail_content %} |
|||
{# TODO replace fieldset for something semantically correct, but with similar visual grouping style #} |
|||
{% for fieldset in view.fieldsets %} |
|||
<fieldset> |
|||
<legend>{{ fieldset.legend }}</legend> |
|||
{% for row in fieldset.rows %} |
|||
<div class="row"> |
|||
{% for column in row %} |
|||
<div class="columns large-{{ column.span }}"> |
|||
<div id="div_id_{{ column.id }}" class="holder"> |
|||
<label>{{ column.verbose_name }}</label> {# TODO replace labels, probably (are they correct here?) #} |
|||
<p>{{ column.text }}</p> |
|||
</div> |
|||
</div> |
|||
{% endfor %} |
|||
</div> |
|||
{% endfor %} |
|||
</fieldset> |
|||
{% endfor %} |
|||
{% endblock detail_content %} |
|||
|
|||
{% endblock base_content %} |
@ -0,0 +1,82 @@ |
|||
{% extends "base.html" %} |
|||
{% load i18n %} |
|||
|
|||
{% block base_content %} |
|||
|
|||
{# FIXME is this the best markup to use? #} |
|||
<dl class="sub-nav"> |
|||
<dd><a href="{{ view.create_url }}"> |
|||
{% blocktrans with verbose_name=view.verbose_name %} Adicionar {{ verbose_name }} {% endblocktrans %} |
|||
</a></dd> |
|||
|
|||
{% block more_buttons %} |
|||
{% endblock more_buttons %} |
|||
|
|||
</dl> |
|||
|
|||
{% if not rows %} |
|||
<p>{{ NO_ENTRIES_MSG }}</p> |
|||
{% else %} |
|||
<table class="table table-hover"> |
|||
<thead> |
|||
<tr> |
|||
{% for name in headers %} |
|||
<th>{{ name }}</th> |
|||
{% endfor %} |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{% for value_list in rows %} |
|||
<tr> |
|||
{% for value, href in value_list %} |
|||
<td> |
|||
{% if href %} |
|||
<a href="{{ href }}">{{ value }}</a> |
|||
{% else %} |
|||
{{ value }} |
|||
{% endif %} |
|||
</td> |
|||
{% endfor %} |
|||
</tr> |
|||
{% endfor %} |
|||
</tbody> |
|||
</table> |
|||
{% endif %} |
|||
|
|||
|
|||
{% if is_paginated %} |
|||
<div class="pagination-centered"> |
|||
<ul class="pagination" role="menubar" aria-label="Pagination"> |
|||
{% if page_obj.has_previous %} |
|||
<li> |
|||
<a href="?page={{ page_obj.previous_page_number }}"> |
|||
<span class="arrow">«</span> |
|||
</a> |
|||
</li> |
|||
{% else %} |
|||
<li class="arrow unavailable" aria-disabled="true"><a href="">«</a></li> |
|||
{% endif %} |
|||
|
|||
{% for page in page_range %} |
|||
{% if page %} |
|||
<li {% if page == page_obj.number %}class="current"{% endif %}> |
|||
<a href="?page={{ page }}">{{ page }}</a> |
|||
</li> |
|||
{% else %} |
|||
<li class="unavailable" aria-disabled="true"><a href="">…</a></li> |
|||
{% endif %} |
|||
{% endfor %} |
|||
|
|||
{% if page_obj.has_next %} |
|||
<li> |
|||
<a href="?page={{ page_obj.next_page_number }}"> |
|||
<span class="arrow">»</span> |
|||
</a> |
|||
</li> |
|||
{% else %} |
|||
<li class="arrow unavailable" aria-disabled="true"><a href="">»</a></li> |
|||
{% endif %} |
|||
</ul> |
|||
</div> |
|||
{% endif %} |
|||
{% endblock %} |
@ -0,0 +1,85 @@ |
|||
{% extends "base.html" %} {% load i18n %} {% load compilacao_filters %} |
|||
|
|||
{% block base_content %} {# FIXME is this the best markup to use? #} |
|||
<div class="clearfix"> |
|||
{% block actions %} |
|||
<ul class="button-group right"> |
|||
<li><a href="{% url 'ta_pub_edit' object.ta.pk object.pk %}" class="button tiny">{% trans 'Editar' %}</a></li> |
|||
<li><a href="{% url 'ta_pub_delete' object.ta.pk object.pk %}" class="button alert tiny">{% trans 'Excluir' %}</a></li> |
|||
</ul> |
|||
{% endblock actions %} |
|||
<dl class="sub-nav left"> |
|||
{% block sections_nav %} |
|||
{% endblock %} |
|||
</dl> |
|||
</div> |
|||
|
|||
{% block detail_content %} {# TODO replace fieldset for something semantically correct, but with similar visual grouping style #} |
|||
<fieldset> |
|||
<legend>{%trans 'Identificação Básica'%}</legend> |
|||
|
|||
<div class="row"> |
|||
<div class="columns large-3"> |
|||
<div id="div_id_tipo" class="holder"> |
|||
<label>{% field_verbose_name object 'tipo_publicacao' %}</label> |
|||
<p>{{ object.tipo_publicacao}}</p> |
|||
</div> |
|||
</div> |
|||
<div class="columns large-3"> |
|||
<div id="div_id_tipo" class="holder"> |
|||
<label>{% field_verbose_name object 'data' %}</label> |
|||
<p>{{ object.data}}</p> |
|||
</div> |
|||
</div> |
|||
<div class="columns large-2"> |
|||
<div id="div_id_tipo" class="holder"> |
|||
<label>{% field_verbose_name object 'ano' %}</label> |
|||
<p>{{ object.ano}}</p> |
|||
</div> |
|||
</div> |
|||
<div class="columns large-2"> |
|||
<div id="div_id_tipo" class="holder"> |
|||
<label>{% field_verbose_name object 'numero' %}</label> |
|||
<p>{{ object.numero|default:''}}</p> |
|||
</div> |
|||
</div> |
|||
<div class="columns large-2"> |
|||
<div id="div_id_tipo" class="holder"> |
|||
<label>{% field_verbose_name object 'edicao' %}</label> |
|||
<p>{{ object.edicao|default:''}}</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="columns large-8"> |
|||
<div id="div_id_tipo" class="holder"> |
|||
<label>{% field_verbose_name object 'veiculo_publicacao' %}</label> |
|||
<p>{{ object.veiculo_publicacao}}</p> |
|||
</div> |
|||
</div> |
|||
<div class="columns large-2"> |
|||
<div id="div_id_tipo" class="holder"> |
|||
<label>{% field_verbose_name object 'pagina_inicio' %}</label> |
|||
<p>{{ object.pagina_inicio|default:''}}</p> |
|||
</div> |
|||
</div> |
|||
<div class="columns large-2"> |
|||
<div id="div_id_tipo" class="holder"> |
|||
<label>{% field_verbose_name object 'pagina_fim' %}</label> |
|||
<p>{{ object.pagina_fim|default:''}}</p> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row"> |
|||
<div class="columns large-12"> |
|||
<div id="div_id_tipo" class="holder"> |
|||
<label>{% field_verbose_name object 'url_externa' %}</label> |
|||
<p>{{ object.url_externa|default:''}}</p> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</fieldset> |
|||
{% endblock detail_content %} |
|||
|
|||
{% endblock base_content %} |
@ -0,0 +1,81 @@ |
|||
{% extends "base.html" %} |
|||
{% load i18n %} |
|||
{% load compilacao_filters %} |
|||
|
|||
{% block base_content %} |
|||
|
|||
<dl class="sub-nav"> |
|||
<dd><a href="{{ view.create_url }}"> |
|||
{% trans 'Adicionar'%} {%model_verbose_name 'Publicacao'%} |
|||
</a></dd> |
|||
{% block more_buttons %} |
|||
<dd><a href="{% url 'ta_text' view.kwargs|lookup:'ta_id' %}">{% trans 'Voltar' %}</a></dd> |
|||
|
|||
{% endblock more_buttons %} |
|||
</dl> |
|||
|
|||
{% if not object_list %} |
|||
<p>{{ NO_ENTRIES_MSG }}</p> |
|||
{% else %} |
|||
<table class="table"> |
|||
<thead> |
|||
<tr> |
|||
<th>{% fieldclass_verbose_name 'Publicacao' 'data' %}</th> |
|||
<th>{% fieldclass_verbose_name 'Publicacao' 'numero' %}</th> |
|||
<th>{% fieldclass_verbose_name 'Publicacao' 'ano' %}</th> |
|||
<th>{% fieldclass_verbose_name 'Publicacao' 'edicao' %}</th> |
|||
<th>{% fieldclass_verbose_name 'Publicacao' 'veiculo_publicacao' %}</th> |
|||
<th>{% fieldclass_verbose_name 'Publicacao' 'tipo_publicacao' %}</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
{% for pub in object_list %} |
|||
<tr> |
|||
<td><a href="{% url 'ta_pub_detail' view.kwargs.ta_id pub.pk%}">{{ pub.data }}</a></td> |
|||
<td>{{ pub.numero|default:'' }}</td> |
|||
<td>{{ pub.ano|default:'' }}</td> |
|||
<td>{{ pub.edicao|default:'' }}</td> |
|||
<td>{{ pub.veiculo_publicacao }}</td> |
|||
<td>{{ pub.tipo_publicacao}}</td> |
|||
</tr> |
|||
{% endfor %} |
|||
</tbody> |
|||
</table> |
|||
{%endif%} |
|||
|
|||
{% if is_paginated %} |
|||
<div class="pagination-centered"> |
|||
<ul class="pagination" role="menubar" aria-label="Pagination"> |
|||
{% if page_obj.has_previous %} |
|||
<li> |
|||
<a href="?page={{ page_obj.previous_page_number }}"> |
|||
<span class="arrow">«</span> |
|||
</a> |
|||
</li> |
|||
{% else %} |
|||
<li class="arrow unavailable" aria-disabled="true"><a href="">«</a></li> |
|||
{% endif %} |
|||
|
|||
{% for page in page_range %} |
|||
{% if page %} |
|||
<li {% if page == page_obj.number %}class="current"{% endif %}> |
|||
<a href="?page={{ page }}">{{ page }}</a> |
|||
</li> |
|||
{% else %} |
|||
<li class="unavailable" aria-disabled="true"><a href="">…</a></li> |
|||
{% endif %} |
|||
{% endfor %} |
|||
|
|||
{% if page_obj.has_next %} |
|||
<li> |
|||
<a href="?page={{ page_obj.next_page_number }}"> |
|||
<span class="arrow">»</span> |
|||
</a> |
|||
</li> |
|||
{% else %} |
|||
<li class="arrow unavailable" aria-disabled="true"><a href="">»</a></li> |
|||
{% endif %} |
|||
</ul> |
|||
</div> |
|||
{% endif %} |
|||
{% endblock %} |
Loading…
Reference in new issue