From 274b7642e9297baecfeb044e9fd20e3f50f04fc9 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Tue, 10 Mar 2020 20:40:00 +0000 Subject: basic caf detail page implemented - BASIC --- .../caf/templates/caf/applicablesystem_list.html | 2 +- ctrack/caf/templates/caf/caf_detail.html | 71 ++++++++++++++++++++++ ctrack/caf/urls.py | 5 +- ctrack/caf/views.py | 10 +-- 4 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 ctrack/caf/templates/caf/caf_detail.html (limited to 'ctrack/caf') diff --git a/ctrack/caf/templates/caf/applicablesystem_list.html b/ctrack/caf/templates/caf/applicablesystem_list.html index 985960a..c9b07d0 100644 --- a/ctrack/caf/templates/caf/applicablesystem_list.html +++ b/ctrack/caf/templates/caf/applicablesystem_list.html @@ -28,7 +28,7 @@ {{ sys.organisation.name }} {{ sys.name }} - {{ sys.caf }} + {{ sys.caf }} {{ sys.organisation.submode.descriptor }} {{ sys.caf.confidence_grading.descriptor }} {{ sys.caf.triage_review_date }} diff --git a/ctrack/caf/templates/caf/caf_detail.html b/ctrack/caf/templates/caf/caf_detail.html new file mode 100644 index 0000000..f44164a --- /dev/null +++ b/ctrack/caf/templates/caf/caf_detail.html @@ -0,0 +1,71 @@ +{% extends "base.html" %} + +{% load static %} + +{% block title %}CAF Detail{% endblock %} +{% block content %} +
+ +
+

{{ object }}

+
+ +
+

Quality Grading

+
+ +
+

{{ object.quality_grading }}

+
+ +
+

Confidence Grading

+
+ +
+

{{ object.confidence_grading }}

+
+ +
+

Current Version

+
+ +
+

{{ object.version }}

+
+ +
+

File (location?)

+
+ +
+

{{ object.file }}

+
+ +
+

Triage Review Date

+
+ +
+

{{ object.triage_review_date }}

+
+ +
+

Triage Review Inspector

+
+ +
+

{{ object.triage_review_inspector }}

+
+ +
+

Comments

+
+ +
+

{{ object.comments }}

+
+{% endblock %} + + + diff --git a/ctrack/caf/urls.py b/ctrack/caf/urls.py index 37fb96b..3016013 100644 --- a/ctrack/caf/urls.py +++ b/ctrack/caf/urls.py @@ -1,11 +1,12 @@ from django.urls import path -from ctrack.caf.views import CreateCAF, ListCAF, ListApplicableSystem +from ctrack.caf.views import CreateCAF, ListCAF, ListApplicableSystem, DetailCAF app_name = "caf" urlpatterns = [ path("", view=CreateCAF.as_view(), name="create"), path("", view=ListCAF.as_view(), name="caf_list"), - path("applicablesystems", view=ListApplicableSystem.as_view(), name="es_list") + path("applicablesystems", view=ListApplicableSystem.as_view(), name="es_list"), + path("", DetailCAF.as_view(), name="detail") ] diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py index 5ded2dc..e4503e7 100644 --- a/ctrack/caf/views.py +++ b/ctrack/caf/views.py @@ -1,7 +1,7 @@ -from django.views.generic import CreateView, ListView +from django.views.generic import CreateView, ListView, DetailView from ctrack.caf.forms import CAFForm -from ctrack.caf.models import ApplicableSystem +from ctrack.caf.models import ApplicableSystem, CAF class CreateCAF(CreateView): @@ -18,6 +18,10 @@ class ListCAF(ListView): pass +class DetailCAF(DetailView): + model = CAF + + class ListApplicableSystem(ListView): model = ApplicableSystem # apparently you can pass a list of model objects to a template if you name it @@ -31,5 +35,3 @@ class ListApplicableSystem(ListView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) return context - - -- cgit v1.2.3