Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blt/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
)

if DEBUG:
MIDDLEWARE += ["livereload.middleware.LiveReloadScript"]
MIDDLEWARE += ("livereload.middleware.LiveReloadScript",)

BLUESKY_USERNAME = env("BLUESKY_USERNAME", default="default_username")
BLUESKY_PASSWORD = env("BLUESKY_PASSWORD", default="default_password")
Expand Down
8 changes: 8 additions & 0 deletions website/templates/lab_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ <h3 class="text-lg leading-6 font-medium text-gray-900">Lab Tasks</h3>
<span class="ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium {% if task.task_type == 'theory' %}bg-blue-100 text-blue-800{% else %}bg-red-100 text-red-800{% endif %}">
{{ task.get_task_type_display }}
</span>
{% if completed_task_ids and task.id in completed_task_ids %}
<span class="ml-2 inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-[#2ecc71] text-[#000000]">
<svg class="w-4 h-4 mr-1" fill="none" stroke="#27ae60" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path>
</svg>
Completed
</span>
{% endif %}
</div>
{% if task.description %}<p class="mt-1 text-sm text-gray-500">{{ task.description }}</p>{% endif %}
</div>
Expand Down
6 changes: 6 additions & 0 deletions website/views/Simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ def lab_detail(request, lab_id):
"""Display detailed view of a specific lab with its tasks"""
lab = get_object_or_404(Labs, id=lab_id, is_active=True)
tasks = Tasks.objects.filter(lab=lab, is_active=True).order_by("order")
completed_task_ids = set(
UserTaskProgress.objects.filter(user=request.user, task__in=tasks, completed=True).values_list(
"task_id", flat=True
)
)

context = {
"lab": lab,
"tasks": tasks,
"completed_task_ids": completed_task_ids,
}
return render(request, "lab_detail.html", context)

Expand Down