diff options
author | Matthew Lemon <y@yulqen.org> | 2024-10-22 20:23:09 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-10-22 20:23:09 +0100 |
commit | f07aeadf676053168f4a05b59e9deedd6424fa8c (patch) | |
tree | d32fe0b384fc9929d2c6583c1ceed61c05ca3d1c | |
parent | 8d23046d174e4d8dce0f13cc88b099d3c12b07ec (diff) |
Resource upload form has all the bits it needs
-rw-r--r-- | alphabetlearning/resources/forms.py | 20 | ||||
-rw-r--r-- | alphabetlearning/static/css/forms.css | 63 | ||||
-rw-r--r-- | alphabetlearning/templates/resources/resource_create.html | 1 |
3 files changed, 63 insertions, 21 deletions
diff --git a/alphabetlearning/resources/forms.py b/alphabetlearning/resources/forms.py index 35632bd..b0f7d76 100644 --- a/alphabetlearning/resources/forms.py +++ b/alphabetlearning/resources/forms.py @@ -50,22 +50,10 @@ class ResourceCreateForm(forms.Form): description = forms.CharField( max_length=5000, widget=forms.Textarea, - help_text=" You can (and should) use <strong>Markdown</strong> here. " - "This is your opportunity to clearly explain what your resource " - "is all " - "about! It’s worth remembering that you are using the space to " - "communicate to two " - "different audiences. Firstly, think about what fellow teachers " - "would like " - "to know, such as exactly what the resource contains and how it " - "could be used in the classroom. Secondly, the words you include " - "on this page are also talking to internal and external search " - "engines." - " External search engines, like Google, show the first 155 characters " - "of the resource description, so make sure you take advantage " - "of these " - "characters by using lots of relevant keywords as part of an " - "enticing pitch.", + help_text=(" Use <strong>markdown</strong> here. " + "This is the main (long) description so go for it. " + "5000 characters at your disposal." + ), ) card_description = forms.CharField( max_length=1000, diff --git a/alphabetlearning/static/css/forms.css b/alphabetlearning/static/css/forms.css index 0ec810d..7e6be8a 100644 --- a/alphabetlearning/static/css/forms.css +++ b/alphabetlearning/static/css/forms.css @@ -6,17 +6,30 @@ overflow: auto; border: 1px solid lightgray; border-radius: 10px; - padding: 10px; + padding: 20px; + background: lightgray; } form label { font-weight: bold; font-size: 1.2em; display: inline-block; + margin-bottom: 3px; +} + +form label.required::after { + content: ' *'; + color: red; +} + +form label[for=id_pdf_files]::after, form label[for=id_thumbnail_files]::after { + content: ' *'; + color: red; } form input[type="text"], form input[type="password"], form input[type="email"] { padding: 0.75em 18px; + border-radius: 5px; width: 100%; margin-left: 2px; } @@ -24,11 +37,51 @@ form input[type="text"], form input[type="password"], form input[type="email"] { form input[type=text], form input[type="password"], form input[type="email"], textarea { color: #6A6C6F; background: #FFFFFF; - border: 1px solid #E4E5E7; - border-radius: 3px; + /*border: 2px solid #E4E5E7;*/ + border: 1px solid darkgray; + border-radius: 5px; margin-left: 2px; } +form select { + display: block; + border: 1px solid darkgray; + border-radius: 5px; + background: white; + width: 100%; + padding: 0.75em 18px; +} + +form input[type="submit"] { + border: 0px; + background: darkmagenta; + border-radius: 5px; + padding: 10px; + color: white; + width: 200px; +} + +form input[type="submit"]:hover { + background: #30053b; + color: white; +} + +form input[type="number"] { + border: 1px solid darkgray; + border-radius: 2px; + background: white; + width: 100px; + padding: 0.75em 18px; +} + +form input[type="file"] { + border: 1px solid darkgray; + border-radius: 5px; + background: white; + width: 400px; + padding: 10px; +} + .helptext { @@ -36,8 +89,8 @@ form input[type=text], form input[type="password"], form input[type="email"], te } form div { - margin-bottom: 18px; - margin-top: 10px; + margin-bottom: 20px; + margin-top: 8px; } form div:last-child { diff --git a/alphabetlearning/templates/resources/resource_create.html b/alphabetlearning/templates/resources/resource_create.html index 1b320a9..374af93 100644 --- a/alphabetlearning/templates/resources/resource_create.html +++ b/alphabetlearning/templates/resources/resource_create.html @@ -16,6 +16,7 @@ enctype="multipart/form-data"> {% csrf_token %} {{ form }} + <input type="submit" value="Submit"> </form> </div> </div> |