Reogarnização dos arquivos estáticos

Arquivos Static agora estão organizados por app e espelham a estrutura dos arquivos Template.

Alguns arquivos ainda não estão totalmente adaptados.
This commit is contained in:
Eberton committed 2026-05-28 23:21:54 -03:00
1 parent cf91224602
commit 287cb258a4
41 files changed
+358 -126

No files matched your search

@@ -1,3 +1,10 @@
/* Fazer cada botão individual, não utilizar essa organização de botoes padroes por css único */
/* BUTTON STYLES */
.btn-simple {
color: var(--color-text-dark);
@@ -0,0 +1,90 @@
.confirmation-container {
display: flex;
flex-direction: column;
gap: 5px;
min-width: 320px;
max-width: 500px;
padding: 8px;
}
/* Title */
.confirmation-container h1 {
font-size: 1.5rem;
text-align: center;
}
/* Description */
.confirmation-description {
text-align: end;
}
/* Actions */
.confirmation-container form {
display: flex;
justify-content: end;
gap: var(--space-sm);
}
/* Both buttons */
.confirmation-container form .confirm, .negate {
display: flex;
align-items: center;
justify-content: center;
min-width: 120px;
padding: var(--space-sm) var(--space-sm);
border: none;
border-radius: var(--border-radius-sm);
text-decoration: none;
cursor: pointer;
transition: all ease;
}
/* Confirm button */
.confirmation-container form .confirm {
background-color: #dc3545;
color: white;
}
.confirmation-container form .confirm:hover {
filter: brightness(0.92);
}
.confirmation-container form .confirm:active {
transform: scale(0.98);
}
/* Negate button */
.confirmation-container form .negate {
background-color: var(--color-secondary);
color: var(--color-text-light);
}
.confirmation-container form .negate:hover {
filter: brightness(0.92);
}
.confirmation-container form .negate:active {
transform: scale(0.90);
}
@media (max-width: 600px) {
.confirmation-container {
min-width: unset;
width: 100%;
padding: var(--space-md);
}
.confirmation-container form {
flex-direction: column;
}
.confirmation-container form .confirm,
.confirmation-container form .negate {
width: 100%;
}
.confirmation-container h1 {
font-size: 1.25rem;
}
}
@@ -130,7 +130,7 @@ body.sidebar-collapsed .main-content {
.navbar-user-info {
display: flex;
justify-content: flex-end;
gap: var(--space-md);
gap: var(--space-sm);
}
.username {
@@ -167,3 +167,35 @@ body.sidebar-collapsed .main-content {
border-radius: var(--space-sm);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
@media screen and (max-width: 768px) {
.navbar-farm-selector,
.navbar-user-info {
transition: opacity var(--transition-speed) ease;
}
body:not(.sidebar-collapsed) .navbar-farm-selector,
body:not(.sidebar-collapsed) .navbar-user-info {
display: none;
}
.navbar {
padding: 0 var(--space-sm);
}
.w33 {
width: auto;
}
.navbar-user-info {
gap: var(--space-xs);
}
.username {
display: none;
}
.main-content {
overflow-x: hidden;
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

@@ -0,0 +1,44 @@
// SIDEBAR TOGGLER
document.addEventListener("DOMContentLoaded", () => {
const button = document.getElementById("sidebar-toggle");
const body = document.body;
const sidebarLinks = document.querySelectorAll(".sidebar-link");
if (!button) return;
const isMobile = window.innerWidth <= 768;
// Mobile always starts closed
if (isMobile) {
body.classList.add("sidebar-collapsed");
}
// Desktop uses the save state
else {
const savedState = localStorage.getItem("sidebarCollapsed");
if (savedState === "true") {
body.classList.add("sidebar-collapsed");
}
}
// Toggle
button.addEventListener("click", () => {
body.classList.toggle("sidebar-collapsed");
// Only saves the sidebar state on desktops
if (!isMobile) {
const isCollapsed = body.classList.contains("sidebar-collapsed");
localStorage.setItem("sidebarCollapsed", isCollapsed);
}
});
// Mobile choses sidebar when clicking a link
sidebarLinks.forEach(link => {
link.addEventListener("click", () => {
if (isMobile) {
body.classList.add("sidebar-collapsed");
}
});
});
});
@@ -1,4 +1,4 @@
{% extends "base_modal.html" %}
{% extends "layouts/base_modal.html" %}
{% load static %}
{% block content %}
@@ -9,8 +9,8 @@
{% endif %}
<form method="POST" action="{{ positive_url }}">
{% csrf_token %}
<button class="btn-primary" type="submit">Sim</button>
<a href="{{ negative_url }}" class="btn-primary">Não</a>
<button class="confirm" type="submit">Sim</button>
<a href="{{ negative_url }}" class="negate">Não</a>
</form>
</div>
{% endblock content %}
@@ -3,30 +3,36 @@
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
<link rel="shortcut icon" href="{% static 'img/favicon/favicon.ico' %}" type="image/x-icon">
<link rel="shortcut icon" href="{% static 'core/img/favicon/favicon.ico' %}" type="image/x-icon">
<link rel="stylesheet" href="{% static 'css/base/reset.css' %}">
<link rel="stylesheet" href="{% static 'css/base/variables.css' %}">
<link rel="stylesheet" href="{% static 'css/layout/global.css' %}">
<link rel="stylesheet" href="{% static 'css/layout/buttons.css' %}">
<link rel="stylesheet" href="{% static 'core/css/reset.css' %}">
<link rel="stylesheet" href="{% static 'core/css/variables.css' %}">
<link rel="stylesheet" href="{% static 'core/css/global.css' %}">
<link rel="stylesheet" href="{% static 'core/css/components/buttons.css' %}">
<link rel="stylesheet" href="{% static 'core/css/components/confirmation_popup.css' %}">
{% block extra_css %}{% endblock %}
<!-- Importing Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css" integrity="sha512-2SwdPD6INVrV/lHTZbO2nodKhrnDdJK9/kg2XD1r9uGqPo1cUbujc+IYdlYdEErWNu69gVcYgdxlmVmzTWnetw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
{% block extra_css %}{% endblock %}
</head>
<body>
{% include 'includes/_sidebar.html' %}
{% include 'includes/_navbar.html' %}
{% include 'components/sidebar.html' %}
{% include 'components/navbar.html' %}
<div class="main-content">
{% block content %}{% endblock %}
</div>
</body>
<!-- Importing custom JS -->
<script src="{% static 'js/main.js' %}"></script>
<script src="{% static 'core/js/main.js' %}"></script>
<!-- Importing HTMX -->
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.8/dist/htmx.min.js" integrity="sha384-/TgkGk7p307TH7EXJDuUlgG3Ce1UVolAOFopFekQkkXihi5u/6OCvVKyz1W+idaz" crossorigin="anonymous"></script>
{% block extra_js %}{% endblock extra_js %}
</html>
@@ -3,14 +3,16 @@
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Seleção de Fazenda</title>
<link rel="shortcut icon" href="{% static 'img/favicon/favicon.ico' %}" type="image/x-icon">
<link rel="shortcut icon" href="{% static 'core/img/favicon/favicon.ico' %}" type="image/x-icon">
<link rel="stylesheet" href="{% static 'css/base/reset.css' %}">
<link rel="stylesheet" href="{% static 'css/base/variables.css' %}">
<link rel="stylesheet" href="{% static 'css/layout/global.css' %}">
<link rel="stylesheet" href="{% static 'css/layout/buttons.css' %}">
<link rel="stylesheet" href="{% static 'core/css/reset.css' %}">
<link rel="stylesheet" href="{% static 'core/css/variables.css' %}">
<link rel="stylesheet" href="{% static 'core/css/global.css' %}">
<link rel="stylesheet" href="{% static 'core/css/components/buttons.css' %}">
<link rel="stylesheet" href="{% static 'user/css/farm_select.css' %}">
<!-- Importing Font Awesome -->
@@ -3,14 +3,16 @@
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link rel="shortcut icon" href="{% static 'img/favicon/favicon.ico' %}" type="image/x-icon">
<link rel="shortcut icon" href="{% static 'core/img/favicon/favicon.ico' %}" type="image/x-icon">
<link rel="stylesheet" href="{% static 'css/base/reset.css' %}">
<link rel="stylesheet" href="{% static 'css/base/variables.css' %}">
<link rel="stylesheet" href="{% static 'css/layout/global.css' %}">
<link rel="stylesheet" href="{% static 'css/layout/buttons.css' %}">
<link rel="stylesheet" href="{% static 'core/css/reset.css' %}">
<link rel="stylesheet" href="{% static 'core/css/variables.css' %}">
<link rel="stylesheet" href="{% static 'core/css/global.css' %}">
<link rel="stylesheet" href="{% static 'core/css/components/buttons.css' %}">
<link rel="stylesheet" href="{% static 'user/css/login.css' %}">
<!-- Importing Font Awesome -->
Whitespace-only changes.
@@ -0,0 +1,26 @@
.open-rotations-container {
display: flex;
flex-direction: row;
gap: 30px;
overflow-x: auto;
scrollbar-width: none;
padding: 10px 5px;
}
.active-rotation-card {
min-width: 300px;
box-shadow: 5px 5px 12px rgba(0, 0, 0, 0.15);
border-radius: 10px;
padding: 10px;
background-color: #343a40;
color: white;
}
@media (max-width: 760px){
.open-rotations-container {
flex-direction: column;
overflow-y: auto;
max-height: 300px;
}
}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -7,5 +7,5 @@
{% block content %}
NOVO ANIMAL <br>
{% include 'includes/_form.html' %}
{% include 'components/form.html' %}
{% endblock %}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -7,5 +7,5 @@
{% block content %}
EDITAR ANIMAL <br>
{% include 'includes/_form.html' %}
{% include 'components/form.html' %}
{% endblock %}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -7,5 +7,5 @@
{% block content %}
NOVO LOTE <br>
{% include 'includes/_form.html' %}
{% include 'components/form.html' %}
{% endblock %}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -7,5 +7,5 @@
{% block content %}
EDITAR LOTE <br>
{% include 'includes/_form.html' %}
{% include 'components/form.html' %}
{% endblock %}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -1,4 +1,4 @@
{% extends 'base.html' %}
{% extends 'layouts/base.html' %}
{% load static %}
{% block extra_css %}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -1,9 +1,10 @@
{% extends 'base.html' %}
{% extends 'layouts/base.html' %}
{% load static %}
{% load custom_tags %}
{% block extra_css %}
<link rel="stylesheet" href="{% static 'layout/entity_list.css' %}">
{{ block.super }}
<link rel="stylesheet" href="{% static 'layouts/entity_list.css' %}">
{% endblock %}
{% block content %}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -7,5 +7,5 @@
{% block content %}
New - Paddock
{% include 'includes/_form.html' %}
{% include 'components/form.html' %}
{% endblock %}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -7,5 +7,5 @@
{% block content %}
Edit - Paddock
{% include 'includes/_form.html' %}
{% include 'components/form.html' %}
{% endblock %}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -7,5 +7,5 @@
{% block content %}
New - Paddock Group
{% include 'includes/_form.html' %}
{% include 'components/form.html' %}
{% endblock %}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -7,5 +7,5 @@
{% block content %}
Delete - Paddock Group
{% include 'includes/_form.html' %}
{% include 'components/form.html' %}
{% endblock %}
@@ -1,4 +1,4 @@
{% extends 'base_modal.html' %}
{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
@@ -7,5 +7,5 @@
{% block content %}
New - Rotation
{% include 'includes/_form.html' %}
{% include 'components/form.html' %}
{% endblock %}
@@ -1,48 +0,0 @@
{% extends 'entity_list.html' %}
{% load custom_tags %}
{% block before_table %}
<p>Movimentações em aberto</p>
<div class="open-rotations-container" style="display: flex; flex-direction: row; gap: 30px;"> <!-- TIRAR O STYLE DAQUI DEPOIS -->
{% if not open_rotations %}
<p>Nenhuma movimentação em aberto</p>
{% else %}
{% for obj in open_rotations %}
{% include "_active_rotation_card.html" %}
{% endfor %}
{% endif %}
</div>
{% endblock %}
{% block table %}
<table>
<tr>
{% for col in columns %}
<th>{{ col.label }}</th>
{% endfor %}
<th>Excluir</th>
</tr>
{% for obj in object_list %}
<tr>
{% for col in columns %}
<td>
{{ obj|get_attr:col.field }}
</td>
{% endfor %}
<!-- Delete -->
<td>
<form method="POST" action="{% url delete_url obj.id %}">
{% csrf_token %}
<button type="submit" class="btn-icon-trash">
<i class="fa-solid fa-trash"></i>
</button>
</form>
</td>
</tr>
{% endfor %}
</table>
{% endblock %}
@@ -0,0 +1,89 @@
{% extends 'layouts/entity_list.html' %}
{% load custom_tags %}
{% load static %}
{% block extra_css %}
{{ block.super }}
<link rel="stylesheet" href="{% static 'rotation/css/rotation_list.css' %}">
{% endblock extra_css %}
{% block before_table %}
<p>Movimentações em aberto</p>
<div class="open-rotations-container">
{% if not open_rotations %}
<p>Nenhuma movimentação em aberto</p>
{% else %}
{% for obj in open_rotations %}
<div class="active-rotation-card">
<div class="identification">
<p>{{ obj.batch.identifier }} em piquete {{ obj.paddock.paddock_number }}</p>
</div>
<div class="duration">
<p>Há {{ obj.duration_display_day }} dias, desde {{ obj.entry_date|date:"d/m/Y" }}</p>
</div>
<div class="animals">
<p>Animais: {{ obj.animal_count }}</p>
</div>
<div class="livestock">
<p>UGM: {{ obj.livestock_unit }}</p>
</div>
<div class="details">
<a href="{% url details_url %}">Ver mais</a>
</div>
</div>
{% include "rotation/active_rotation_card.html" %}
{% endfor %}
{% for obj in open_rotations %}
{% include "rotation/active_rotation_card.html" %}
{% endfor %}
{% for obj in open_rotations %}
{% include "rotation/active_rotation_card.html" %}
{% endfor %}
{% for obj in open_rotations %}
{% include "rotation/active_rotation_card.html" %}
{% endfor %}
{% endif %}
</div>
{% endblock %}
{% block table %}
<table>
<tr>
{% for col in columns %}
<th>{{ col.label }}</th>
{% endfor %}
<th>Excluir</th>
</tr>
{% for obj in object_list %}
<tr>
{% for col in columns %}
<td>
{{ obj|get_attr:col.field }}
</td>
{% endfor %}
<!-- Delete -->
<td>
<form method="POST" action="{% url delete_url obj.id %}">
{% csrf_token %}
<button type="submit" class="btn-icon-trash">
<i class="fa-solid fa-trash"></i>
</button>
</form>
</td>
</tr>
{% endfor %}
</table>
{% endblock %}
{% block extra_js %}
{{ block.super }}
<script src="{% static "rotation/js/rotation_list.js" %}"></script>
{% endblock extra_js %}
+2 -2
View File
@@ -35,7 +35,7 @@ def animal_update(request, animal_id):
def animal_delete(request, animal_id):
if request.method == 'GET':
context = services.get_animal_delete_context(request, animal_id)
return render(request, 'confirmation_popup.html', context)
return render(request, 'components/confirmation_popup.html', context)
if request.method == 'POST':
services.delete_animal(request, animal_id)
@@ -74,7 +74,7 @@ def batch_update(request, batch_id):
def batch_delete(request, batch_id):
if request.method == 'GET':
context = services.get_batch_delete_context(request, batch_id)
return render(request, 'confirmation_popup.html', context)
return render(request, 'components/confirmation_popup.html', context)
if request.method == 'POST':
services.delete_batch(request, batch_id)
+3 -3
View File
@@ -37,7 +37,7 @@ def farm_update(request, farm_id):
def farm_delete(request, farm_id):
if request.method == 'GET':
context = services.get_farm_delete_context(request, farm_id)
return render(request, 'confirmation_popup.html', context)
return render(request, 'components/confirmation_popup.html', context)
if request.method == 'POST':
services.delete_farm(request, farm_id)
@@ -74,7 +74,7 @@ def paddock_update(request, paddock_id):
def paddock_delete(request, paddock_id):
if request.method == 'GET':
context = services.get_paddock_delete_context(request, paddock_id)
return render(request, 'confirmation_popup.html', context)
return render(request, 'components/confirmation_popup.html', context)
if request.method == 'POST':
services.delete_paddock(request, paddock_id)
@@ -115,7 +115,7 @@ def paddock_group_update(request, paddock_group_id):
def paddock_group_delete(request, paddock_group_id):
if request.method == 'GET':
context = services.get_paddock_group_delete_context(request, paddock_group_id)
return render(request, 'confirmation_popup.html', context)
return render(request, 'components/confirmation_popup.html', context)
if request.method == 'POST':
services.delete_paddock_group(request, paddock_group_id)
+1 -1
View File
@@ -4,7 +4,7 @@ from entities.models.farm import Farm
from django.shortcuts import redirect
class BaseListView(ListView):
template_name = "entity_list.html"
template_name = "layouts/entity_list.html"
paginate_by = 10
selected_farm = ""
order_by = ["-id"]
+3 -3
View File
@@ -13,12 +13,12 @@ def user_login(request):
context = services.get_user_login_context(request)
if request.method == 'GET':
return render(request, 'login.html', context)
return render(request, 'pages/login.html', context)
if request.method == 'POST':
if not services.user_login(request):
context['fail_login'] = True
return render(request, 'login.html', context)
return render(request, 'pages/login.html', context)
return redirect('entities:user:farm_select')
@@ -36,7 +36,7 @@ def farm_select(request):
if result.get('redirect'):
return redirect(result['redirect'])
return render(request, 'farm_select.html', result['context'])
return render(request, 'pages/farm_select.html', result['context'])
def farm_set(request, farm_id=None):
+4 -4
View File
@@ -137,10 +137,10 @@ USE_TZ = True
# https://docs.djangoproject.com/en/5.2/howto/static-files/
STATIC_URL = 'static/'
STATIC_DIR = [BASE_DIR / "static"]
STATICFILES_DIRS = [
BASE_DIR / "static",
]
# STATIC_DIR = [BASE_DIR / "static"]
# STATICFILES_DIRS = [
# BASE_DIR / "static",
# ]
# Default primary key field type
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
-19
View File
@@ -1,19 +0,0 @@
// SIDEBAR TOGGLER
document.addEventListener("DOMContentLoaded", () => {
const button = document.getElementById("sidebar-toggle");
const body = document.body;
if (!button) return;
const savedState = localStorage.getItem("sidebarCollapsed");
if (savedState === "true") {
body.classList.add("sidebar-collapsed");
}
button.addEventListener("click", () => {
body.classList.toggle("sidebar-collapsed");
const isCollapsed = body.classList.contains("sidebar-collapsed");
localStorage.setItem("sidebarCollapsed", isCollapsed);
});
});