start ouput
This commit is contained in:
@@ -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 %}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -69,5 +69,6 @@ urlpatterns = [
|
||||
path(
|
||||
"formats/save", views.formats_save, name="formats_save"
|
||||
),
|
||||
path("output", views.output, name="output"),
|
||||
|
||||
]
|
||||
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user