beta v.1.1
This commit is contained in:
7
Templates/403.html
Normal file
7
Templates/403.html
Normal file
@@ -0,0 +1,7 @@
|
||||
{% extends "BaseLogin.html" %}
|
||||
{% block title %} Dashboard {% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<br> Erro 403 <br>
|
||||
|
||||
{% endblock %}
|
||||
11
Templates/404.html
Normal file
11
Templates/404.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Não Encontrado</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1> Algo deu ruim ai . </h1>
|
||||
<a href="{% url 'Home' %}" class="btn btn-secondary mt-3 "> Home </a>
|
||||
</body>
|
||||
</html>
|
||||
25
Templates/Base.html
Normal file
25
Templates/Base.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-br" data-bs-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %} {% endblock %}</title>
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
||||
crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
{% include 'components/_header.html' %}
|
||||
<div class="row">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% include 'components/_footer.html' %}
|
||||
|
||||
<script async src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
||||
crossorigin="anonymous"></script>
|
||||
</body>
|
||||
</html>
|
||||
43
Templates/BaseLogin.html
Normal file
43
Templates/BaseLogin.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-br" data-bs-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{% block title %} {% endblock %}</title>
|
||||
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
||||
rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
||||
crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
|
||||
</head>
|
||||
<body class="">
|
||||
{% include 'components/_header.html' %}
|
||||
<div class="row">
|
||||
<div class="col-2 bg-body-tertiary " id="sidebar" >
|
||||
{% include 'components/_sidebar.html' %}
|
||||
|
||||
{# {% include 'components/_sidebar_admin.html' %}#}
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<div class="container-fluid">
|
||||
<div class="col py-3">
|
||||
<main>
|
||||
{% include 'components/_msg.html' %}
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% include 'components/_footer.html' %}
|
||||
<script async src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
||||
crossorigin="anonymous"></script>
|
||||
</body>
|
||||
<style>
|
||||
#sidebar {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</html>
|
||||
12
Templates/components/_footer.html
Normal file
12
Templates/components/_footer.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<footer class="footer mt-auto py-3 text-center bg-body-tertiary">
|
||||
<div class="container">
|
||||
<a class="navbar-brand --bs-success-text-emphasis" href="{% url 'Home' %}"> © Weverton </a>
|
||||
</div>
|
||||
</footer>
|
||||
<style>
|
||||
footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
34
Templates/components/_header.html
Normal file
34
Templates/components/_header.html
Normal file
@@ -0,0 +1,34 @@
|
||||
{% load tz %}
|
||||
</nav>
|
||||
<nav class="navbar navbar-expand-lg bg-body-tertiary">
|
||||
<i class="bi bi-balloon-heart"></i>
|
||||
<div class="container-fluid">
|
||||
{% if not user.is_authenticated %}
|
||||
<a class="navbar-brand --bs-success-text-emphasis" href="{% url 'Home' %}"> Wevertom </a>
|
||||
{% endif %}
|
||||
{% if user.is_authenticated %}
|
||||
<a class="navbar-brand --bs-success-text-emphasis" href="{% url 'Dashboard' %}"> Weverton </a>
|
||||
{% endif %}
|
||||
<ul class="nav justify-content-center">
|
||||
<li class="navbar-brand --bs-success-text-emphasis">
|
||||
Hoje dia {% now "d" %} de {% now "F" %} de {% now "Y" %} ({% now "d/m/Y" %})
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav justify-content-end">
|
||||
{% if not user.is_authenticated %}
|
||||
<li class="nav-item">
|
||||
<a class="btn btn-primary" aria-current="page" href="{% url 'login' %}">Login</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if user.is_authenticated %}
|
||||
<li class="navbar-brand --bs-success-text-emphasis">
|
||||
Ola, {{ user.username.capitalize }}
|
||||
</li>
|
||||
<form action="{% url 'logout' %}" method="post" id="logout-form" class="">
|
||||
{% csrf_token %}
|
||||
<button type="submit" class="btn btn-danger" aria-current="true"> Logout </button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
17
Templates/components/_msg.html
Normal file
17
Templates/components/_msg.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert {% if 'success' in message.tags %}alert-primary{% elif 'error' in message.tags %}alert-danger{% endif %} message" role="alert">
|
||||
{{ message }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<script>
|
||||
// Espera 5 segundos e depois remove as mensagens
|
||||
setTimeout(function() {
|
||||
const messages = document.querySelectorAll('.message');
|
||||
messages.forEach(function(message) {
|
||||
message.style.display = 'none';
|
||||
});
|
||||
}, 9000);
|
||||
</script>
|
||||
49
Templates/components/_pagination.html
Normal file
49
Templates/components/_pagination.html
Normal file
@@ -0,0 +1,49 @@
|
||||
{% if page_obj.has_other_pages %}
|
||||
<nav>
|
||||
<ul class="pagination justify-content-center">
|
||||
{% if page_obj.has_previous %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page=1">
|
||||
Primeira
|
||||
</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_obj.previous_page_number }}">
|
||||
Anterior
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% for page_number in page_obj.paginator.page_range %}
|
||||
{% if page_number <= page_obj.number|add:3 and page_number >= page_obj.number|add:-3 %}
|
||||
{% if page_obj.number == page_number %}
|
||||
<li class="page-item active">
|
||||
<a class="page-link" href="?page={{ page_number }}">
|
||||
{{ page_number }}
|
||||
</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_number }}">
|
||||
{{ page_number }}
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if page_obj.has_next %}
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_obj.next_page_number }}">
|
||||
Próxima
|
||||
</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="?page={{ page_obj.paginator.num_pages }}">
|
||||
Última
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endif %}
|
||||
10
Templates/components/_sidebar.html
Normal file
10
Templates/components/_sidebar.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% if user.is_authenticated %}
|
||||
<div class="" >
|
||||
<div class="list-group" >
|
||||
<a class="list-group-item list-group-item-action list-group-item-primary"
|
||||
aria-current="true" href="{% url 'Home' %}"> Home </a>
|
||||
<a class="list-group-item list-group-item-action list-group-item-primary"
|
||||
aria-current="true" href="{% url 'Dashboard' %}"> Dashboard </a>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
29
Templates/components/_sidebar_admin.html
Normal file
29
Templates/components/_sidebar_admin.html
Normal file
@@ -0,0 +1,29 @@
|
||||
{% if user.is_authenticated %}
|
||||
{% if user.is_superuser %}
|
||||
<div class="" >
|
||||
<div class="list-group" >
|
||||
{% if user.is_superuser %}
|
||||
<a class="list-group-item list-group-item-action list-group-item-primary" aria-current="true"
|
||||
href="{% url 'DashboardAdmin' %}"> Dashboard Admin </a> {% endif %}
|
||||
{% if user.is_superuser %}
|
||||
<a class="list-group-item list-group-item-action list-group-item-danger" aria-current="true"
|
||||
href="{% url 'DashboardTest' %}"> Dashboard Test </a>{% endif %}
|
||||
|
||||
{% if perms.Base.view_bankaccount %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'BankAccountsListView' %}" > Banks </a> {% endif %}
|
||||
{% if perms.Movement.view_paymentmethod %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'PaymentMethodListView' %}" > Metodos de Pag. </a>{% endif %}
|
||||
{% if perms.Base.view_product %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'ProductListListView' %}" > Lista de Produtos </a> {% endif %}
|
||||
{% if perms.Base.view_professional %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'ProfessionalListView' %}" > Professional </a> {% endif %}
|
||||
{% if perms.Calendar.view_time %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'TimeListView' %}" > Horarios </a> {% endif %}
|
||||
{% if perms.Base.view_service %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'ServiceListListView' %}" > Lista de Service </a> {% endif %}
|
||||
{% if perms.Movement.view_expensemovementt %}
|
||||
<a class="list-group-item list-group-item-action" href="{% url 'AccountListListView' %}" > Lista de Despesa </a> {% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
44
Templates/registration/login.html
Normal file
44
Templates/registration/login.html
Normal file
@@ -0,0 +1,44 @@
|
||||
{% extends 'Base.html' %}
|
||||
{% block title %}Login{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title text-center mb-4">Login</h5>
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Usuário</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Senha</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<div class="d-grid gap-2">
|
||||
<button type="submit" class="btn btn-primary">Entrar</button>
|
||||
</div>
|
||||
</form>
|
||||
{% if form.errors %}
|
||||
<div class="alert alert-danger mt-4">
|
||||
<ul class="mb-0">
|
||||
{% for field in form %}
|
||||
{% for error in field.errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% for error in form.non_field_errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user