1
0
Fork 0
forked from muyrety/Smarter
Smarter/smarter/templates/questions/user_browse.j2
Arija A. a3a6316054
.html -> .j2 for Jinja2 correctness
Signed-off-by: Arija A. <ari@ari.lt>
2025-05-27 23:34:42 +03:00

45 lines
1.8 KiB
Django/Jinja

{% extends "browsing.j2" %}
{% block title %} Browse questions {% endblock %}
{% block head %}
<script src="{{ url_for('static', filename='js/user_browse.js') }}"></script>
{% endblock %}
{% block header %}
<div class="row justify-content-center mt-3">
<div class="col-lg-4 col-md-5 m-2 text-center">
<a href="{{ url_for('questions.otdb_browse') }}" class="btn btn-primary">Open Trivia DB questions</a>
<a href="{{ url_for('about.opentdb') }}" class="link-offset-2 link-underline ms-1">?</a>
</div>
<div class="col-lg-4 col-md-5 m-2 text-center">
<button class="btn btn-outline-primary" disabled>User-created questions</button>
</div>
</div>
{% endblock %}
{% block table %}
<table class="table table-info border-primary-subtle mt-3">
<thead>
<tr>
<th class="text-primary-emphasis" scope="col">ID</th>
<th class="text-primary-emphasis" scope="col">Category</th>
<th class="text-primary-emphasis" scope="col">Difficulty</th>
<th class="text-primary-emphasis" scope="col">Question</th>
<th class="text-primary-emphasis" scope="col">Created by</th>
</tr>
</thead>
<tbody id="questionTableBody">
{% for question in questions %}
<tr>
<th class="text-primary-emphasis" scope="row">{{ question["id"] }}</th>
<td class="text-primary-emphasis">{{ question["category"] }}</td>
<td class="text-primary-emphasis">{{ question["difficulty"] }}</td>
<td class="text-primary-emphasis">{{ question["question"] }}</td>
<td class="text-primary-emphasis">{{ question["creator"] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<p class="text-center text-primary-emphasis">You have reached the end</p>
{% endblock %}