From 6b23f510a90a526ebe9e8b3d60a9f4614026ee2c Mon Sep 17 00:00:00 2001 From: Nina Menezes Date: Wed, 17 Apr 2024 20:36:03 +0100 Subject: [PATCH] Make the formatting of the test ML pipeline page a bit better. --- .../consultations/dummy_data.py | 1 - .../support_console/ml_pipeline_test.html | 56 ++++++++++--------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/consultation_analyser/consultations/dummy_data.py b/consultation_analyser/consultations/dummy_data.py index 8113ea71b..8c5bcb34a 100644 --- a/consultation_analyser/consultations/dummy_data.py +++ b/consultation_analyser/consultations/dummy_data.py @@ -21,7 +21,6 @@ def __init__(self, responses=10, include_themes=True, **options): # Timestamp to avoid duplicates - set these as default options timestamp = datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S") if "name" not in options: - # name = f"Dummy consultation generated at {timestamp}" options["name"] = f"Dummy consultation generated at {timestamp}" if "slug" not in options: options["slug"] = f"consultation-slug-{timestamp}" diff --git a/consultation_analyser/support_console/jinja2/support_console/ml_pipeline_test.html b/consultation_analyser/support_console/jinja2/support_console/ml_pipeline_test.html index ecea4f44f..e3ef2bc74 100644 --- a/consultation_analyser/support_console/jinja2/support_console/ml_pipeline_test.html +++ b/consultation_analyser/support_console/jinja2/support_console/ml_pipeline_test.html @@ -19,37 +19,43 @@ {% endif %} {% endfor %} -

Create dummy data for testing

+

Test the machine learning pipeline

+
{{ csrf_input }} - -

Local, test, dev environments only. Generate dummy questions and responses only, no themes.

- - {{ csrf_input }} - {{ govukButton({ - 'text': "Generate dummy consultation", - 'name': "generate_dummy_consultation" - }) }} - - -

Existing consultations

- {% for c in consultations %} - - - {{ c.name }} - +

Generate a dummy consultation for testing

+

Local, test, and develop environments only. Generate dummy questions and responses but no dummy themes.

{{ govukButton({ - 'text': "Generate themes", - 'name': "consultation_id", - 'value': c.id + 'text': "Generate dummy consultation", + 'name': "generate_dummy_consultation" }) }} -
- {% endfor %} - -
- {% endblock %} +

Generate themes for existing consultations

+ {% for c in consultations %} +
+ +
+

+ {{ govukButton({ + 'text': "Generate themes", + 'name': "consultation_id", + 'value': c.id + }) }} +

+
+
+ {% endfor %} + + + +{% endblock %}