aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-10-22 17:40:17 +0100
committerMatthew Lemon <y@yulqen.org>2024-10-22 17:40:17 +0100
commit8d23046d174e4d8dce0f13cc88b099d3c12b07ec (patch)
treee51c3cf677b40ea933fe6d251bb28b3b1af71365
parenta505c844c0537c7aeb59e287687561d2d0a9d6e4 (diff)
wip: started working on the add new resource form
-rw-r--r--alphabetlearning/static/css/forms.css53
-rw-r--r--alphabetlearning/static/css/project.css6
-rw-r--r--alphabetlearning/templates/base.html1
-rw-r--r--alphabetlearning/templates/resources/resource_create.html8
-rw-r--r--config/settings/base.py5
5 files changed, 66 insertions, 7 deletions
diff --git a/alphabetlearning/static/css/forms.css b/alphabetlearning/static/css/forms.css
new file mode 100644
index 0000000..0ec810d
--- /dev/null
+++ b/alphabetlearning/static/css/forms.css
@@ -0,0 +1,53 @@
+.form-container {
+ margin-top: 24px;
+ margin-bottom: 54px;
+ margin-left: 5px;
+ margin-right: 5px;
+ overflow: auto;
+ border: 1px solid lightgray;
+ border-radius: 10px;
+ padding: 10px;
+}
+
+form label {
+ font-weight: bold;
+ font-size: 1.2em;
+ display: inline-block;
+}
+
+form input[type="text"], form input[type="password"], form input[type="email"] {
+ padding: 0.75em 18px;
+ width: 100%;
+ margin-left: 2px;
+}
+
+form input[type=text], form input[type="password"], form input[type="email"], textarea {
+ color: #6A6C6F;
+ background: #FFFFFF;
+ border: 1px solid #E4E5E7;
+ border-radius: 3px;
+ margin-left: 2px;
+}
+
+
+
+.helptext {
+ font-size: 0.9em;
+}
+
+form div {
+ margin-bottom: 18px;
+ margin-top: 10px;
+}
+
+form div:last-child {
+ border-top: 1px dashed #E4E5E7;
+}
+
+textarea {
+ padding: 18px;
+ width: 100%;
+ height: 266px;
+}
+
+
diff --git a/alphabetlearning/static/css/project.css b/alphabetlearning/static/css/project.css
index 6be378a..79ad930 100644
--- a/alphabetlearning/static/css/project.css
+++ b/alphabetlearning/static/css/project.css
@@ -43,6 +43,12 @@ h1, h2, h3 {
color: #3d3d3d;
}
+h1 {
+ font-size: 2em;
+ font-weight: bold;
+ margin-bottom: 20px;
+}
+
.bulk-text p {
padding: 10px;
margin-bottom: 30px;
diff --git a/alphabetlearning/templates/base.html b/alphabetlearning/templates/base.html
index c338e06..2979f33 100644
--- a/alphabetlearning/templates/base.html
+++ b/alphabetlearning/templates/base.html
@@ -23,6 +23,7 @@
{% endblock extra_css %}
{% block css %}
<link rel="stylesheet" href="{% static 'css/project.css' %}"/>
+ <link rel="stylesheet" href="{% static 'css/forms.css' %}"/>
{% endblock css %}
{% block javascript %}
<script defer src="{% static 'js/project.js' %}"></script>
diff --git a/alphabetlearning/templates/resources/resource_create.html b/alphabetlearning/templates/resources/resource_create.html
index 59f9ec3..1b320a9 100644
--- a/alphabetlearning/templates/resources/resource_create.html
+++ b/alphabetlearning/templates/resources/resource_create.html
@@ -8,14 +8,14 @@
{# {% endblock %}#}
{% block content %}
<div>
- <div>
- <h2>Upload a new resource</h2>
- <p>{% lorem %}</p>
+ <div class="form-container">
+ <h1>Upload a new resource</h1>
+
<form action="{% url 'resources:create_resource' %}"
method="post"
enctype="multipart/form-data">
{% csrf_token %}
- {% crispy form form.helper %}
+ {{ form }}
</form>
</div>
</div>
diff --git a/config/settings/base.py b/config/settings/base.py
index 81e0f82..e670482 100644
--- a/config/settings/base.py
+++ b/config/settings/base.py
@@ -71,7 +71,6 @@ DJANGO_APPS = [
]
THIRD_PARTY_APPS = [
"crispy_forms",
- "crispy_bootstrap5",
"allauth",
"allauth.account",
"allauth.mfa",
@@ -201,8 +200,8 @@ TEMPLATES = [
FORM_RENDERER = "django.forms.renderers.TemplatesSetting"
# http://django-crispy-forms.readthedocs.io/en/latest/install.html#template-packs
-CRISPY_TEMPLATE_PACK = "bootstrap5"
-CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
+#CRISPY_TEMPLATE_PACK = "bootstrap5"
+#CRISPY_ALLOWED_TEMPLATE_PACKS = "bootstrap5"
# FIXTURES
# ------------------------------------------------------------------------------