feat: várias melhorias e evoluções no projeto
This commit is contained in:
13
diarios_oficiais_alems/templates/403.html
Normal file
13
diarios_oficiais_alems/templates/403.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Forbidden (403){% endblock title %}
|
||||
{% block content %}
|
||||
<h1>Forbidden (403)</h1>
|
||||
<p>
|
||||
{% if exception %}
|
||||
{{ exception }}
|
||||
{% else %}
|
||||
You're not allowed to access this page.
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endblock content %}
|
||||
13
diarios_oficiais_alems/templates/403_csrf.html
Normal file
13
diarios_oficiais_alems/templates/403_csrf.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Forbidden (403){% endblock title %}
|
||||
{% block content %}
|
||||
<h1>Forbidden (403)</h1>
|
||||
<p>
|
||||
{% if exception %}
|
||||
{{ exception }}
|
||||
{% else %}
|
||||
You're not allowed to access this page.
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endblock content %}
|
||||
13
diarios_oficiais_alems/templates/404.html
Normal file
13
diarios_oficiais_alems/templates/404.html
Normal file
@ -0,0 +1,13 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Page not found{% endblock title %}
|
||||
{% block content %}
|
||||
<h1>Page not found</h1>
|
||||
<p>
|
||||
{% if exception %}
|
||||
{{ exception }}
|
||||
{% else %}
|
||||
This is not the page you were looking for.
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endblock content %}
|
||||
10
diarios_oficiais_alems/templates/500.html
Normal file
10
diarios_oficiais_alems/templates/500.html
Normal file
@ -0,0 +1,10 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Server Error{% endblock title %}
|
||||
{% block content %}
|
||||
<h1>Ooops!!! 500</h1>
|
||||
<h3>Looks like something went wrong!</h3>
|
||||
<p>
|
||||
We track these errors automatically, but if the problem persists feel free to contact us. In the meantime, try refreshing.
|
||||
</p>
|
||||
{% endblock content %}
|
||||
@ -0,0 +1,11 @@
|
||||
{% extends "account/base_manage.html" %}
|
||||
|
||||
{% block main %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock main %}
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
{% load i18n %}
|
||||
{% load allauth %}
|
||||
|
||||
<div class="alert alert-error">
|
||||
{% slot message %}
|
||||
{% endslot %}
|
||||
</div>
|
||||
@ -0,0 +1,6 @@
|
||||
{% load allauth %}
|
||||
|
||||
<span class="badge {% if 'success' in attrs.tags %}bg-success{% endif %} {% if 'warning' in attrs.tags %}bg-warning{% endif %} {% if 'secondary' in attrs.tags %}bg-secondary{% endif %} {% if 'danger' in attrs.tags %}bg-danger{% endif %} {% if 'primary' in attrs.tags %}bg-primary{% endif %}">
|
||||
{% slot %}
|
||||
{% endslot %}
|
||||
</span>
|
||||
@ -0,0 +1,20 @@
|
||||
{% load allauth %}
|
||||
|
||||
{% comment %} djlint:off {% endcomment %}
|
||||
<{% if attrs.href %}a href="{{ attrs.href }}"{% else %}button{% endif %}
|
||||
{% if attrs.form %}form="{{ attrs.form }}"{% endif %}
|
||||
{% if attrs.id %}id="{{ attrs.id }}"{% endif %}
|
||||
{% if attrs.name %}name="{{ attrs.name }}"{% endif %}
|
||||
{% if attrs.type %}type="{{ attrs.type }}"{% endif %}
|
||||
class="btn
|
||||
{% if 'success' in attrs.tags %}btn-success
|
||||
{% elif 'warning' in attrs.tags %}btn-warning
|
||||
{% elif 'secondary' in attrs.tags %}btn-secondary
|
||||
{% elif 'danger' in attrs.tags %}btn-danger
|
||||
{% elif 'primary' in attrs.tags %}btn-primary
|
||||
{% else %}btn-primary
|
||||
{% endif %}"
|
||||
>
|
||||
{% slot %}
|
||||
{% endslot %}
|
||||
</{% if attrs.href %}a{% else %}button{% endif %}>
|
||||
66
diarios_oficiais_alems/templates/allauth/elements/field.html
Normal file
66
diarios_oficiais_alems/templates/allauth/elements/field.html
Normal file
@ -0,0 +1,66 @@
|
||||
{% load allauth %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% if attrs.type == "textarea" %}
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-10">
|
||||
<label for="{{ attrs.id }}">
|
||||
{% slot label %}
|
||||
{% endslot %}
|
||||
</label>
|
||||
</div>
|
||||
<textarea {% if attrs.required %}required{% endif %}
|
||||
{% if attrs.rows %}rows="{{ attrs.rows }}"{% endif %}
|
||||
{% if attrs.disabled %}disabled{% endif %}
|
||||
{% if attrs.readonly %}readonly{% endif %}
|
||||
{% if attrs.checked %}checked{% endif %}
|
||||
{% if attrs.name %}name="{{ attrs.name }}"{% endif %}
|
||||
{% if attrs.id %}id="{{ attrs.id }}"{% endif %}
|
||||
{% if attrs.placeholder %}placeholder="{{ attrs.placeholder }}"{% endif %}
|
||||
class="form-control">{% slot value %}{% endslot %}</textarea>
|
||||
</div>
|
||||
{% elif attrs.type == "radio" %}
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check">
|
||||
<input {% if attrs.required %}required{% endif %}
|
||||
{% if attrs.disabled %}disabled{% endif %}
|
||||
{% if attrs.readonly %}readonly{% endif %}
|
||||
{% if attrs.checked %}checked{% endif %}
|
||||
{% if attrs.name %}name="{{ attrs.name }}"{% endif %}
|
||||
{% if attrs.id %}id="{{ attrs.id }}"{% endif %}
|
||||
{% if attrs.placeholder %}placeholder="{{ attrs.placeholder }}"{% endif %}
|
||||
{% if attrs.autocomplete %}autocomplete="{{ attrs.autocomplete }}"{% endif %}
|
||||
value="{{ attrs.value|default_if_none:"" }}"
|
||||
type="{{ attrs.type }}" />
|
||||
<label class="form-check-label" for="{{ attrs.id }}">
|
||||
{% slot label %}
|
||||
{% endslot %}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-sm-10">
|
||||
<label for="{{ attrs.id }}">
|
||||
{% slot label %}
|
||||
{% endslot %}
|
||||
</label>
|
||||
</div>
|
||||
<div class="col-sm-10">
|
||||
<input {% if attrs.required %}required{% endif %}
|
||||
{% if attrs.disabled %}disabled{% endif %}
|
||||
{% if attrs.readonly %}readonly{% endif %}
|
||||
{% if attrs.checked %}checked{% endif %}
|
||||
{% if attrs.name %}name="{{ attrs.name }}"{% endif %}
|
||||
{% if attrs.id %}id="{{ attrs.id }}"{% endif %}
|
||||
{% if attrs.placeholder %}placeholder="{{ attrs.placeholder }}"{% endif %}
|
||||
{% if attrs.autocomplete %}autocomplete="{{ attrs.autocomplete }}"{% endif %}
|
||||
value="{{ attrs.value|default_if_none:"" }}"
|
||||
type="{{ attrs.type }}"
|
||||
class="form-control" />
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if slots.help_text %}
|
||||
<div class="form-text">{% slot help_text %}{% endslot %}</div>
|
||||
{% endif %}
|
||||
@ -0,0 +1,3 @@
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{{ attrs.form|crispy }}
|
||||
19
diarios_oficiais_alems/templates/allauth/elements/panel.html
Normal file
19
diarios_oficiais_alems/templates/allauth/elements/panel.html
Normal file
@ -0,0 +1,19 @@
|
||||
{% load allauth %}
|
||||
|
||||
<section>
|
||||
<div class="card mb-4">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">
|
||||
{% slot title %}
|
||||
{% endslot %}
|
||||
</h2>
|
||||
{% slot body %}
|
||||
{% endslot %}
|
||||
{% if slots.actions %}
|
||||
<ul>
|
||||
{% for action in slots.actions %}<li>{{ action }}</li>{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@ -0,0 +1,6 @@
|
||||
{% load allauth %}
|
||||
|
||||
<table class="table">
|
||||
{% slot %}
|
||||
{% endslot %}
|
||||
</table>
|
||||
@ -0,0 +1,31 @@
|
||||
{% extends "base.html" %}
|
||||
{% load i18n %}
|
||||
{% block bodyclass %}bg-light{% endblock bodyclass %}
|
||||
|
||||
{% block css %}{{ block.super }}{% endblock css %}
|
||||
{% block title %}
|
||||
{% block head_title %}
|
||||
{% trans "Sign In" %}
|
||||
{% endblock head_title %}
|
||||
{% endblock title %}
|
||||
{% block body %}
|
||||
<div class="d-flex justify-content-center h-100 py-4">
|
||||
<div class="col-md-4 py-4 my-4 px-4">
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-dismissible {% if message.tags %}alert-{{ message.tags }}{% endif %}">
|
||||
{{ message }}
|
||||
<button type="button"
|
||||
class="btn-close"
|
||||
data-bs-dismiss="alert"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
{% block extra_body %}
|
||||
{% endblock extra_body %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock body %}
|
||||
@ -0,0 +1,6 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block main %}
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
{% endblock main %}
|
||||
145
diarios_oficiais_alems/templates/base.html
Normal file
145
diarios_oficiais_alems/templates/base.html
Normal file
@ -0,0 +1,145 @@
|
||||
|
||||
{% load static i18n compress%}<!DOCTYPE html>
|
||||
{% get_current_language as LANGUAGE_CODE %}
|
||||
<html lang="{{ LANGUAGE_CODE }}">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||||
<title>
|
||||
{% block title %}
|
||||
Diários Oficiais ALEMS
|
||||
{% endblock title %}
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description"
|
||||
content="Indexação dos Diários Oficiais da ALEMS" />
|
||||
<meta name="author"
|
||||
content="Antonio Roberto" />
|
||||
<link rel="icon" href="{% static 'images/favicons/favicon.ico' %}" />
|
||||
{% block css %}
|
||||
<!-- Latest compiled and minified Bootstrap CSS -->
|
||||
<link rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/css/bootstrap.min.css"
|
||||
integrity="sha512-SbiR/eusphKoMVVXysTKG/7VseWii+Y3FdHrt0EpKgpToZeemhqHeZeLWLhJutz/2ut2Vw1uQEj2MbRF+TVBUA=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer" />
|
||||
<!-- Your stuff: Third-party CSS libraries go here -->
|
||||
<!-- This file stores project-specific CSS -->
|
||||
|
||||
|
||||
{% compress css %}
|
||||
<link href="{% static 'css/project.css' %}" rel="stylesheet" />
|
||||
{% endcompress %}
|
||||
|
||||
|
||||
{% endblock css %}
|
||||
<!-- Le javascript
|
||||
================================================== -->
|
||||
{# Placed at the top of the document so pages load faster with defer #}
|
||||
{% block javascript %}
|
||||
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script defer
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/js/bootstrap.min.js"
|
||||
integrity="sha512-1/RvZTcCDEUjY/CypiMz+iqqtaoQfAITmNSJY17Myp4Ms5mdxPS5UV7iOfdZoxcGhzFbOm6sntTKJppjvuhg4g=="
|
||||
crossorigin="anonymous"
|
||||
referrerpolicy="no-referrer"></script>
|
||||
<!-- Your stuff: Third-party javascript libraries go here -->
|
||||
|
||||
|
||||
<!-- place project specific Javascript in this file -->
|
||||
|
||||
|
||||
{% compress js %}
|
||||
<script defer src="{% static 'js/project.js' %}"></script>
|
||||
{% endcompress %}
|
||||
|
||||
|
||||
{% endblock javascript %}
|
||||
</head>
|
||||
<body class="{% block bodyclass %}{% endblock bodyclass %}">
|
||||
{% block body %}
|
||||
<div class="mb-1">
|
||||
<nav class="navbar navbar-expand-md navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<button class="navbar-toggler navbar-toggler-right"
|
||||
type="button"
|
||||
data-bs-toggle="collapse"
|
||||
data-bs-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent"
|
||||
aria-expanded="false"
|
||||
aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{% url 'home' %}">Diários Oficiais ALEMS</a>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav mr-auto">
|
||||
<li class="nav-item active">
|
||||
<a class="nav-link" href="{% url 'home' %}">Home <span class="visually-hidden">(current)</span></a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'about' %}">About</a>
|
||||
</li>
|
||||
{% if request.user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link"
|
||||
href="{% url 'users:detail' request.user.username %}">{% translate "My Profile" %}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
{# URL provided by django-allauth/account/urls.py #}
|
||||
<a class="nav-link" href="{% url 'account_logout' %}">{% translate "Sign Out" %}</a>
|
||||
</li>
|
||||
{% else %}
|
||||
{% if ACCOUNT_ALLOW_REGISTRATION %}
|
||||
<li class="nav-item">
|
||||
{# URL provided by django-allauth/account/urls.py #}
|
||||
<a id="sign-up-link" class="nav-link" href="{% url 'account_signup' %}">{% translate "Sign Up" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item">
|
||||
{# URL provided by django-allauth/account/urls.py #}
|
||||
<a id="log-in-link" class="nav-link" href="{% url 'account_login' %}">{% translate "Sign In" %}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="container">
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-dismissible {% if message.tags %}alert-{{ message.tags }}{% endif %}">
|
||||
{{ message }}
|
||||
<button type="button"
|
||||
class="btn-close"
|
||||
data-bs-dismiss="alert"
|
||||
aria-label="Close"></button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% block main %}
|
||||
{% block content %}
|
||||
<p>Use this document as a way to quick start any new project.</p>
|
||||
{% endblock content %}
|
||||
{% endblock main %}
|
||||
|
||||
</div>
|
||||
{% endblock body %}
|
||||
<!-- /container -->
|
||||
{% block modal %}
|
||||
{% endblock modal %}
|
||||
{% block inline_javascript %}
|
||||
{% comment %}
|
||||
Script tags with only code, no src (defer by default). To run
|
||||
with a "defer" so that you run inline code:
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
/* Run whatever you want */
|
||||
});
|
||||
</script>
|
||||
{% endcomment %}
|
||||
{% endblock inline_javascript %}
|
||||
</body>
|
||||
</html>
|
||||
301
diarios_oficiais_alems/templates/diarios/index.html
Normal file
301
diarios_oficiais_alems/templates/diarios/index.html
Normal file
@ -0,0 +1,301 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-BR">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Sistema de Busca de Diários Oficiais</title>
|
||||
<!-- Bootstrap 5 CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||
<!-- Alpine.js -->
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.13.1/dist/cdn.min.js"></script>
|
||||
<!-- Estilos customizados -->
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body class="bg-light-gradient">
|
||||
<div class="container py-5" x-data="searchApp">
|
||||
<div class="row justify-content-center mb-4">
|
||||
<div class="col-12 col-lg-10">
|
||||
<div class="text-center mb-5">
|
||||
<h1 class="display-5 fw-bold text-primary mb-3">
|
||||
<i class="bi bi-search me-2"></i>Sistema de Busca de Diários Oficiais
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<div class="card search-card mb-5">
|
||||
<div class="card-body p-4">
|
||||
<form @submit.prevent="performSearch" class="row g-3">
|
||||
<div class="col-12">
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="bi bi-search"></i></span>
|
||||
<input type="text" class="form-control form-control-lg"
|
||||
x-model="searchParams.q"
|
||||
placeholder="Digite o termo de busca"
|
||||
aria-label="Termo de busca">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
<span x-show="!isLoading">Buscar</span>
|
||||
<span x-show="isLoading" class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Opções básicas de busca (sempre visíveis) -->
|
||||
<div class="col-12 mt-2">
|
||||
<div class="row align-items-end">
|
||||
<div class="col-md-4 mb-2 mb-md-0">
|
||||
<label for="numero_diario" class="form-label">Número do Diário</label>
|
||||
<input type="text" class="form-control" id="numero_diario"
|
||||
x-model="searchParams.numero_diario"
|
||||
placeholder="Ex: 1234">
|
||||
</div>
|
||||
<div class="col-md-4 mb-2 mb-md-0">
|
||||
<label for="modo_busca" class="form-label">Modo de Busca</label>
|
||||
<select class="form-select" id="modo_busca" x-model="searchParams.modo_busca">
|
||||
<option value="exata">Busca exata</option>
|
||||
<option value="qualquer">Qualquer termo</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 col-xl-4">
|
||||
<div class="d-flex flex-column">
|
||||
<label class="form-label">Ordenar por</label>
|
||||
<div class="btn-group" role="group">
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm"
|
||||
:class="{'active': searchParams.ordenar_por === 'relevancia'}"
|
||||
@click="changeOrder('relevancia')">
|
||||
<i class="bi bi-star me-1"></i>Relevância
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm"
|
||||
:class="{'active': searchParams.ordenar_por === 'data_desc'}"
|
||||
@click="changeOrder('data_desc')">
|
||||
<i class="bi bi-sort-down-alt me-1"></i>Data<br>(Decrescente)
|
||||
</button>
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm"
|
||||
:class="{'active': searchParams.ordenar_por === 'data_asc'}"
|
||||
@click="changeOrder('data_asc')">
|
||||
<i class="bi bi-sort-down me-1"></i>Data<br>(Crescente)
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 mt-3">
|
||||
<button class="btn btn-sm btn-outline-secondary" type="button" @click="showAdvanced = !showAdvanced">
|
||||
<span x-text="showAdvanced ? 'Ocultar filtros avançados' : 'Mostrar filtros avançados'"></span>
|
||||
<i class="bi" :class="showAdvanced ? 'bi-chevron-up' : 'bi-chevron-down'"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="col-12" x-show="showAdvanced" x-transition>
|
||||
<div class="row g-3 mt-1">
|
||||
<div class="col-md-6">
|
||||
<label for="data_inicio" class="form-label">Data inicial</label>
|
||||
<input type="date" class="form-control date-picker" id="data_inicio" x-model="searchParams.data_inicio">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="data_fim" class="form-label">Data final</label>
|
||||
<input type="date" class="form-control date-picker" id="data_fim" x-model="searchParams.data_fim">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row g-3 mt-1">
|
||||
<div class="col-md-6">
|
||||
<label for="page_size" class="form-label">Resultados por página</label>
|
||||
<select class="form-select" id="page_size" x-model="searchParams.page_size">
|
||||
<option value="10">10</option>
|
||||
<option value="20">20</option>
|
||||
<option value="30">30</option>
|
||||
<option value="50">50</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Adicionando a seção de "Você quis dizer" após iniciar a busca -->
|
||||
<template x-if="!isLoading && !error && searchResults && suggestion && shouldShowSuggestion">
|
||||
<div class="mb-3 mt-3 alert alert-info d-flex align-items-center">
|
||||
<i class="bi bi-lightbulb-fill me-2"></i>
|
||||
<span>Você quis dizer:
|
||||
<a href="#" @click.prevent="usesuggestion" class="alert-link" x-text="suggestion"></a>?
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
<!-- Resultados -->
|
||||
<div x-show="hasSearched" class="mb-4">
|
||||
<template x-if="isLoading">
|
||||
<div class="d-flex justify-content-center my-5">
|
||||
<div class="spinner-border text-primary" role="status">
|
||||
<span class="visually-hidden">Carregando...</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template x-if="!isLoading && error">
|
||||
<div class="alert alert-danger" role="alert">
|
||||
<i class="bi bi-exclamation-triangle-fill me-2"></i>
|
||||
<span x-text="error"></span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template x-if="!isLoading && !error && searchResults">
|
||||
<div>
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2 class="h4 m-0">
|
||||
<span x-text="searchResults.total"></span> Resultados encontrados
|
||||
<template x-if="searchParams.q">
|
||||
<span>para "<span x-text="searchParams.q"></span>"</span>
|
||||
</template>
|
||||
</h2>
|
||||
<button @click="resetSearch" class="btn btn-sm btn-outline-secondary">
|
||||
<i class="bi bi-arrow-counterclockwise me-1"></i> Nova busca
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<template x-if="searchResults.total === 0">
|
||||
<div class="alert alert-info" role="alert">
|
||||
<i class="bi bi-info-circle-fill me-2"></i>
|
||||
Nenhum resultado encontrado para os critérios de busca informados.
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template x-if="searchResults.total > 0">
|
||||
<div>
|
||||
<!-- Lista de resultados -->
|
||||
<div class="mb-4">
|
||||
<template x-for="(diario, diarioIndex) in searchResults.resultados" :key="diario.id">
|
||||
<div class="card result-card mb-4 border-0 shadow-sm">
|
||||
<div class="card-header bg-white py-3 d-flex justify-content-between align-items-center">
|
||||
<h5 class="card-title mb-0">
|
||||
<span class="badge bg-primary me-2" x-text="diario.tipo"></span>
|
||||
<span x-text="diario.numero"></span>
|
||||
</h5>
|
||||
<span class="text-muted" x-text="formatDate(diario.data)"></span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<template x-if="diario.paginas && diario.paginas.length > 0">
|
||||
<div>
|
||||
<!-- Melhor página encontrada (mostrada apenas se estiver ordenado por relevância e tiver score) -->
|
||||
<template x-if="hasBestMatch(diario)">
|
||||
<div class="mb-4 p-3 best-match rounded">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<div>
|
||||
<span class="page-badge me-2">Página <span x-text="getBestPage(diario.paginas).numero"></span></span>
|
||||
<span class="match-score">
|
||||
<i class="bi bi-star-fill me-1 small"></i>
|
||||
Melhor correspondência no diário
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-content">
|
||||
<div x-html="getBestPage(diario.paginas).conteudo"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Accordion de páginas -->
|
||||
<template x-if="diario.paginas.length > 1">
|
||||
<div class="accordion mt-3" :id="'accordionDiario' + diario.id">
|
||||
<div class="accordion-item border-0 mb-2">
|
||||
<h2 class="accordion-header">
|
||||
<button class="accordion-button collapsed shadow-sm" type="button"
|
||||
data-bs-toggle="collapse"
|
||||
:data-bs-target="'#collapse' + diario.id"
|
||||
aria-expanded="false">
|
||||
<i class="bi bi-list-ul me-2"></i>
|
||||
<template x-if="hasBestMatch(diario) && diario.paginas.length > 1">
|
||||
<span>Ver mais <span class="mx-1" x-text="getOtherPages(diario.paginas).length"></span> páginas deste diário</span>
|
||||
</template>
|
||||
<template x-if="!hasBestMatch(diario) && diario.paginas.length > 1">
|
||||
<span>Ver <span class="mx-1" x-text="diario.paginas.length"></span> páginas deste diário</span>
|
||||
</template>
|
||||
</button>
|
||||
</h2>
|
||||
<div :id="'collapse' + diario.id" class="accordion-collapse collapse"
|
||||
:data-bs-parent="'#accordionDiario' + diario.id">
|
||||
<div class="accordion-body p-0">
|
||||
<div class="list-group list-group-flush">
|
||||
<template x-for="pagina in hasBestMatch(diario) ? getOtherPages(diario.paginas) : diario.paginas" :key="pagina.numero">
|
||||
<div class="list-group-item border-0 py-3">
|
||||
<div class="d-flex justify-content-between align-items-center mb-2">
|
||||
<span class="page-badge">Página <span x-text="pagina.numero"></span></span>
|
||||
</div>
|
||||
<div class="page-preview" x-html="pagina.conteudo.substring(0, 200) + '...'"></div>
|
||||
<div x-show="isFullContentVisible(diarioIndex, pagina.numero)" x-transition class="mt-2 page-content border-top pt-3">
|
||||
<div x-html="pagina.conteudo"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="d-flex justify-content-end mt-3">
|
||||
<a :href="diario.link" target="_blank" class="btn btn-sm btn-outline-primary">
|
||||
<i class="bi bi-file-earmark-pdf me-1"></i> Ver Diário Completo
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- Paginação -->
|
||||
<nav aria-label="Navegação de páginas" x-show="totalPages > 1">
|
||||
<ul class="pagination justify-content-center">
|
||||
<li class="page-item" :class="{ 'disabled': searchParams.page <= 1 }">
|
||||
<a class="page-link" href="#" @click.prevent="goToPage(searchParams.page - 1)" aria-label="Anterior">
|
||||
<span aria-hidden="true">«</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<template x-for="page in paginationArray" :key="page">
|
||||
<li class="page-item" :class="{ 'active': page === searchParams.page }">
|
||||
<a class="page-link" href="#" @click.prevent="goToPage(page)" x-text="page"></a>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<li class="page-item" :class="{ 'disabled': searchParams.page >= totalPages }">
|
||||
<a class="page-link" href="#" @click.prevent="goToPage(searchParams.page + 1)" aria-label="Próximo">
|
||||
<span aria-hidden="true">»</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="bg-dark text-white py-4 mt-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h5>Sistema de Busca de Diários Oficiais</h5>
|
||||
<p class="small">Uma ferramenta avançada para pesquisa em diários oficiais.</p>
|
||||
</div>
|
||||
<div class="col-md-6 text-md-end">
|
||||
<p class="small mb-0">© 2025 Todos os direitos reservados</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap Bundle with Popper -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Script da aplicação -->
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
3
diarios_oficiais_alems/templates/pages/about.html
Normal file
3
diarios_oficiais_alems/templates/pages/about.html
Normal file
@ -0,0 +1,3 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
|
||||
3
diarios_oficiais_alems/templates/pages/home.html
Normal file
3
diarios_oficiais_alems/templates/pages/home.html
Normal file
@ -0,0 +1,3 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
|
||||
44
diarios_oficiais_alems/templates/users/user_detail.html
Normal file
44
diarios_oficiais_alems/templates/users/user_detail.html
Normal file
@ -0,0 +1,44 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block title %}
|
||||
User:
|
||||
|
||||
{{ object.username }}
|
||||
|
||||
|
||||
{% endblock title %}
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<h2>
|
||||
|
||||
|
||||
{{ object.username }}
|
||||
|
||||
</h2>
|
||||
{% if object.name %}
|
||||
<p>{{ object.name }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if object == request.user %}
|
||||
<!-- Action buttons -->
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<a class="btn btn-primary" href="{% url 'users:update' %}" role="button">My Info</a>
|
||||
<a class="btn btn-primary"
|
||||
href="{% url 'account_email' %}"
|
||||
role="button">E-Mail</a>
|
||||
<a class="btn btn-primary"
|
||||
href="{% url 'mfa_index' %}"
|
||||
role="button">MFA</a>
|
||||
<!-- Your Stuff: Custom user template urls -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Action buttons -->
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
31
diarios_oficiais_alems/templates/users/user_form.html
Normal file
31
diarios_oficiais_alems/templates/users/user_form.html
Normal file
@ -0,0 +1,31 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block title %}
|
||||
|
||||
|
||||
{{ user.username }}
|
||||
|
||||
|
||||
{% endblock title %}
|
||||
{% block content %}
|
||||
<h1>
|
||||
|
||||
|
||||
{{ user.username }}
|
||||
|
||||
|
||||
</h1>
|
||||
<form class="form-horizontal"
|
||||
method="post"
|
||||
action="{% url 'users:update' %}">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn btn-primary">Update</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user