Skip to content

Commit

Permalink
User timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
fsoest committed Jan 11, 2025
1 parent 829c663 commit e1af368
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
17 changes: 17 additions & 0 deletions S1/waitinglists/templates/waitinglists/management.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
{% block title %}S1 Training{% endblock %}

{% block content %}
<div class="container mt-4">
<div class="row">

<div class="col-6">
<h4>Planned Sessions</h4>
{% for session in sessions %}
<div class="card">
Expand All @@ -12,8 +16,21 @@ <h5 class="card-title"><a href="{% url 'session_detail' session.id %}">{{ sessio
{{ session.datetime|format_datetime }}Z | Mentor: {{ session.mentor.first_name }} {{ session.mentor.last_name }} | {{ session.language }}
</div></div>
{% endfor %}
</div>
</div>
<div class="row">
<div class="col-4">
<h4>Waiting Lists</h4>
{% for module in modules %}
<h6><a href="{% url 'total_waiting_list' module.id %}">{{ module.name }}</a></h6>
{% endfor %}
</div>
<div class="col-8">
<h4>Quiz Timeouts</h4>
{% for user in timeout_users %}
{{ user.first_name }} {{ user.last_name }}
{% endfor %}
</div>
</div>
</div>
{% endblock %}
4 changes: 4 additions & 0 deletions S1/waitinglists/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .forms import AttendanceForm
from .helpers import send_moodle_find_user, send_moodle_activity_completion, quiz_ids
from .models import Attendance, Session, WaitingList, Module, Signup, QuizCompletion
from connect.models import UserDetail

load_dotenv()

Expand Down Expand Up @@ -343,12 +344,15 @@ def cancel_attendance(request, session_id):
def management(request):
sessions = Session.objects.filter(attendance_done=False).order_by("datetime")
modules = Module.objects.all().order_by("name")
timeout_details = UserDetail.objects.filter(flagged_for_deletion=True)
timeout_users = [detail.user for detail in timeout_details]
context = {
"sessions": sessions,
"prefer_en": request.user.userdetail.en_preferred,
"authenticated": request.user.is_authenticated,
"is_mentor": is_mentor(request.user),
"modules": modules,
"timeout_users": timeout_users,
}
template = loader.get_template("waitinglists/management.html")
return HttpResponse(template.render(context, request))
Expand Down

0 comments on commit e1af368

Please sign in to comment.