1
0
Fork 0
forked from muyrety/Smarter
Smarter/smarter/templates/questions/otdb_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

67 lines
2.9 KiB
Django/Jinja

{% extends "browsing.j2" %}
{% block title %} Browse questions {% endblock %}
{% block after_bootstrap_js %}
<script type="module" src="{{ url_for('static', filename='js/otdb_browse.js') }}"></script>
{% endblock %}
{% block header %}
<div id="tooManyRequestsModal" class="modal fade" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content bg-info-subtle text-success border-success-subtle">
<div class="modal-header border-success-subtle">
<h5 class="modal-title">Too many requests</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<p>You have made too many question requests. Please wait at least 5 seconds between requests.</p>
</div>
<div class="modal-footer justify-content-center border-success-subtle">
<button type="button" class="btn btn-outline-success" data-bs-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
<div id="unexpectedErrorModal" class="modal fade" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content bg-info-subtle text-success border-success-subtle">
<div class="modal-header border-success-subtle">
<h5 class="modal-title">Unexpected error</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<p>An unexpected error has occured. Please refresh the page.</p>
</div>
<div class="modal-footer justify-content-center border-success-subtle">
<button type="button" class="btn btn-outline-success" data-bs-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
<div class="row justify-content-center mt-3">
<div class="col-lg-4 col-md-5 m-2 text-center">
<button class="btn btn-outline-primary" disabled>Open Trivia DB questions</button>
<a href="{{ url_for('about.opentdb') }}" class="link-offset-2 text-primary-emphasis ms-1">?</a>
</div>
<div class="col-lg-4 col-md-5 m-2 text-center">
<a href="{{ url_for('questions.user_browse') }}" class="btn btn-primary">User-created questions</a>
</div>
</div>
{% endblock %}
{% block table %}
<table id="questionTable" class="table table-info border-primary-subtle mt-3">
<thead>
<tr>
<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>
</tr>
</thead>
</table>
<div class="text-center">
<button class="btn btn-outline-primary mb-3" id="loadQuestions">Load more</button>
<p class="text-primary-emphasis d-none" id="endReached">You have reached the end</p>
</div>
{% endblock %}