From 7917b7d8dc101cdbcb1645019db60db6d4de7d01 Mon Sep 17 00:00:00 2001
From: Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com>
Date: Fri, 8 Mar 2013 23:41:58 +0100
Subject: added admin images.


diff --git a/program/admin.py b/program/admin.py
index 52ca6b0..bdd3acc 100644
--- a/program/admin.py
+++ b/program/admin.py
@@ -12,15 +12,15 @@ class BroadcastFormatAdmin(admin.ModelAdmin):
 
 class MusicFocusAdmin(admin.ModelAdmin):
     form = MusicFocusForm
-    list_display = ('focus', 'abbrev', 'admin_button')
+    list_display = ('focus', 'abbrev', 'admin_buttons')
     prepopulated_fields = {'slug': ('focus',)}
 
 class ShowInformationAdmin(admin.ModelAdmin):
-    list_display = ('information', 'abbrev', 'admin_button')
+    list_display = ('information', 'abbrev', 'admin_buttons')
     prepopulated_fields = {'slug': ('information',)}
 
 class ShowTopicAdmin(admin.ModelAdmin):
-    list_display = ('topic', 'abbrev', 'admin_button')
+    list_display = ('topic', 'abbrev', 'admin_buttons')
     prepopulated_fields = {'slug': ('topic',)}
 
 class NoteAdmin(admin.ModelAdmin):
diff --git a/program/models.py b/program/models.py
index 9e6917c..1f7a75e 100644
--- a/program/models.py
+++ b/program/models.py
@@ -41,13 +41,26 @@ class ShowInformation(models.Model):
         verbose_name = _("Show information")
         verbose_name_plural = _("Show information")
 
-    def admin_button(self):
+    def admin_buttons(self):
+        buttons = []
         if self.button:
-            return u'<img src="%s" />' % self.button.url
+            buttons.append(u'<img src="%s" />' % self.button.url)
         else:
-            return u'(no button)'
-    admin_button.short_description = _("Button")
-    admin_button.allow_tags = True
+            buttons.append(u'x')
+
+        if self.button_hover:
+            buttons.append(u'<img src="%s" />' % self.button_hover.url)
+        else:
+            buttons.append(u'x')
+
+        if self.big_button:
+            buttons.append(u'<img src="%s" />' % self.button.url)
+        else:
+            buttons.append(u'x')
+
+        return ' '.join(buttons)
+    admin_buttons.short_description = _("Button")
+    admin_buttons.allow_tags = True
 
     def button_url(self):
         if self.button:
@@ -83,13 +96,26 @@ class ShowTopic(models.Model):
         verbose_name = _("Show topic")
         verbose_name_plural = _("Show topics")
 
-    def admin_button(self):
+    def admin_buttons(self):
+        buttons = []
         if self.button:
-            return u'<img src="%s" />' % self.button.url
+            buttons.append(u'<img src="%s" />' % self.button.url)
         else:
-            return u'(no button)'
-    admin_button.short_description = _("Button")
-    admin_button.allow_tags = True
+            buttons.append(u'x')
+
+        if self.button_hover:
+            buttons.append(u'<img src="%s" />' % self.button_hover.url)
+        else:
+            buttons.append(u'x')
+
+        if self.big_button:
+            buttons.append(u'<img src="%s" />' % self.button.url)
+        else:
+            buttons.append(u'x')
+
+        return ' '.join(buttons)
+    admin_buttons.short_description = _("Button")
+    admin_buttons.allow_tags = True
 
     def button_url(self):
         if self.button:
@@ -125,13 +151,26 @@ class MusicFocus(models.Model):
         verbose_name = _("Music focus")
         verbose_name_plural = _("Music focus")
 
-    def admin_button(self):
+    def admin_buttons(self):
+        buttons = []
         if self.button:
-            return u'<img src="%s" />' % self.button.url
+            buttons.append(u'<img src="%s" />' % self.button.url)
+        else:
+            buttons.append(u'x')
+
+        if self.button_hover:
+            buttons.append(u'<img src="%s" />' % self.button_hover.url)
         else:
-            return u'(no button)'
-    admin_button.short_description = _("Button")
-    admin_button.allow_tags = True
+            buttons.append(u'x')
+
+        if self.big_button:
+            buttons.append(u'<img src="%s" />' % self.button.url)
+        else:
+            buttons.append(u'x')
+
+        return ' '.join(buttons)
+    admin_buttons.short_description = _("Button")
+    admin_buttons.allow_tags = True
 
     def button_url(self):
         if self.button:
-- 
cgit v0.10.2