aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-21 09:59:30 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-21 09:59:30 +0100
commit89da43fb56d036dc11420c9f7246c19854512517 (patch)
tree8440746edfb7120d31cd3655bd2d582df22ba75d
parent3a4073a6f6d4c6d03f2464120d7d8a6fdbed42b1 (diff)
first stab at a new compliance app for doing overview view and later audit and inspection stuff
Diffstat (limited to '')
-rw-r--r--config/settings/gcloud_settings.py1
-rw-r--r--config/urls.py1
-rw-r--r--ctrack/compliance/__init__.py0
-rw-r--r--ctrack/compliance/admin.py3
-rw-r--r--ctrack/compliance/apps.py6
-rw-r--r--ctrack/compliance/migrations/__init__.py0
-rw-r--r--ctrack/compliance/models.py3
-rw-r--r--ctrack/compliance/templates/compliance/overview.html88
-rw-r--r--ctrack/compliance/tests.py3
-rw-r--r--ctrack/compliance/urls.py9
-rw-r--r--ctrack/compliance/views.py10
11 files changed, 124 insertions, 0 deletions
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
--- /dev/null
+++ b/ctrack/compliance/__init__.py
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
--- /dev/null
+++ b/ctrack/compliance/migrations/__init__.py
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 %}
+
+ <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
+ <script type="application/javascript">
+ $(document).ready(function () {
+ $('#datatable').DataTable({
+ ordering: true,
+ searching: true,
+ buttons: true,
+ dom: 'B<"clear">lfrtip',
+ paging: false,
+ "drawCallback": function (settings) {
+ $("#datatable thead").remove();
+ },
+ });
+ });
+ </script>
+
+ <div class="col-12 m-2">
+ <h3>
+ <svg width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-card-checklist" fill="currentColor"
+ xmlns="http://www.w3.org/2000/svg">
+ <path fill-rule="evenodd"
+ d="M14.5 3h-13a.5.5 0 0 0-.5.5v9a.5.5 0 0 0 .5.5h13a.5.5 0 0 0 .5-.5v-9a.5.5 0 0 0-.5-.5zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13z"/>
+ <path fill-rule="evenodd"
+ d="M7 5.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0zM7 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0z"/>
+ </svg>
+ Overview
+ </h3>
+ <p>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.</p>
+ <div class="row justify-content-center">
+ <div class="col-md-12 my-2 py-2">
+ <table id="datatable" class="table table-bordered" style="width:100%">
+ <thead>
+ <tr>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ <td></td>
+ </tr>
+
+ </thead>
+ <tbody>
+ <tr>
+ <td>ORG NAME 1</td>
+ <td class="bg bg-success text-white">CAF Initial Submission</td>
+ <td class="bg bg-success text-white">CAF Review</td>
+ <td class="bg bg-warning text-white">OES Revisions</td>
+ <td>Inspector Validation</td>
+ <td>Validation Agreed</td>
+ <td>Improvement Plan Submission</td>
+ <td>Improvement Plan Review</td>
+ </tr>
+ <tr>
+ <td>ORG NAME 2</td>
+ <td class="bg bg-primary text-white">CAF Initial Submission</td>
+ <td>CAF Review</td>
+ <td>OES Revisions</td>
+ <td>Inspector Validation</td>
+ <td>Validation Agreed</td>
+ <td>Improvement Plan Submission</td>
+ <td>Improvement Plan Review</td>
+ </tr>
+ <tr>
+ <td>ORG NAME 3</td>
+ <td class="bg bg-success text-white">CAF Initial Submission</td>
+ <td class="bg bg-success text-white">CAF Review</td>
+ <td class="bg bg-success text-white">OES Revisions</td>
+ <td class="bg bg-success text-white">Inspector Validation</td>
+ <td>Validation Agreed</td>
+ <td>Improvement Plan Submission</td>
+ <td>Improvement Plan Review</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+{% 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)
+