From 89da43fb56d036dc11420c9f7246c19854512517 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 21 Oct 2020 09:59:30 +0100 Subject: first stab at a new compliance app for doing overview view and later audit and inspection stuff --- config/settings/gcloud_settings.py | 1 + config/urls.py | 1 + ctrack/compliance/__init__.py | 0 ctrack/compliance/admin.py | 3 + ctrack/compliance/apps.py | 6 ++ ctrack/compliance/migrations/__init__.py | 0 ctrack/compliance/models.py | 3 + .../compliance/templates/compliance/overview.html | 88 ++++++++++++++++++++++ ctrack/compliance/tests.py | 3 + ctrack/compliance/urls.py | 9 +++ ctrack/compliance/views.py | 10 +++ 11 files changed, 124 insertions(+) create mode 100644 ctrack/compliance/__init__.py create mode 100644 ctrack/compliance/admin.py create mode 100644 ctrack/compliance/apps.py create mode 100644 ctrack/compliance/migrations/__init__.py create mode 100644 ctrack/compliance/models.py create mode 100644 ctrack/compliance/templates/compliance/overview.html create mode 100644 ctrack/compliance/tests.py create mode 100644 ctrack/compliance/urls.py create mode 100644 ctrack/compliance/views.py diff --git a/config/settings/gcloud_settings.py b/config/settings/gcloud_settings.py index 7f57ee7..c0c79a5 100644 --- a/config/settings/gcloud_settings.py +++ b/config/settings/gcloud_settings.py @@ -165,6 +165,7 @@ INSTALLED_APPS = [ "ctrack.register.apps.RegisterConfig", "ctrack.assessments.apps.AssessmentsConfig", "ctrack.core.apps.CoreConfig", + "ctrack.compliance.apps.ComplianceConfig", ] MIDDLEWARE = [ diff --git a/config/urls.py b/config/urls.py index f282893..f05a09b 100644 --- a/config/urls.py +++ b/config/urls.py @@ -10,6 +10,7 @@ admin.site.site_header = "ctrack admin" urlpatterns = [ path("", include("ctrack.core.urls", namespace="core")), + path("compliance/", include("ctrack.compliance.urls", namespace="compliance")), path( "about/", TemplateView.as_view(template_name="pages/about.html"), name="about" ), diff --git a/ctrack/compliance/__init__.py b/ctrack/compliance/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ctrack/compliance/admin.py b/ctrack/compliance/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/ctrack/compliance/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/ctrack/compliance/apps.py b/ctrack/compliance/apps.py new file mode 100644 index 0000000..e606f63 --- /dev/null +++ b/ctrack/compliance/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ComplianceConfig(AppConfig): + name = 'ctrack.compliance' + verbose_name = "Compliance" diff --git a/ctrack/compliance/migrations/__init__.py b/ctrack/compliance/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/ctrack/compliance/models.py b/ctrack/compliance/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/ctrack/compliance/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/ctrack/compliance/templates/compliance/overview.html b/ctrack/compliance/templates/compliance/overview.html new file mode 100644 index 0000000..0c53507 --- /dev/null +++ b/ctrack/compliance/templates/compliance/overview.html @@ -0,0 +1,88 @@ +{% extends "base.html" %} +{% load static %} + +{% block title %} CAF - All CAF Summary {% endblock %} + +{% block content %} + + + + +
+

+ + + + + Overview +

+

Use the search box to filter the table. The table can be exported in various formats using the buttons below. These + downloads will respect the filtering used.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ORG NAME 1CAF Initial SubmissionCAF ReviewOES RevisionsInspector ValidationValidation AgreedImprovement Plan SubmissionImprovement Plan Review
ORG NAME 2CAF Initial SubmissionCAF ReviewOES RevisionsInspector ValidationValidation AgreedImprovement Plan SubmissionImprovement Plan Review
ORG NAME 3CAF Initial SubmissionCAF ReviewOES RevisionsInspector ValidationValidation AgreedImprovement Plan SubmissionImprovement Plan Review
+
+
+{% endblock %} diff --git a/ctrack/compliance/tests.py b/ctrack/compliance/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/ctrack/compliance/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/ctrack/compliance/urls.py b/ctrack/compliance/urls.py new file mode 100644 index 0000000..29c13ff --- /dev/null +++ b/ctrack/compliance/urls.py @@ -0,0 +1,9 @@ +from django.urls import path + +from ctrack.compliance.views import overview + +app_name = "compliance" + +urlpatterns = [ + path("overview", overview, name="overview") +] diff --git a/ctrack/compliance/views.py b/ctrack/compliance/views.py new file mode 100644 index 0000000..e093f23 --- /dev/null +++ b/ctrack/compliance/views.py @@ -0,0 +1,10 @@ +from django.shortcuts import render + +from ctrack.caf.models import CAF + + +def overview(request): + cafs = CAF.objects.all() + context = {"cafs": cafs} + return render(request, "compliance/overview.html", context) + -- cgit v1.2.3