start ouput

This commit is contained in:
Ross
2024-12-09 14:51:00 +00:00
parent 40ae9e1b64
commit 91ad134115
4 changed files with 52 additions and 1 deletions
+37
View File
@@ -0,0 +1,37 @@
{% extends 'oef/base.html' %}
{% block content %}
<h2>Formats</h2>
<a href="{% url 'oef:format_create' %}">Create a new format</a>
<table>
<tr>
<th>Format name</th>
<th>Action</th>
<th>Field Seq</th>
<th>Field Label</th>
<th>Field Name</th>
<th>Field Status</th>
<th>Field Codeset</th>
</tr>
{% for format in formats %}
<li>
<a href="{% url 'oef:format_update' format.id %}">{{ format.name }}</a>
<a href="{% url 'oef:formats_apply' format.id %}">apply</a> [{{ format.get_entries.count }}]
{% if request.user.is_superuser %}
<a href="{% url 'oef:formats_delete' format.id %}">(delete)</a>
{% endif %}
</li>
{% endfor %}
</table>
{% endblock content %}
+5 -1
View File
@@ -74,7 +74,11 @@
{% comment %} _="on click toggle @disabled until htmx:afterOnLoad then remove me" {% endcomment %}
>View similar</button>
<span class="results-sym"></span>
<button class="btn btn-sm" type="button" _="on click
writeText(title of the previous <pre/>) on navigator.clipboard
put 'copied!' into me
wait 1s
put 'copy1' into me">copy</button>
<button class="btn btn-sm" type="button" _="on click set #question1.value to the title of the previous <pre/>">
Diff1
</button>
+1
View File
@@ -69,5 +69,6 @@ urlpatterns = [
path(
"formats/save", views.formats_save, name="formats_save"
),
path("output", views.output, name="output"),
]
+9
View File
@@ -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})