.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
{% extends 'oef/base.html' %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h2>Entries</h2>
|
||||
Count: {{ entries|length }}
|
||||
|
||||
<button
|
||||
_="on click hide <li.inactive-True/> then show <li.inactive-False/>"
|
||||
>Hide inactive</button>
|
||||
<button
|
||||
_="on click hide <li.inactive-False/> then show <li.inactive-True/>"
|
||||
>Hide active</button>
|
||||
|
||||
<ul>
|
||||
{% for entry in entries %}
|
||||
<li class="inactive-{{entry.inactive}}"><a href='{{entry.get_absolute_url}}'>{{entry.exam_code}} / {{entry.exam_name}}</a></li>
|
||||
|
||||
{% endfor %}
|
||||
<li>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
<style type="text/css">
|
||||
.inactive-True a {
|
||||
color: darkred;
|
||||
text-decoration: none;
|
||||
}
|
||||
.inactive-False a {
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
{% block content %}
|
||||
|
||||
View <a href="{% url 'oef:entries' %}">All</a>
|
||||
|
||||
<div id="view-filter-options">
|
||||
<details><summary>
|
||||
<h3>Filter Entries</h3>
|
||||
|
||||
@@ -26,6 +26,9 @@ urlpatterns = [
|
||||
path(
|
||||
"entries/questions", views.questions, name="questions"
|
||||
),
|
||||
path(
|
||||
"entries/all", views.entries, name="entries"
|
||||
),
|
||||
path(
|
||||
"entries/questions_diff", views.questions_diff, name="questions_diff"
|
||||
),
|
||||
|
||||
@@ -91,6 +91,11 @@ def replace_questions(request):
|
||||
else:
|
||||
return render(request, "oef/replace_questions.html", {})
|
||||
|
||||
def entries(request):
|
||||
entries = Entry.objects.all()
|
||||
return render(request, "oef/entries.html", {"entries": entries})
|
||||
|
||||
|
||||
def questions(request):
|
||||
questions = set(Entry.objects.filter(inactive=False).values_list("questions", flat=True))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user