aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack')
-rw-r--r--ctrack/caf/forms.py1
-rw-r--r--ctrack/caf/templates/caf/applicable_system_create_from_org.html54
-rw-r--r--ctrack/caf/templates/caf/caf_detail.html2
-rw-r--r--ctrack/caf/urls.py36
-rw-r--r--ctrack/organisations/models.py4
-rw-r--r--ctrack/organisations/templates/organisations/organisation_detail.html2
6 files changed, 70 insertions, 29 deletions
diff --git a/ctrack/caf/forms.py b/ctrack/caf/forms.py
index a2623e1..7367ccd 100644
--- a/ctrack/caf/forms.py
+++ b/ctrack/caf/forms.py
@@ -100,6 +100,7 @@ class ApplicableSystemCreateFromOrgForm(forms.Form):
self.fields["caf"].queryset = CAF.objects.filter(
pk__in=[caf.pk for caf in org_cafs]
)
+ self.fields["caf"].label = "CAF"
self.fields["dft_categorisation"].label = "DfT Categorisation"
self.fields["oes_categorisation"].label = "OES Categorisation"
self.helper = FormHelper(self)
diff --git a/ctrack/caf/templates/caf/applicable_system_create_from_org.html b/ctrack/caf/templates/caf/applicable_system_create_from_org.html
index 0d0fcef..8a94155 100644
--- a/ctrack/caf/templates/caf/applicable_system_create_from_org.html
+++ b/ctrack/caf/templates/caf/applicable_system_create_from_org.html
@@ -1,31 +1,45 @@
{% extends "base.html" %}
{% block title %}
- Add a new system for {{ organisation }}
+ Add a new system for {{ organisation }}
{% endblock title %}
{% load crispy_forms_tags %}
{% block content %}
- <div class="container mt-3">
- <div class="row">
- <div class="col-md-12 pl-0 my-2">
- <h4>Add a new system for {{ organisation }}</h4>
- </div>
- </div>
- <div class="row">
- <div class="col-md-7 pt-2 border bg-light">
- {% crispy form %}
- </div>
- <div class="col-sm-5">
- <div class="card" style="width: 18rem;">
- <div class="card-body">
- <h5 class="card-title">Help on Adding a new System</h5>
- <p class="card-text">Here you can add some supplementary text if you like.</p>
- <a href="#" class="btn btn-primary">Go somewhere</a>
- </div>
+ <div class="container mt-3">
+ <div class="row">
+ <div class="col-md-12 pl-0 my-2">
+ <h4>Add a new system for {{ organisation }}</h4>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col-md-7 pt-2 border bg-light">
+ {% crispy form %}
+ </div>
+ <div class="col-sm-5">
+ <div class="row">
+ <div class="card" style="width: 18rem;">
+ <div class="card-body">
+ <h5 class="card-title">Help on Adding a new System</h5>
+ <p class="card-text">Here you can add some supplementary text if you like.</p>
+ <a href="#" class="btn btn-primary">Go somewhere</a>
+ </div>
+ </div>
+ </div>
+ <div class="row">
+ <div class="card" style="width: 18rem;">
+ <div class="card-body">
+ <h5 class="card-title">Other systems managed by <strong>{{ organisation.name }}:</strong></h5>
+ <ul class="list-group list-group-flush">
+ <li class="list-group-item">baws</li>
+ <li class="list-group-item">baws</li>
+ <li class="list-group-item">baws</li>
+ </ul>
+ </div>
+ </div>
+ </div>
+ </div>
</div>
- </div>
</div>
- </div>
{% endblock content %}
diff --git a/ctrack/caf/templates/caf/caf_detail.html b/ctrack/caf/templates/caf/caf_detail.html
index 97ccad4..fc2fcfd 100644
--- a/ctrack/caf/templates/caf/caf_detail.html
+++ b/ctrack/caf/templates/caf/caf_detail.html
@@ -79,7 +79,7 @@
</tr>
{% endfor %}
{% else %}
- <a class="btn btn-primary" href="{% url "caf:create_from_org" object.slug %}" role="button">Add
+ <a class="btn btn-primary" href="{% url "caf:as_create_from_org" object.slug %}" role="button">Add
new...</a>
{% endif %}
</table>
diff --git a/ctrack/caf/urls.py b/ctrack/caf/urls.py
index ca84609..557c2f0 100644
--- a/ctrack/caf/urls.py
+++ b/ctrack/caf/urls.py
@@ -1,16 +1,38 @@
from django.urls import path
from django.views.decorators.cache import cache_page
-from ctrack.caf.views import ListCAF, ListApplicableSystem, caf_detail_view, ApplicableSystemDetail, \
- ApplicableSystemCreateFromOrg, applicable_system_create_from_caf
+from ctrack.caf.views import (
+ ListCAF,
+ ListApplicableSystem,
+ caf_detail_view,
+ ApplicableSystemDetail,
+ ApplicableSystemCreateFromOrg,
+ applicable_system_create_from_caf,
+)
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("applicablesystems/<int:pk>", ApplicableSystemDetail.as_view(), name="ass_detail"),
- path("applicablesystem/<slug:slug>", ApplicableSystemCreateFromOrg.as_view(), name="create_from_org"),
- path("applicablesystem/create-from-caf/<int:caf_id>", applicable_system_create_from_caf, name="as_create_from_caf"),
- path("<int:pk>", caf_detail_view, name="detail")
+ path(
+ "applicablesystems",
+ cache_page(60 * 60)(ListApplicableSystem.as_view()),
+ name="es_list",
+ ),
+ path(
+ "applicablesystems/<int:pk>",
+ ApplicableSystemDetail.as_view(),
+ name="ass_detail",
+ ),
+ path(
+ "applicablesystem/<slug:slug>",
+ ApplicableSystemCreateFromOrg.as_view(),
+ name="as_create_from_org",
+ ),
+ path(
+ "applicablesystem/create-from-caf/<int:caf_id>",
+ applicable_system_create_from_caf,
+ name="as_create_from_caf",
+ ),
+ path("<int:pk>", caf_detail_view, name="detail"),
]
diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py
index 4a0b17c..d7f1194 100644
--- a/ctrack/organisations/models.py
+++ b/ctrack/organisations/models.py
@@ -152,6 +152,10 @@ class Organisation(models.Model):
def primary_contacts(self):
return self.person_set.filter(primary_nis_contact=True)
+ def applicable_systems(self):
+ # TODO - we need to do this
+ pass
+
class Address(models.Model):
organisation = models.ForeignKey(
diff --git a/ctrack/organisations/templates/organisations/organisation_detail.html b/ctrack/organisations/templates/organisations/organisation_detail.html
index af50e1c..c3a2fb5 100644
--- a/ctrack/organisations/templates/organisations/organisation_detail.html
+++ b/ctrack/organisations/templates/organisations/organisation_detail.html
@@ -70,7 +70,7 @@
<div class="card bg-light">
<div class="card-body">
<div class="card-title">NIS Systems <a
- href="{% url "caf:as_create_from_caf" object.pk %}" class="btn btn-primary btn-sm float-right">Add
+ href="{% url "caf:as_create_from_org" object.slug %}" class="btn btn-primary btn-sm float-right">Add
new...</a></div>
<div class="table table-responsive">
<table class="table">