Skip to content
Snippets Groups Projects
Commit 031f4240 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Create a very basic listing of the Application Submissions

parent aa06bbeb
No related branches found
No related tags found
No related merge requests found
from django.apps import AppConfig
class DashboardConfig(AppConfig):
name = 'dashboard'
# from django.db import models
# Create your models here.
{% extends "base.html" %}
{% block content %}
<h1>Recieved Content</h1>
<h3>Track and explore recent submissions</h3>
<table>
{% for submission in applicationsubmission_list %}
<tr>
<td>
{{ submission }}
</td>
</tr>
{% empty %}
There are no submissions to review.
{% endfor %}
</table>
{% endblock %}
from django.conf.urls import url
from .views import DashboardView
urlpatterns = [
url(r'^$', DashboardView.as_view(), name="dashboard")
]
from django.views.generic import ListView
from opentech.apply.funds.models import ApplicationSubmission
class DashboardView(ListView):
model = ApplicationSubmission
template_name = 'dashboard/dashboard.html'
# -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-22 09:40
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0040_page_draft_title'),
('funds', '0004_categoryblock_add_required_option'),
]
operations = [
migrations.CreateModel(
name='ApplicationSubmission',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('form_data', models.TextField()),
('submit_time', models.DateTimeField(auto_now_add=True, verbose_name='submit time')),
('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wagtailcore.Page')),
],
options={
'verbose_name': 'form submission',
'abstract': False,
},
),
]
......@@ -17,6 +17,7 @@ from wagtail.wagtailadmin.edit_handlers import (
)
from wagtail.wagtailcore.fields import StreamField
from wagtail.wagtailcore.models import Orderable
from wagtail.wagtailforms.models import AbstractFormSubmission
from opentech.apply.stream_forms.models import AbstractStreamForm
......@@ -52,6 +53,9 @@ class FundType(AbstractStreamForm):
# Only return the first form, will need updating for when working with 2 stage WF
return self.forms.all()[0].fields
def get_submission_class(self):
return ApplicationSubmission
@property
def workflow_class(self):
return WORKFLOW_CLASS[self.get_workflow_display()]
......@@ -182,3 +186,7 @@ class Round(AbstractStreamForm):
# We hide the round as only the open round is used which is displayed through the
# fund page
raise Http404()
class ApplicationSubmission(AbstractFormSubmission):
pass
......@@ -2,8 +2,11 @@ from django.conf.urls import include, url
from .funds import urls as funds_urls
from .users import urls as users_urls
from .dashboard import urls as dashboard_urls
urlpatterns = [
url(r'^apply/', include(funds_urls)),
url(r'^account/', include(users_urls, namespace='users')),
url(r'^dashboard/', include(dashboard_urls, namespace='dashboard')),
]
......@@ -16,6 +16,7 @@ INSTALLED_APPS = [
'opentech.apply.categories',
'opentech.apply.funds',
'opentech.apply.dashboard',
'opentech.apply.home',
'opentech.apply.users',
'opentech.apply.stream_forms',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment