diff --git a/cards/forms.py b/cards/forms.py
index 0c4d317..f00090e 100644
--- a/cards/forms.py
+++ b/cards/forms.py
@@ -10,5 +10,13 @@ class DinosaurForm(forms.ModelForm):
'speed', 'weight', 'intelligence', 'height',
]
widgets = {
- 'description': forms.Textarea(attrs={'rows': 3}),
+ 'name': forms.TextInput(attrs={'class': 'input', 'placeholder': 'T. rex'}),
+ 'era': forms.Select(attrs={'class': 'input'}),
+ 'diet': forms.Select(attrs={'class': 'input'}),
+ 'description': forms.Textarea(attrs={'class': 'textarea', 'rows': 3}),
+ 'image': forms.ClearableFileInput(attrs={'class': 'file-input'}),
+ 'speed': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
+ 'weight': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
+ 'intelligence': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
+ 'height': forms.NumberInput(attrs={'class': 'input', 'min': 0, 'max': 100}),
}
diff --git a/cards/templates/cards/_card_item.html b/cards/templates/cards/_card_item.html
index f6196f4..270086a 100644
--- a/cards/templates/cards/_card_item.html
+++ b/cards/templates/cards/_card_item.html
@@ -1,15 +1,23 @@
-
-
{{ card.name }}
-
Era: {{ card.get_era_display }} — Diet: {{ card.get_diet_display }}
-
{{ card.description|linebreaksbr }}
-
- - Speed: {{ card.speed }}
- - Weight: {{ card.weight }}
- - Intelligence: {{ card.intelligence }}
- - Height: {{ card.height }}
-
-
+
+
{{ card.description|linebreaksbr }}
+
+
+ | Speed | {{ card.speed }} |
+ | Weight | {{ card.weight }} |
+ | Intelligence | {{ card.intelligence }} |
+ | Height | {{ card.height }} |
+
+
+
+
+
+
+
+
diff --git a/cards/templates/cards/_cards_list.html b/cards/templates/cards/_cards_list.html
index bc3d59d..a6252c0 100644
--- a/cards/templates/cards/_cards_list.html
+++ b/cards/templates/cards/_cards_list.html
@@ -1,8 +1,10 @@
{% load static %}
-
+
{% for card in cards %}
- {% include 'cards/_card_item.html' with card=card %}
+
+ {% include 'cards/_card_item.html' with card=card %}
+
{% empty %}
-
No dinosaurs yet — add one!
+
No dinosaurs yet — add one!
{% endfor %}
diff --git a/cards/templates/cards/_form.html b/cards/templates/cards/_form.html
index 5331647..42bf772 100644
--- a/cards/templates/cards/_form.html
+++ b/cards/templates/cards/_form.html
@@ -7,41 +7,76 @@
{% endif %}
{% csrf_token %}
{{ form.non_field_errors }}
-
- {{ form.name.label_tag }}
- {{ form.name }}
+
+
+
+ {{ form.name }}
+
-
- {{ form.era.label_tag }}
- {{ form.era }}
+
+
+
+
+
+
+
+
+
+
+
+
-
- {{ form.diet.label_tag }}
- {{ form.diet }}
+
+
+
+
+ {{ form.description }}
+
-
- {{ form.description.label_tag }}
- {{ form.description }}
+
+
+
+
+
+
+
+
-
- {{ form.image.label_tag }}
- {{ form.image }}
+
+
+
+
+
+
{{ form.speed }}
+
+
+
+
{{ form.weight }}
+
+
+
+
{{ form.intelligence }}
+
+
+
+
{{ form.height }}
+
+
-
- {{ form.speed.label_tag }} {{ form.speed }}
-
-
- {{ form.weight.label_tag }} {{ form.weight }}
-
-
- {{ form.intelligence.label_tag }} {{ form.intelligence }}
-
-
- {{ form.height.label_tag }} {{ form.height }}
-
-
diff --git a/cards/templates/cards/base.html b/cards/templates/cards/base.html
index 4c0fc98..dc83a45 100644
--- a/cards/templates/cards/base.html
+++ b/cards/templates/cards/base.html
@@ -4,19 +4,22 @@
TopTrumps - Dinosaurs
+
-
TopTrumps — Dinosaurs
-
- {% block content %}{% endblock %}
+
+
+
TopTrumps — Dinosaurs
+
+ {% block content %}{% endblock %}
+
+