May certify logic

This commit is contained in:
Oleg Lavrovsky 2024-05-07 12:05:36 +02:00
parent f6eca2b836
commit cba08747d9
No known key found for this signature in database
GPG Key ID: 31E523030632FF4B
3 changed files with 8 additions and 5 deletions

View File

@ -103,8 +103,8 @@ def home():
my_projects = may_certify = None
if current_user and not current_user.is_anonymous:
my_projects = current_user.joined_projects(True, 3)
if cur_event is not None:
may_certify = cur_event.has_finished and cur_event.certificate_path
if cur_event is not None:
may_certify = cur_event.has_finished and cur_event.certificate_path
# Filter past events
MAX_PAST_EVENTS = 6
events_past_next = events_past.count() > MAX_PAST_EVENTS
@ -226,6 +226,9 @@ def event(event_id):
current_event=event, projects=projects)
# Check for certificate
may_certify = event.has_finished and event.certificate_path
if may_certify:
may_certify = current_user and not current_user.is_anonymous
may_certify = may_certify and current_user.may_certify()[0]
# TODO: seems inefficient? We only need a subset of the data here:
summaries = [ p.data for p in projects ]
return render_template("public/event.html", current_event=event,

View File

@ -1006,9 +1006,9 @@ nav .nav-login {
}
.project-edit-cover {
z-index: 99;
position: absolute;
margin-top: -2em;
margin-left: 1em;
line-height: 0px;
float: right;
}
.jumbotron.projectnew-boilerplate {
border: 10px solid lightseagreen;

View File

@ -13,7 +13,7 @@
{% if current_user and current_user.is_authenticated %}
<div class="row">
{% if score_tip %}
{% if score_tip and current_user.id == user.id %}
<div class="category-tip mt-2 clearfix"
title="This tip is only visible to you">
To improve your score, please