diff --git a/multigranja/static/css/layout/buttons.css b/multigranja/apps/core/static/core/css/components/buttons.css
similarity index 92%
rename from multigranja/static/css/layout/buttons.css
rename to multigranja/apps/core/static/core/css/components/buttons.css
index 5c6aab4..eabce2b 100644
--- a/multigranja/static/css/layout/buttons.css
+++ b/multigranja/apps/core/static/core/css/components/buttons.css
@@ -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);
diff --git a/multigranja/apps/core/static/core/css/components/confirmation_popup.css b/multigranja/apps/core/static/core/css/components/confirmation_popup.css
new file mode 100644
index 0000000..6ee7400
--- /dev/null
+++ b/multigranja/apps/core/static/core/css/components/confirmation_popup.css
@@ -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;
+ }
+}
\ No newline at end of file
diff --git a/multigranja/static/css/layout/global.css b/multigranja/apps/core/static/core/css/global.css
similarity index 85%
rename from multigranja/static/css/layout/global.css
rename to multigranja/apps/core/static/core/css/global.css
index bd76d43..b373880 100644
--- a/multigranja/static/css/layout/global.css
+++ b/multigranja/apps/core/static/core/css/global.css
@@ -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 {
@@ -166,4 +166,36 @@ body.sidebar-collapsed .main-content {
padding: var(--space-lg);
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;
+ }
}
\ No newline at end of file
diff --git a/multigranja/static/css/base/reset.css b/multigranja/apps/core/static/core/css/reset.css
similarity index 100%
rename from multigranja/static/css/base/reset.css
rename to multigranja/apps/core/static/core/css/reset.css
diff --git a/multigranja/static/css/base/variables.css b/multigranja/apps/core/static/core/css/variables.css
similarity index 100%
rename from multigranja/static/css/base/variables.css
rename to multigranja/apps/core/static/core/css/variables.css
diff --git a/multigranja/static/img/favicon/favicon.ico b/multigranja/apps/core/static/core/img/favicon/favicon.ico
similarity index 100%
rename from multigranja/static/img/favicon/favicon.ico
rename to multigranja/apps/core/static/core/img/favicon/favicon.ico
diff --git a/multigranja/apps/core/static/core/js/main.js b/multigranja/apps/core/static/core/js/main.js
new file mode 100644
index 0000000..ad7c8c0
--- /dev/null
+++ b/multigranja/apps/core/static/core/js/main.js
@@ -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");
+ }
+ });
+ });
+});
\ No newline at end of file
diff --git a/multigranja/apps/core/templates/confirmation_popup.html b/multigranja/apps/core/templates/components/confirmation_popup.html
similarity index 68%
rename from multigranja/apps/core/templates/confirmation_popup.html
rename to multigranja/apps/core/templates/components/confirmation_popup.html
index 11464b6..56a62a1 100644
--- a/multigranja/apps/core/templates/confirmation_popup.html
+++ b/multigranja/apps/core/templates/components/confirmation_popup.html
@@ -1,4 +1,4 @@
-{% extends "base_modal.html" %}
+{% extends "layouts/base_modal.html" %}
{% load static %}
{% block content %}
@@ -9,8 +9,8 @@
{% endif %}
{% endblock content %}
\ No newline at end of file
diff --git a/multigranja/apps/core/templates/includes/_form.html b/multigranja/apps/core/templates/components/form.html
similarity index 100%
rename from multigranja/apps/core/templates/includes/_form.html
rename to multigranja/apps/core/templates/components/form.html
diff --git a/multigranja/apps/core/templates/includes/_navbar.html b/multigranja/apps/core/templates/components/navbar.html
similarity index 100%
rename from multigranja/apps/core/templates/includes/_navbar.html
rename to multigranja/apps/core/templates/components/navbar.html
diff --git a/multigranja/apps/core/templates/includes/_sidebar.html b/multigranja/apps/core/templates/components/sidebar.html
similarity index 100%
rename from multigranja/apps/core/templates/includes/_sidebar.html
rename to multigranja/apps/core/templates/components/sidebar.html
diff --git a/multigranja/apps/core/templates/base.html b/multigranja/apps/core/templates/layouts/base.html
similarity index 53%
rename from multigranja/apps/core/templates/base.html
rename to multigranja/apps/core/templates/layouts/base.html
index a6d146c..21ac856 100644
--- a/multigranja/apps/core/templates/base.html
+++ b/multigranja/apps/core/templates/layouts/base.html
@@ -3,30 +3,36 @@
+
+
{{ title }}
-
+
-
-
-
-
+
+
+
+
+
+
+
+ {% block extra_css %}{% endblock %}
- {% block extra_css %}{% endblock %}
- {% include 'includes/_sidebar.html' %}
- {% include 'includes/_navbar.html' %}
+ {% include 'components/sidebar.html' %}
+ {% include 'components/navbar.html' %}
{% block content %}{% endblock %}
-
+
+ {% block extra_js %}{% endblock extra_js %}
\ No newline at end of file
diff --git a/multigranja/apps/core/templates/base_modal.html b/multigranja/apps/core/templates/layouts/base_modal.html
similarity index 100%
rename from multigranja/apps/core/templates/base_modal.html
rename to multigranja/apps/core/templates/layouts/base_modal.html
diff --git a/multigranja/apps/core/templates/404.html b/multigranja/apps/core/templates/pages/404.html
similarity index 100%
rename from multigranja/apps/core/templates/404.html
rename to multigranja/apps/core/templates/pages/404.html
diff --git a/multigranja/apps/core/templates/farm_select.html b/multigranja/apps/core/templates/pages/farm_select.html
similarity index 82%
rename from multigranja/apps/core/templates/farm_select.html
rename to multigranja/apps/core/templates/pages/farm_select.html
index f6efea4..ea68afd 100644
--- a/multigranja/apps/core/templates/farm_select.html
+++ b/multigranja/apps/core/templates/pages/farm_select.html
@@ -3,14 +3,16 @@
+
+
Seleção de Fazenda
-
+
-
-
-
-
+
+
+
+
diff --git a/multigranja/apps/core/templates/login.html b/multigranja/apps/core/templates/pages/login.html
similarity index 74%
rename from multigranja/apps/core/templates/login.html
rename to multigranja/apps/core/templates/pages/login.html
index aaa8d38..00e8bb1 100644
--- a/multigranja/apps/core/templates/login.html
+++ b/multigranja/apps/core/templates/pages/login.html
@@ -3,14 +3,16 @@
- Login
+
-
+ Login
-
-
-
-
+
+
+
+
+
+
diff --git a/multigranja/apps/entities/static/layout/entity_list.css b/multigranja/apps/entities/static/layouts/entity_list.css
similarity index 100%
rename from multigranja/apps/entities/static/layout/entity_list.css
rename to multigranja/apps/entities/static/layouts/entity_list.css
diff --git a/multigranja/apps/entities/static/rotation/css/home.css b/multigranja/apps/entities/static/rotation/css/home.css
deleted file mode 100644
index e69de29..0000000
diff --git a/multigranja/apps/entities/static/rotation/css/rotation_list.css b/multigranja/apps/entities/static/rotation/css/rotation_list.css
new file mode 100644
index 0000000..8cc83df
--- /dev/null
+++ b/multigranja/apps/entities/static/rotation/css/rotation_list.css
@@ -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;
+ }
+
+}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/animal/animal_create.html b/multigranja/apps/entities/templates/animal/animal_create.html
index 7071e78..d37e7d7 100644
--- a/multigranja/apps/entities/templates/animal/animal_create.html
+++ b/multigranja/apps/entities/templates/animal/animal_create.html
@@ -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
- {% include 'includes/_form.html' %}
+ {% include 'components/form.html' %}
{% endblock %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/animal/animal_update.html b/multigranja/apps/entities/templates/animal/animal_update.html
index 29e1963..f75f905 100644
--- a/multigranja/apps/entities/templates/animal/animal_update.html
+++ b/multigranja/apps/entities/templates/animal/animal_update.html
@@ -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
- {% include 'includes/_form.html' %}
+ {% include 'components/form.html' %}
{% endblock %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/batch/batch_create.html b/multigranja/apps/entities/templates/batch/batch_create.html
index 952fb8f..586679e 100644
--- a/multigranja/apps/entities/templates/batch/batch_create.html
+++ b/multigranja/apps/entities/templates/batch/batch_create.html
@@ -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
- {% include 'includes/_form.html' %}
+ {% include 'components/form.html' %}
{% endblock %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/batch/batch_update.html b/multigranja/apps/entities/templates/batch/batch_update.html
index b1c9c88..02832ff 100644
--- a/multigranja/apps/entities/templates/batch/batch_update.html
+++ b/multigranja/apps/entities/templates/batch/batch_update.html
@@ -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
- {% include 'includes/_form.html' %}
+ {% include 'components/form.html' %}
{% endblock %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/farm/farm_create.html b/multigranja/apps/entities/templates/farm/farm_create.html
index 697f85b..7ebb7c7 100644
--- a/multigranja/apps/entities/templates/farm/farm_create.html
+++ b/multigranja/apps/entities/templates/farm/farm_create.html
@@ -1,4 +1,4 @@
-{% extends 'base_modal.html' %}
+{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
diff --git a/multigranja/apps/entities/templates/farm/farm_home.html b/multigranja/apps/entities/templates/farm/farm_home.html
index 6ad0e32..cbde976 100644
--- a/multigranja/apps/entities/templates/farm/farm_home.html
+++ b/multigranja/apps/entities/templates/farm/farm_home.html
@@ -1,4 +1,4 @@
-{% extends 'base.html' %}
+{% extends 'layouts/base.html' %}
{% load static %}
{% block extra_css %}
diff --git a/multigranja/apps/entities/templates/farm/farm_update.html b/multigranja/apps/entities/templates/farm/farm_update.html
index 0d24c10..a8cebe2 100644
--- a/multigranja/apps/entities/templates/farm/farm_update.html
+++ b/multigranja/apps/entities/templates/farm/farm_update.html
@@ -1,4 +1,4 @@
-{% extends 'base_modal.html' %}
+{% extends 'layouts/base_modal.html' %}
{% load static %}
{% block extra_css %}
diff --git a/multigranja/apps/entities/templates/entity_list.html b/multigranja/apps/entities/templates/layouts/entity_list.html
similarity index 96%
rename from multigranja/apps/entities/templates/entity_list.html
rename to multigranja/apps/entities/templates/layouts/entity_list.html
index e7c4549..b9c4a03 100644
--- a/multigranja/apps/entities/templates/entity_list.html
+++ b/multigranja/apps/entities/templates/layouts/entity_list.html
@@ -1,9 +1,10 @@
-{% extends 'base.html' %}
+{% extends 'layouts/base.html' %}
{% load static %}
{% load custom_tags %}
{% block extra_css %}
-
+ {{ block.super }}
+
{% endblock %}
{% block content %}
diff --git a/multigranja/apps/entities/templates/paddock/paddock_create.html b/multigranja/apps/entities/templates/paddock/paddock_create.html
index 5c01be8..e9616fd 100644
--- a/multigranja/apps/entities/templates/paddock/paddock_create.html
+++ b/multigranja/apps/entities/templates/paddock/paddock_create.html
@@ -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 %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/paddock/paddock_update.html b/multigranja/apps/entities/templates/paddock/paddock_update.html
index c03627f..53577c8 100644
--- a/multigranja/apps/entities/templates/paddock/paddock_update.html
+++ b/multigranja/apps/entities/templates/paddock/paddock_update.html
@@ -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 %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/paddock_group/paddock_group_create.html b/multigranja/apps/entities/templates/paddock_group/paddock_group_create.html
index 374fefa..0b98420 100644
--- a/multigranja/apps/entities/templates/paddock_group/paddock_group_create.html
+++ b/multigranja/apps/entities/templates/paddock_group/paddock_group_create.html
@@ -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 %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/paddock_group/paddock_group_update.html b/multigranja/apps/entities/templates/paddock_group/paddock_group_update.html
index e9bee4a..7b56b58 100644
--- a/multigranja/apps/entities/templates/paddock_group/paddock_group_update.html
+++ b/multigranja/apps/entities/templates/paddock_group/paddock_group_update.html
@@ -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 %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/_active_rotation_card.html b/multigranja/apps/entities/templates/rotation/active_rotation_card.html
similarity index 100%
rename from multigranja/apps/entities/templates/_active_rotation_card.html
rename to multigranja/apps/entities/templates/rotation/active_rotation_card.html
diff --git a/multigranja/apps/entities/templates/rotation/rotation_create.html b/multigranja/apps/entities/templates/rotation/rotation_create.html
index 859b5f3..91f06ea 100644
--- a/multigranja/apps/entities/templates/rotation/rotation_create.html
+++ b/multigranja/apps/entities/templates/rotation/rotation_create.html
@@ -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 %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/rotation/rotation_home.html b/multigranja/apps/entities/templates/rotation/rotation_home.html
deleted file mode 100644
index 0f628be..0000000
--- a/multigranja/apps/entities/templates/rotation/rotation_home.html
+++ /dev/null
@@ -1,48 +0,0 @@
-{% extends 'entity_list.html' %}
-{% load custom_tags %}
-
-{% block before_table %}
- Movimentações em aberto
-
- {% if not open_rotations %}
-
Nenhuma movimentação em aberto
- {% else %}
-
- {% for obj in open_rotations %}
- {% include "_active_rotation_card.html" %}
- {% endfor %}
-
-{% endif %}
-
-{% endblock %}
-
-{% block table %}
-
-
- {% for col in columns %}
- | {{ col.label }} |
- {% endfor %}
- Excluir |
-
-
- {% for obj in object_list %}
-
- {% for col in columns %}
- |
- {{ obj|get_attr:col.field }}
- |
- {% endfor %}
-
-
-
-
- |
-
- {% endfor %}
-
- {% endblock %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/templates/rotation/rotation_list.html b/multigranja/apps/entities/templates/rotation/rotation_list.html
new file mode 100644
index 0000000..ae77a8b
--- /dev/null
+++ b/multigranja/apps/entities/templates/rotation/rotation_list.html
@@ -0,0 +1,89 @@
+{% extends 'layouts/entity_list.html' %}
+{% load custom_tags %}
+{% load static %}
+
+{% block extra_css %}
+ {{ block.super }}
+
+{% endblock extra_css %}
+
+{% block before_table %}
+ Movimentações em aberto
+
+ {% if not open_rotations %}
+
Nenhuma movimentação em aberto
+ {% else %}
+
+ {% for obj in open_rotations %}
+
+
+
{{ obj.batch.identifier }} em piquete {{ obj.paddock.paddock_number }}
+
+
+
+
Há {{ obj.duration_display_day }} dias, desde {{ obj.entry_date|date:"d/m/Y" }}
+
+
+
+
Animais: {{ obj.animal_count }}
+
+
+
+
UGM: {{ obj.livestock_unit }}
+
+
+
+
+ {% 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 %}
+
+{% endblock %}
+
+{% block table %}
+
+
+ {% for col in columns %}
+ | {{ col.label }} |
+ {% endfor %}
+ Excluir |
+
+
+ {% for obj in object_list %}
+
+ {% for col in columns %}
+ |
+ {{ obj|get_attr:col.field }}
+ |
+ {% endfor %}
+
+
+
+
+ |
+
+ {% endfor %}
+
+ {% endblock %}
+
+{% block extra_js %}
+ {{ block.super }}
+
+{% endblock extra_js %}
\ No newline at end of file
diff --git a/multigranja/apps/entities/views/animal.py b/multigranja/apps/entities/views/animal.py
index 2dc4555..e6624c8 100644
--- a/multigranja/apps/entities/views/animal.py
+++ b/multigranja/apps/entities/views/animal.py
@@ -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)
diff --git a/multigranja/apps/entities/views/farm.py b/multigranja/apps/entities/views/farm.py
index 646f189..37abfb3 100644
--- a/multigranja/apps/entities/views/farm.py
+++ b/multigranja/apps/entities/views/farm.py
@@ -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)
diff --git a/multigranja/apps/entities/views/list/base.py b/multigranja/apps/entities/views/list/base.py
index 0cba017..c4ceffb 100644
--- a/multigranja/apps/entities/views/list/base.py
+++ b/multigranja/apps/entities/views/list/base.py
@@ -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"]
diff --git a/multigranja/apps/entities/views/user.py b/multigranja/apps/entities/views/user.py
index 9fecc66..bfbd7a7 100644
--- a/multigranja/apps/entities/views/user.py
+++ b/multigranja/apps/entities/views/user.py
@@ -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):
diff --git a/multigranja/multigranja/settings.py b/multigranja/multigranja/settings.py
index 98bd4d7..deca1de 100644
--- a/multigranja/multigranja/settings.py
+++ b/multigranja/multigranja/settings.py
@@ -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
diff --git a/multigranja/static/js/main.js b/multigranja/static/js/main.js
deleted file mode 100644
index a3313c7..0000000
--- a/multigranja/static/js/main.js
+++ /dev/null
@@ -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);
- });
-});
\ No newline at end of file