diff options
Diffstat (limited to 'ctrack')
-rw-r--r-- | ctrack/organisations/migrations/0006_organisation_oes.py | 19 | ||||
-rw-r--r-- | ctrack/organisations/models.py | 1 | ||||
-rw-r--r-- | ctrack/organisations/templates/organisations/organisation_detail.html | 27 | ||||
-rw-r--r-- | ctrack/organisations/tests/factories.py | 1 |
4 files changed, 39 insertions, 9 deletions
diff --git a/ctrack/organisations/migrations/0006_organisation_oes.py b/ctrack/organisations/migrations/0006_organisation_oes.py new file mode 100644 index 0000000..17edfb5 --- /dev/null +++ b/ctrack/organisations/migrations/0006_organisation_oes.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.9 on 2020-03-11 16:56 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('organisations', '0005_auto_20200303_0727'), + ] + + operations = [ + migrations.AddField( + model_name='organisation', + name='oes', + field=models.BooleanField(default=True), + preserve_default=False, + ), + ] diff --git a/ctrack/organisations/models.py b/ctrack/organisations/models.py index 4de9888..7829b95 100644 --- a/ctrack/organisations/models.py +++ b/ctrack/organisations/models.py @@ -123,6 +123,7 @@ class Organisation(models.Model): submode = models.ForeignKey( Submode, on_delete=models.CASCADE, blank=True, null=True ) + oes = models.BooleanField() designation_type = models.IntegerField(choices=DESIGNATION_TYPE, default=1) registered_company_name = models.CharField(max_length=255, blank=True) registered_company_number = models.CharField(max_length=100, blank=True) diff --git a/ctrack/organisations/templates/organisations/organisation_detail.html b/ctrack/organisations/templates/organisations/organisation_detail.html index 836dec2..59b31db 100644 --- a/ctrack/organisations/templates/organisations/organisation_detail.html +++ b/ctrack/organisations/templates/organisations/organisation_detail.html @@ -28,6 +28,15 @@ <td>{{ object.designation_type }}</td> </tr> <tr> + <td><strong>OES:</strong></td> + {% if object.oes %} + <td>Yes</td> + {% else %} + <td><span class="text-danger">No</span></td> + {% endif %} + + </tr> + <tr> <td><strong>Registered Company Name:</strong></td> <td>{{ object.registered_company_name }}</td> </tr> @@ -62,15 +71,15 @@ <div class="table-responsive"> <table class="table"> {% for ass in applicable_systems %} - <tr> - <td><strong>{{ ass.name }}</strong></td> - <td>{{ ass.description }}<br> - <a href="#" class="small"> - {{ ass.caf }} - </a> <span class="text-muted">|</span> <a href="#" class="small">System Detail</a> - <span class="text-muted">|</span> <a href="#" class="small">Edit System</a> - </td> - </tr> + <tr> + <td><strong>{{ ass.name }}</strong></td> + <td>{{ ass.description }}<br> + <a href="#" class="small"> + {{ ass.caf }} + </a> <span class="text-muted">|</span> <a href="#" class="small">System Detail</a> + <span class="text-muted">|</span> <a href="#" class="small">Edit System</a> + </td> + </tr> {% endfor %} </table> </div> diff --git a/ctrack/organisations/tests/factories.py b/ctrack/organisations/tests/factories.py index 38e6079..3550f6e 100644 --- a/ctrack/organisations/tests/factories.py +++ b/ctrack/organisations/tests/factories.py @@ -47,6 +47,7 @@ class OrganisationFactory(DjangoModelFactory): name = Faker("company") slug = Faker("lexify", text="????", letters="abcdsg") designation_type = 1 + oes = factory.LazyFunction(lambda : random.choice([True, False])) registered_company_name = Faker("company") registered_company_number = Faker("numerify", text="######") date_updated = Faker("date_this_year", before_today=True) |