From 00acec6fdb356eeeca2838ac02f74072f618c10c Mon Sep 17 00:00:00 2001 From: Danhia Date: Tue, 16 Aug 2022 18:03:39 +0200 Subject: [PATCH] separate profile page for events --- src/events/templates/events/profile.html | 166 +++++++++++++++++++++++ src/events/views/events.py | 4 +- 2 files changed, 168 insertions(+), 2 deletions(-) create mode 100644 src/events/templates/events/profile.html diff --git a/src/events/templates/events/profile.html b/src/events/templates/events/profile.html new file mode 100644 index 0000000..873f61c --- /dev/null +++ b/src/events/templates/events/profile.html @@ -0,0 +1,166 @@ +{% extends 'base.html' %} +{% block content %} +{% load i18n %} +{% load key_value %} +{% load is_member %} +{% ismember user.userprofileinfo as is_member %} +
+
+ < Back to event +
+

{% trans "Challenges Solved by" %} {{ user.username }} - {{ event.name }}

+ {% if solves%} + +
+
+
+
+
+ + + + + + + + + + + {% for s in solves %} + + + + + + + {% endfor %} + +
{% trans "Challenge Name" %}{% trans "Category" %}{% trans "Points" %}{% trans "Date" %}
{{ s.ctf.name }}{{ s.ctf.category.name}}{{ s.ctf.points }}{{ s.flag_date|date:"Y-m-d H:i:s" }}
+ {% else %} +

{% trans "It seems that this user has not solved any challenge yet..." %}

+ {% endif %} +
+
+ +
+ + + +{% endblock %} + diff --git a/src/events/views/events.py b/src/events/views/events.py index 759998c..a372932 100644 --- a/src/events/views/events.py +++ b/src/events/views/events.py @@ -289,7 +289,7 @@ def profile(request, user_name, event_slug): somme += s.ctf.points solved.append([s.flag_date.timestamp() * 1000,somme]) - return render(request,'accounts/profile.html', {'user':user_obj, 'solves':solves,'solved':solved,'catsDatas': catsDatas, 'pointDatas': pointDatas, - 'rank': rank, 'score' : somme, 'cats':cats}) + return render(request,'events/profile.html', {'user':user_obj, 'solves':solves,'solved':solved,'catsDatas': catsDatas, 'pointDatas': pointDatas, + 'rank': rank, 'score' : somme, 'cats':cats, 'event': event_info})