From 504cf775744a1611551c27f79981739c1aece0bb Mon Sep 17 00:00:00 2001
From: Christopher Neugebauer <_@chrisjrn.com>
Date: Thu, 4 Aug 2016 09:59:50 +1000
Subject: [PATCH] Allows us to manage additional speakers from the admin (#58)
* Allows us to manage additional speakers from the admin
* Show speaker e-mail addresses. Fixes #57
* Denotes fields as required.
---
pinaxcon/proposals/admin.py | 16 +++++++++++++---
pinaxcon/templates/_form_snippet.html | 2 ++
pinaxcon/templates/forms/widget_basic.html | 7 ++++++-
.../templates/forms/widget_boolean_multiple.html | 7 ++++++-
.../templates/forms/widget_boolean_single.html | 7 ++++++-
.../symposion/proposals/_proposal_fields.html | 2 +-
6 files changed, 34 insertions(+), 7 deletions(-)
diff --git a/pinaxcon/proposals/admin.py b/pinaxcon/proposals/admin.py
index a65159f7..b5418e64 100644
--- a/pinaxcon/proposals/admin.py
+++ b/pinaxcon/proposals/admin.py
@@ -1,7 +1,17 @@
from django.contrib import admin
import models
+from symposion.proposals import models as symposion_models
-admin.site.register(models.TalkProposal)
-admin.site.register(models.TutorialProposal)
-admin.site.register(models.MiniconfProposal)
+
+@admin.register(models.TalkProposal)
+@admin.register(models.TutorialProposal)
+@admin.register(models.MiniconfProposal)
+class CategoryAdmin(admin.ModelAdmin):
+
+ class AdditionalSpeakerInline(admin.TabularInline):
+ model = symposion_models.AdditionalSpeaker
+
+ inlines = [
+ AdditionalSpeakerInline,
+ ]
diff --git a/pinaxcon/templates/_form_snippet.html b/pinaxcon/templates/_form_snippet.html
index 0c561983..f9c7e144 100644
--- a/pinaxcon/templates/_form_snippet.html
+++ b/pinaxcon/templates/_form_snippet.html
@@ -3,6 +3,8 @@
{% endif %}
+
Fields marked with (*) are required.
+ {% for field in form %} {% if not field.is_hidden %}{{ proposal.speaker }}
+{{ proposal.speaker }} <{{ proposal.speaker.email }}>
{{ proposal.kind.name|capfirst }}