From f66d12bac272fa5089967ff278fbc802a01e4464 Mon Sep 17 00:00:00 2001 From: Les Orchard Date: Sun, 25 Sep 2011 00:31:48 -0400 Subject: [PATCH] Accept image upload on Badge create --- badger_multiplayer/forms.py | 2 +- .../templates/badger/includes/badge_full.html | 7 +++++++ .../templates/badger_multiplayer/badge_create.html | 2 +- .../templates/badger_multiplayer/badge_edit.html | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/badger_multiplayer/forms.py b/badger_multiplayer/forms.py index 5aa0f4a..5162131 100644 --- a/badger_multiplayer/forms.py +++ b/badger_multiplayer/forms.py @@ -43,7 +43,7 @@ class BadgeEditForm(MyModelForm): class Meta: model = Badge - fields = ('title', 'description',) + fields = ('title', 'image', 'description',) required_css_class = "required" error_css_class = "error" diff --git a/badger_multiplayer/templates/badger/includes/badge_full.html b/badger_multiplayer/templates/badger/includes/badge_full.html index 432053a..b9f0191 100644 --- a/badger_multiplayer/templates/badger/includes/badge_full.html +++ b/badger_multiplayer/templates/badger/includes/badge_full.html @@ -1,4 +1,11 @@
+ {% if award and award.image %} +
Image:
+
+ {% elif badge.image %} +
Image:
+
+ {% endif %}
Title:
{{ badge.title }}
{% if badge.description %} diff --git a/badger_multiplayer/templates/badger_multiplayer/badge_create.html b/badger_multiplayer/templates/badger_multiplayer/badge_create.html index bb1111b..a51beb6 100644 --- a/badger_multiplayer/templates/badger_multiplayer/badge_create.html +++ b/badger_multiplayer/templates/badger_multiplayer/badge_create.html @@ -6,7 +6,7 @@

Create a badge

-
+ {{ csrf() }}
    {{ form.as_ul() }} diff --git a/badger_multiplayer/templates/badger_multiplayer/badge_edit.html b/badger_multiplayer/templates/badger_multiplayer/badge_edit.html index e9744eb..50d5ee9 100644 --- a/badger_multiplayer/templates/badger_multiplayer/badge_edit.html +++ b/badger_multiplayer/templates/badger_multiplayer/badge_edit.html @@ -6,7 +6,7 @@

    Edit badge: {{ badge.title }}

    - + {{ csrf() }}
      {{ form.as_ul() }}