aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctrack/caf/forms.py14
-rw-r--r--ctrack/caf/migrations/0003_auto_20200424_1924.py18
-rw-r--r--ctrack/caf/models.py2
-rw-r--r--ctrack/caf/templates/caf/applicable_system_create_from_caf.html21
-rw-r--r--ctrack/caf/templates/caf/applicable_system_create_from_org.html22
-rw-r--r--ctrack/caf/views.py3
6 files changed, 66 insertions, 14 deletions
diff --git a/ctrack/caf/forms.py b/ctrack/caf/forms.py
index 3fe90a0..a21488a 100644
--- a/ctrack/caf/forms.py
+++ b/ctrack/caf/forms.py
@@ -34,9 +34,9 @@ class ApplicableSystemCreateFromCafForm(forms.Form):
self.helper = FormHelper(self)
self.helper.layout = Layout(
Fieldset(
- f"Create a new system for {caf}",
- Field("name", css_class="form-control form-control-sm"),
- Field("description", cass_class="form-control form-control-sm"),
+ "",
+ Field("name", css_class="form-control-lg"),
+ "description",
Hidden("caf", caf_id),
Hidden("organisation", org_id),
),
@@ -61,11 +61,11 @@ class ApplicableSystemCreateFromOrgForm(forms.Form):
self.helper = FormHelper(self)
self.helper.layout = Layout(
Fieldset(
- f"Create a new system for {org_name}",
- Field("name", css_class="form-control form-control-sm"),
- Field("description", css_class="form-control form-control-sm"),
+ "",
+ Field("name", css_class="form-control-lg"),
+ "description",
Hidden("organisation", org_id),
- Field("caf", css_class="form-control form-control-sm")
+ "caf",
),
ButtonHolder(
Submit("submit", "Submit", css_class="btn-primary"),
diff --git a/ctrack/caf/migrations/0003_auto_20200424_1924.py b/ctrack/caf/migrations/0003_auto_20200424_1924.py
new file mode 100644
index 0000000..34613c6
--- /dev/null
+++ b/ctrack/caf/migrations/0003_auto_20200424_1924.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.9 on 2020-04-24 19:24
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('caf', '0002_auto_20200403_1407'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='applicablesystem',
+ name='description',
+ field=models.TextField(blank=True, max_length=1000, null=True),
+ ),
+ ]
diff --git a/ctrack/caf/models.py b/ctrack/caf/models.py
index 0151d4b..1754e61 100644
--- a/ctrack/caf/models.py
+++ b/ctrack/caf/models.py
@@ -48,7 +48,7 @@ class ApplicableSystem(models.Model):
return Organisation.objects.get_or_create(name="DELETED ORGANISATION")[0]
name = models.CharField(max_length=256)
- description = models.TextField(max_length=1000)
+ description = models.TextField(max_length=1000, blank=True, null=True)
organisation = models.ForeignKey(
Organisation, on_delete=models.SET(get_sentinel_org)
)
diff --git a/ctrack/caf/templates/caf/applicable_system_create_from_caf.html b/ctrack/caf/templates/caf/applicable_system_create_from_caf.html
index fffb5f4..0c39fb6 100644
--- a/ctrack/caf/templates/caf/applicable_system_create_from_caf.html
+++ b/ctrack/caf/templates/caf/applicable_system_create_from_caf.html
@@ -1,16 +1,31 @@
{% extends "base.html" %}
+
{% block title %}
- Create a new Applicable System to an existing CAF
+ Add a new system to {{ caf }}
{% endblock title %}
{% load crispy_forms_tags %}
{% block content %}
- <div class="container">
+ <div class="container mt-3">
<div class="row">
- <div class="col-sm-6">
+ <div class="col-md-12 pl-0 my-2">
+ <h4>Add a new system to {{ caf }}</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 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>
</div>
{% endblock content %}
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 a655f3e..0d0fcef 100644
--- a/ctrack/caf/templates/caf/applicable_system_create_from_org.html
+++ b/ctrack/caf/templates/caf/applicable_system_create_from_org.html
@@ -1,13 +1,31 @@
{% extends "base.html" %}
+{% block title %}
+ Add a new system for {{ organisation }}
+{% endblock title %}
+
{% load crispy_forms_tags %}
{% block content %}
- <div class="container">
+ <div class="container mt-3">
<div class="row">
- <div class="col-sm-6">
+ <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>
+ </div>
</div>
</div>
{% endblock content %}
diff --git a/ctrack/caf/views.py b/ctrack/caf/views.py
index 5308421..0cee746 100644
--- a/ctrack/caf/views.py
+++ b/ctrack/caf/views.py
@@ -60,6 +60,7 @@ class ApplicableSystemDetail(LoginRequiredMixin, DetailView):
@login_required
def applicable_system_create_from_caf(request, caf_id):
org_id = CAF.objects.get(pk=caf_id).organisation().id
+ caf = CAF.objects.get(id=caf_id)
if request.method=="POST":
form = ApplicableSystemCreateFromCafForm(request.POST, caf_id=caf_id, org_id=org_id)
if form.is_valid():
@@ -73,7 +74,7 @@ def applicable_system_create_from_caf(request, caf_id):
else:
form = ApplicableSystemCreateFromCafForm(caf_id=caf_id, org_id=org_id)
- return render(request, "caf/applicable_system_create_from_caf.html", {"form": form})
+ return render(request, "caf/applicable_system_create_from_caf.html", {"form": form, "caf": caf})
class ApplicableSystemCreateFromOrg(LoginRequiredMixin, FormView):