From d22f8e8e35f7dfbceb6e2840b2d9f433acb8c49e Mon Sep 17 00:00:00 2001 From: James Polley Date: Fri, 22 Sep 2017 16:37:36 +1000 Subject: [PATCH] expand proposal admin --- pinaxcon/proposals/admin.py | 50 ++++++++++++++++++---------- vendor/symposion/proposals/admin.py | 9 ++++- vendor/symposion/proposals/models.py | 1 + 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/pinaxcon/proposals/admin.py b/pinaxcon/proposals/admin.py index 8070d290..d3e2278e 100644 --- a/pinaxcon/proposals/admin.py +++ b/pinaxcon/proposals/admin.py @@ -2,29 +2,45 @@ from django.contrib import admin from pinaxcon.proposals import models from symposion.proposals import models as symposion_models - - -@admin.register(models.TalkProposal) -@admin.register(models.TutorialProposal) -@admin.register(models.MiniconfProposal) -@admin.register(models.SysAdminProposal) -@admin.register(models.KernelProposal) -@admin.register(models.GamesProposal) -@admin.register(models.OpenHardwareProposal) -@admin.register(models.ClsXLCAProposal) -@admin.register(models.FuncProgProposal) -@admin.register(models.OpenEdProposal) -@admin.register(models.OpenGLAMProposal) -@admin.register(models.FPGAProposal) -@admin.register(models.DevDevProposal) -@admin.register(models.ArtTechProposal) -@admin.register(models.BioInformaticsProposal) +from symposion.reviews.models import ProposalResult class CategoryAdmin(admin.ModelAdmin): class AdditionalSpeakerInline(admin.TabularInline): model = symposion_models.AdditionalSpeaker + class ProposalResultInline(admin.TabularInline): + model = ProposalResult + readonly_fields = ["score"] + fields = ["status"] + inlines = [ AdditionalSpeakerInline, + ProposalResultInline, ] + + +for model in [ models.TalkProposal, models.TutorialProposal, + models.MiniconfProposal, models.SysAdminProposal, + models.KernelProposal, models.GamesProposal, + models.OpenHardwareProposal, models.ClsXLCAProposal, + models.FuncProgProposal, models.OpenEdProposal, + models.OpenGLAMProposal, models.FPGAProposal, models.DevDevProposal, + models.ArtTechProposal, models.BioInformaticsProposal ]: + admin.site.register(model, CategoryAdmin, + list_display = [ + "id", + "title", + "speaker", + "speaker_email", + "kind", + "target_audience", + "status", + "cancelled", + ], + list_filter = [ + "result__status", + "cancelled", + ], + ) + diff --git a/vendor/symposion/proposals/admin.py b/vendor/symposion/proposals/admin.py index af274aaa..37261f65 100644 --- a/vendor/symposion/proposals/admin.py +++ b/vendor/symposion/proposals/admin.py @@ -28,5 +28,12 @@ from symposion.proposals.models import ProposalSection, ProposalKind # ) -admin.site.register(ProposalSection) +admin.site.register(ProposalSection, + list_display = [ + "section", + "start", + "end", + "closed", + "published" + ]) admin.site.register(ProposalKind) diff --git a/vendor/symposion/proposals/models.py b/vendor/symposion/proposals/models.py index 4a8650a0..08120eca 100644 --- a/vendor/symposion/proposals/models.py +++ b/vendor/symposion/proposals/models.py @@ -177,6 +177,7 @@ class ProposalBase(models.Model): except ObjectDoesNotExist: return _('Undecided') + def speakers(self): yield self.speaker speakers = self.additional_speakers.exclude(