Browse Source

Adapta relatório agenda de espaços para djbs-theme

pull/184/head
Sesóstris Vieira 3 weeks ago
parent
commit
240415bb95
  1. 58
      sigi/apps/espacos/templates/espacos/agenda.html
  2. 107
      sigi/apps/espacos/templates/espacos/agenda_pdf.html
  3. 78
      sigi/apps/espacos/templates/espacos/snippets/agenda_cal.html

58
sigi/apps/espacos/templates/espacos/agenda.html

@ -0,0 +1,58 @@
{% extends "eventos/calendario.html" %}
{% load i18n static sigi_tags djbs_extras %}
{% block extrastyle %}
{{ block.super }}
<style>
tr.linha-evento {
border-bottom: 1px solid var(--hairline-color);
}
tr.linha-evento.last {
border-bottom: 1px solid var(--main-bg-color);
}
tr td {
border-left: 1px solid var(--hairline-color);
}
.col-horario {
width: 5em;
text-aign: right;
}
</style>
{% endblock %}
{% block breadcrumbs %}
<li class="breadcrumb-item">{% translate "Relatórios" %}</li>
<li class="breadcrumb-item">{% translate "Reserva de espaços" %}</li>
{% endblock %}
{% block content %}
<div class="card mb-3">
<div class="card-header">
{% icon "filter" %} {% translate "Filtros" %}
</div>
<div class="card-body">
<ul class="nav nav-tabs" id="anoTab" role="tablist">
{% for ano in meses %}
<li class="nav-item" role="presentation">
<button class="nav-link{% if ano == ano_pesquisa %} active{% endif %}" id="tab-{{ ano|safe }}" data-bs-toggle="tab" data-bs-target="#tab-pane-{{ ano|safe }}" type="button" role="tab" aria-controls="tab-pane-{{ ano|safe }}" aria-selected="{% if ano == ano_pesquisa %}true{% else %}false{% endif %}">{{ ano|safe }}</button>
</li>
{% endfor %}
</ul>
<div class="tab-content" id="anoTabContent">
{% for ano, lista in meses.items %}
<div class="tab-pane fade p-3{% if ano == ano_pesquisa %} show active{% endif %}" id="tab-pane-{{ ano|safe }}" role="tabpanel" aria-labelledby="tab-{{ ano|safe }}" tabindex="0">
{% for mes, nome in lista.items %}
<a class="btn btn-outline-primary btn-sm{% if ano == ano_pesquisa and mes == mes_pesquisa %} disabled{% endif %}" href="?ano={{ ano|safe }}&mes={{ mes|safe }}">{{ nome }}</a>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
<div class="card-footer d-flex justify-content-end">
<div>
<a class="btn btn-primary" role="button" href="?ano={{ ano_pesquisa|safe }}&mes={{ mes_pesquisa|safe }}&pdf=1" title="{% trans 'Exportar para PDF' %}">{% icon "pdf" %} {% trans 'Exportar para PDF' %}</a>
</div>
</div>
</div>
{% include "espacos/snippets/agenda_cal.html" %}
{% endblock %}

107
sigi/apps/espacos/templates/espacos/agenda_pdf.html

