From babb6e499dd57f23f186dd1669ce8be4a093b2e5 Mon Sep 17 00:00:00 2001
From: Dan <47875749+leethobbit@users.noreply.github.com>
Date: Thu, 19 Dec 2024 11:13:20 -0500
Subject: [PATCH] Improve styling and form layout
---
dragonroost/animals/forms.py | 43 +++++++++++++++++++++---------
dragonroost/static/css/project.css | 15 ++++++++++-
dragonroost/templates/base.html | 2 +-
3 files changed, 46 insertions(+), 14 deletions(-)
diff --git a/dragonroost/animals/forms.py b/dragonroost/animals/forms.py
index 3d20ea6..d8be601 100644
--- a/dragonroost/animals/forms.py
+++ b/dragonroost/animals/forms.py
@@ -1,5 +1,6 @@
from crispy_bootstrap5.bootstrap5 import FloatingField
from crispy_forms.helper import FormHelper
+from crispy_forms.layout import Div
from crispy_forms.layout import Layout
from crispy_forms.layout import Row
from django import forms
@@ -26,26 +27,44 @@ def __init__(self, *args, **kwargs):
# Layout
self.helper.layout = Layout(
Row(
- FloatingField("name", wrapper_class="form-group col-md-6 mb-0"),
- FloatingField("donation_fee", wrapper_class="form-group col-md-6 mb-0"),
+ Div(
+ FloatingField("name"),
+ css_class="col-md-6",
+ ),
+ Div(
+ FloatingField("donation_fee"),
+ css_class="col-md-6",
+ ),
),
"animal_photo",
FloatingField("description"),
Row(
- FloatingField("intake_type", wrapper_class="form-group col-md-4 mb-0"),
- FloatingField(
- "intake_condition",
- wrapper_class="form-group col-md-4 mb-0",
+ Div(
+ FloatingField("intake_type"),
+ css_class="col-md-4",
+ ),
+ Div(
+ FloatingField("intake_condition"),
+ css_class="col-md-4",
),
- FloatingField(
- "starting_weight",
- wrapper_class="form-group col-md-4 mb-0",
+ Div(
+ FloatingField("starting_weight"),
+ css_class="col-md-4",
),
),
Row(
- FloatingField("sex", wrapper_class="form-group col-md-4 mb-0"),
- FloatingField("age", wrapper_class="form-group col-md-4 mb-0"),
- FloatingField("color", wrapper_class="form-group col-md-4 mb-0"),
+ Div(
+ FloatingField("sex"),
+ css_class="col-md-4",
+ ),
+ Div(
+ FloatingField("age"),
+ css_class="col-md-4",
+ ),
+ Div(
+ FloatingField("color"),
+ css_class="col-md-4",
+ ),
),
FloatingField("species"),
FloatingField("location"),
diff --git a/dragonroost/static/css/project.css b/dragonroost/static/css/project.css
index f1d543d..86df4fa 100644
--- a/dragonroost/static/css/project.css
+++ b/dragonroost/static/css/project.css
@@ -1,5 +1,4 @@
/* These styles are generated from project.scss. */
-
.alert-debug {
color: black;
background-color: white;
@@ -11,3 +10,17 @@
background-color: #f2dede;
border-color: #eed3d7;
}
+
+.modal-content {
+ position: relative;
+ display: flex;
+ flex-direction: column;
+ width: 100%;
+ color: var(--bs-modal-color);
+ pointer-events: auto;
+ background-color: rgba(248, 249, 250, 1);
+ background-clip: padding-box;
+ border: var(--bs-modal-border-width) solid var(--bs-modal-border-color);
+ border-radius: var(--bs-modal-border-radius);
+ outline: 0;
+}
diff --git a/dragonroost/templates/base.html b/dragonroost/templates/base.html
index f816214..376c830 100644
--- a/dragonroost/templates/base.html
+++ b/dragonroost/templates/base.html
@@ -25,7 +25,7 @@
crossorigin="anonymous" />
- {% comment %} {% endcomment %}
+
{% endblock css %}