From 6cbd969aea2be1c6b344a0fe378e76b2fed0300a Mon Sep 17 00:00:00 2001 From: MR Lemon Date: Fri, 17 Apr 2020 15:04:40 +0100 Subject: added the ApplicableSystem detail page --- ctrack/caf/templates/caf/applicablesystem_detail.html | 19 +++++++++++++++++++ ctrack/caf/templates/caf/applicablesystem_list.html | 2 +- ctrack/caf/urls.py | 3 ++- ctrack/caf/views.py | 7 ++++++- 4 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 ctrack/caf/templates/caf/applicablesystem_detail.html (limited to 'ctrack/caf') diff --git a/ctrack/caf/templates/caf/applicablesystem_detail.html b/ctrack/caf/templates/caf/applicablesystem_detail.html new file mode 100644 index 0000000..725435e --- /dev/null +++ b/ctrack/caf/templates/caf/applicablesystem_detail.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} + +{% load static %} + +{% block title %}{{ object.name }}{% endblock %} +{% block content %} + +
+
+
+

{{ object.name }}

+
Description
+

{{ object.description }}

+

Contained within CAF: to {{ object.caf }}

+
+
+
+ +{% endblock %} diff --git a/ctrack/caf/templates/caf/applicablesystem_list.html b/ctrack/caf/templates/caf/applicablesystem_list.html index c9b07d0..804edab 100644 --- a/ctrack/caf/templates/caf/applicablesystem_list.html +++ b/ctrack/caf/templates/caf/applicablesystem_list.html @@ -27,7 +27,7 @@ {% for sys in object_list %} {{ sys.organisation.name }} - {{ sys.name }} + {{ sys.name }} {{ sys.caf }} {{ sys.organisation.submode.descriptor }} {{ sys.caf.confidence_grading.descriptor }} diff --git a/ctrack/caf/urls.py b/ctrack/caf/urls.py index a9b7946..19cbf0f 100644 --- a/ctrack/caf/urls.py +++ b/ctrack/caf/urls.py @@ -1,12 +1,13 @@ from django.urls import path from django.views.decorators.cache import cache_page -from ctrack.caf.views import ListCAF, ListApplicableSystem, caf_detail_view +from ctrack.caf.views import ListCAF, ListApplicableSystem, caf_detail_view, ApplicableSystemDetail app_name = "caf" urlpatterns = [ path("", view=ListCAF.as_view(), name="caf_list"), path("applicablesystems", cache_page(60 * 60)(ListApplicableSystem.as_view()), name="es_list"), + path("applicablesystem/", ApplicableSystemDetail.as_view(), name="ass_detail"), path("", caf_detail_view, name="detail") ] diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py index 93b44e3..4bcfe61 100644 --- a/ctrack/caf/views.py +++ b/ctrack/caf/views.py @@ -1,6 +1,6 @@ from django.contrib.auth.mixins import LoginRequiredMixin from django.shortcuts import render -from django.views.generic import ListView +from django.views.generic import ListView, DetailView from ctrack.assessments.models import CAFAssessmentOutcomeScore from ctrack.caf.models import ApplicableSystem, CAF @@ -44,3 +44,8 @@ class ListApplicableSystem(LoginRequiredMixin, ListView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) return context + + +class ApplicableSystemDetail(LoginRequiredMixin, DetailView): + model = ApplicableSystem + template_name = "caf/applicablesystem_detail.html" -- cgit v1.2.3