diff --git a/src/program/templates/control/index.html b/src/program/templates/control/index.html index 36afce00..2fe7bbf5 100644 --- a/src/program/templates/control/index.html +++ b/src/program/templates/control/index.html @@ -39,4 +39,9 @@ +

CSV

+ + {% endblock %} diff --git a/src/program/templates/control/proposal_overview.csv b/src/program/templates/control/proposal_overview.csv new file mode 100644 index 00000000..6360828f --- /dev/null +++ b/src/program/templates/control/proposal_overview.csv @@ -0,0 +1,3 @@ +title,submitter email,status,instances,video recording +{% for proposal in proposals %}{{ proposal.title }},{{ proposal.user.email }},{{ proposal.proposal_status }},{% for instance in proposal.event.instances.all %}When: {{ instance.when.lower|date:"l d. b H:i" }} - {{ instance.when.upper|date:"H:i" }} Where: {{ instance.location.name }}{% endfor %},{{ proposal.event.video_recording }} +{% endfor %} diff --git a/src/program/views.py b/src/program/views.py index 44b34395..acb08112 100644 --- a/src/program/views.py +++ b/src/program/views.py @@ -13,6 +13,7 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib import messages from django.urls import reverse from django.db.models import Q +from django.template import Engine, Context import icalendar @@ -323,5 +324,10 @@ class ProgramControlCenter(CampViewMixin, TemplateView): camp=self.camp ).select_related('user', 'event') context['proposals'] = proposals - return context + engine = Engine.get_default() + template = engine.get_template('control/proposal_overview.csv') + csv = template.render(Context(context)) + context['csv'] = csv + + return context