diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2020-08-14 15:27:56 +0100 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2020-08-14 15:27:56 +0100 |
commit | 74ed83a719a8f34c3e989b84c96f6759ea2f182c (patch) | |
tree | fe0e246569c1ebe372fa8111c381a8e501767db0 | |
parent | bf9b0e6669d4c62e0db59004e5ecd2ff281eff4e (diff) |
list of other systems on form to add system for org
Diffstat (limited to '')
-rw-r--r-- | ctrack/caf/templates/caf/applicable_system_create_from_org.html | 10 | ||||
-rw-r--r-- | ctrack/organisations/models.py | 3 |
2 files changed, 8 insertions, 5 deletions
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 8a94155..e4d3efa 100644 --- a/ctrack/caf/templates/caf/applicable_system_create_from_org.html +++ b/ctrack/caf/templates/caf/applicable_system_create_from_org.html @@ -32,9 +32,13 @@ <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> + {% if organisation.applicable_systems %} + {% for s in organisation.applicable_systems %} + <li class="list-group-item"><a href="{% url "caf:ass_detail" s.pk %}">{{ s.name }}</a></li> + {% endfor %} + {% else %} + <p>Doesn't have any systems</p> + {% endif %} </ul> </div> </div> diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py index d7f1194..9eb0a23 100644 --- a/ctrack/organisations/models.py +++ b/ctrack/organisations/models.py @@ -153,8 +153,7 @@ class Organisation(models.Model): return self.person_set.filter(primary_nis_contact=True) def applicable_systems(self): - # TODO - we need to do this - pass + return self.applicablesystem_set.all() class Address(models.Model): |