diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2020-08-14 14:59:15 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2020-08-14 14:59:15 +0100 |
commit | bf9b0e6669d4c62e0db59004e5ecd2ff281eff4e (patch) | |
tree | 021f9b179d50be5afcc7b6fc567ba430e780a912 /ctrack/caf | |
parent | b649c79b450cf3845a43374a37a1fc82cbb3a742 (diff) |
working on adding list of existing systems to add system form
Diffstat (limited to 'ctrack/caf')
-rw-r--r-- | ctrack/caf/forms.py | 1 | ||||
-rw-r--r-- | ctrack/caf/templates/caf/applicable_system_create_from_org.html | 54 | ||||
-rw-r--r-- | ctrack/caf/templates/caf/caf_detail.html | 2 | ||||
-rw-r--r-- | ctrack/caf/urls.py | 36 |
4 files changed, 65 insertions, 28 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"), ] |