diff options
author | MR Lemon <matt@matthewlemon> | 2020-04-17 15:04:40 +0100 |
---|---|---|
committer | MR Lemon <matt@matthewlemon> | 2020-04-17 15:04:40 +0100 |
commit | 6cbd969aea2be1c6b344a0fe378e76b2fed0300a (patch) | |
tree | 280668aeaf59c3f27b7ea912106a5c65a8c8066a /ctrack/caf | |
parent | 0f7522d3c36391ea6750f52861c3b67ef0fcf4e2 (diff) |
added the ApplicableSystem detail page
Diffstat (limited to 'ctrack/caf')
-rw-r--r-- | ctrack/caf/templates/caf/applicablesystem_detail.html | 19 | ||||
-rw-r--r-- | ctrack/caf/templates/caf/applicablesystem_list.html | 2 | ||||
-rw-r--r-- | ctrack/caf/urls.py | 3 | ||||
-rw-r--r-- | ctrack/caf/views.py | 7 |
4 files changed, 28 insertions, 3 deletions
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 %} + + <div class="container"> + <div class="row"> + <div class="col-sm-12"> + <h3>{{ object.name }}</h3> + <h5>Description</h5> + <p>{{ object.description }}</p> + <p>Contained within CAF: to <a href="{% url "caf:detail" object.caf.pk %}">{{ object.caf }}</a></p> + </div> + </div> + </div> + +{% 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 %} <tr> <td><a href="{% url "organisations:detail" slug=sys.organisation.slug %}">{{ sys.organisation.name }}</a></td> - <td>{{ sys.name }}</td> + <td><a href="{% url "caf:ass_detail" sys.pk %}">{{ sys.name }}</a></td> <td><a href="{% url "caf:detail" pk=sys.caf.id %}">{{ sys.caf }}</a></td> <td>{{ sys.organisation.submode.descriptor }}</td> <td class="tabaligncenter">{{ sys.caf.confidence_grading.descriptor }}</td> 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/<int:pk>", ApplicableSystemDetail.as_view(), name="ass_detail"), path("<int:pk>", 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" |