@ -0,0 +1,107 @@
{% extends 'pdf/base_report.html' %}
{% load static i18n sigi_tags %}
{% block extra_style %}
{{ block.super }}
.card-header {
font-size: 1.1 rem;
font-weight: bold;
}
a {
color: black;
text-decoration: none;
}
table {
table-layout: fixed;
}
.calendar-table {
border-collapse: collapse;
border-spacing: 0;
border: 1px solid #d2d2d2;
}
.calendar-table td+td {
border-left: 1px solid #d2d2d2 !important;
}
table td,
table td * {
vertical-align: top;
}
.calendar-table tr:nth-child(even) {
background-color: white !important;
}
tr.linha-dias {
background: #d2d2d2;
border-top: 1px solid #d2d2d2;
}
tr.linha-evento {
border-bottom: 1px solid #d2d2d2;
}
tr.linha-evento.last {
border-bottom: 1px solid #007433;
}
span.numero-dia {
font-size: 1em;
}
.card {
background-color: #fff;
padding: 15px;
margin: 10px 0;
}
.card .card-content .card-title {
display: block;
line-height: 32px;
margin-bottom: 8px;
font-weight: 300;
}
.card-title {
font-size: 20px !important;
margin-bottom: -6px !important;
}
.data-evento {
font-size: 1em;
display: block;
}
.tipo-evento {
font-size: 1em;
color: var(--body-quiet-color);
display: block;
margin-bottom: 8px;
}
.evento {
margin: 0;
padding: 5px 10px;
}
.cyan.lighten-4 { background-color: #b2ebf2!important; }
.red.lighten-4 { background-color: #ffcdd2!important; }
.purple.lighten-4 { background-color: #e1bee7!important; }
.blue.lighten-4 { background-color: #bbdefb!important; }
.orange.lighten-4 { background-color: #ffe0b2!important; }
.brown.lighten-4 { background-color: #d7ccc8 !important; }
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url('/static/material/fonts/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2') format('woff2');
}
i.tiny { font-size: 1rem; }
.material-icons {
font-family: "Material Icons";
font-weight: 400;
font-style: normal;
font-size: 24px;
line-height: 1;
letter-spacing: normal;
text-transform: none;
display: inline-block;
white-space: nowrap;
word-wrap: normal;
direction: ltr;
-webkit-font-feature-settings: "liga";
-webkit-font-smoothing: antialiased;
}
{% endblock %}
{% block main_content %}
{% include "espacos/snippets/agenda_cal.html" %}
{% endblock main_content %}

78
sigi/apps/espacos/templates/espacos/snippets/agenda_cal.html

@ -0,0 +1,78 @@
{% load i18n static sigi_tags %}
{% for semana in semanas %}
{% if pdf and not forloop.last and not forloop.first and semana|length > 1 %}
<div class="new-page"></div>
{% endif %}
<div class="card mb-3">
<div class="card-header">
{% blocktranslate with start=semana.datas|first|date:"SHORT_DATE_FORMAT" end=semana.datas|last|date:"SHORT_DATE_FORMAT" %}
Semana de {{ start }} a {{ end }}
{% endblocktranslate %}
</div>
<div class="card-body">
{% if semana|length > 1 %}
<table class="table table-responsive table-sm table-bordered">
<colgroup>
<col class="col-sala"/>
<col class="col-horario"/>
</colgroup>
<thead>
<tr>
<th rowspan="2">{% trans "Espaço" %}</th>
<th rowspan="2" class="col-horario"></th>
{% for name in day_names %}
<th>{{ name }}</th>
{% endfor %}
</tr>
<tr>
{% for dia in semana.datas %}
<th>{{ dia|date:"d/m"}}</th>
{% endfor %}
</tr>
</thead>
<tbody class="table-group-divider">
{% for espaco, linhas in semana.items %}
{% if espaco != "datas" %}
{% for linha in linhas %}
<tr class="linha-evento{% if forloop.last %} last{% endif %}">
{% if forloop.first %}
<th rowspan="{{ linhas|length}}">{{ espaco.sigla }}</th>
{% endif %}
<td class="col-horario">{{ linha.hora }}</td>
{% for coluna in linha.colunas %}
{% if "reserva" in coluna %}
<td colspan="{{ coluna.colspan}}" rowspan="{{ coluna.rowspan}}" class="blue lighten-4">
<p>
<strong>
<a href="{% url "admin:espacos_reserva_change" coluna.reserva.id %}">
{{ coluna.reserva.proposito }}
</a>
</strong>
</p>
<p>{{ coluna.reserva.data_inicio|interval:coluna.reserva.data_termino }}</p>
<p>
{% blocktranslate with solicitante=coluna.reserva.solicitante %}
solicitado por {{ solicitante }}
{% endblocktranslate %}
</p>
</td>
{% else %}
{% if not coluna is None %}
<td></td>
{% endif %}
{% endif %}
{% endfor %}
</tr>
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table>
{% else %}
<p class="card-text">{% translate "Nenhuma reserva de espaço nesta semana" %}</p>
{% endif %}
</div>
</div>
{% endfor %}
Loading…
Cancel
Save