From 91ad13411557da9b79aaff3176a26122fd31c4e6 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 9 Dec 2024 14:51:00 +0000 Subject: [PATCH] start ouput --- oef/templates/oef/output.html | 37 ++++++++++++++++++++++++++++++++ oef/templates/oef/questions.html | 6 +++++- oef/urls.py | 1 + oef/views.py | 9 ++++++++ 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 oef/templates/oef/output.html diff --git a/oef/templates/oef/output.html b/oef/templates/oef/output.html new file mode 100644 index 00000000..f3337297 --- /dev/null +++ b/oef/templates/oef/output.html @@ -0,0 +1,37 @@ + +{% extends 'oef/base.html' %} + + + +{% block content %} +

Formats

+Create a new format + + + + + + + + + + + +{% for format in formats %} +
  • + {{ format.name }} +apply [{{ format.get_entries.count }}] + +{% if request.user.is_superuser %} + (delete) + +{% endif %} + +
  • + +{% endfor %} +
    Format nameActionField SeqField LabelField NameField StatusField Codeset
    + + +{% endblock content %} + \ No newline at end of file diff --git a/oef/templates/oef/questions.html b/oef/templates/oef/questions.html index 2d49caec..48d4bdd2 100644 --- a/oef/templates/oef/questions.html +++ b/oef/templates/oef/questions.html @@ -74,7 +74,11 @@ {% comment %} _="on click toggle @disabled until htmx:afterOnLoad then remove me" {% endcomment %} >View similar - + diff --git a/oef/urls.py b/oef/urls.py index 2562b862..9035cbc0 100644 --- a/oef/urls.py +++ b/oef/urls.py @@ -69,5 +69,6 @@ urlpatterns = [ path( "formats/save", views.formats_save, name="formats_save" ), + path("output", views.output, name="output"), ] \ No newline at end of file diff --git a/oef/views.py b/oef/views.py index 2c56b220..60602dc1 100644 --- a/oef/views.py +++ b/oef/views.py @@ -52,6 +52,15 @@ class EntryTableView(SingleTableMixin, FilterView): filterset_class = EntryFilter +def output(request): + formats = Formats.objects.all() + + for format in formats: + questions = format.format + + + return render(request, "oef/output.html", {"formats": formats}) + def formats_view(request): formats = Formats.objects.all() return render(request, "oef/formats_view.html", {"formats": formats})