-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: magicalsoup <amagicalsoup@gmail.com>
- Loading branch information
1 parent
e86c114
commit 42c3419
Showing
17 changed files
with
606 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import django.core.validators | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('judge', '0121_per_problem_sub_access_control'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='profile', | ||
name='is_banned_problem_voting', | ||
field=models.BooleanField(default=False, | ||
help_text="User will not be able to vote on problems' point values.", | ||
verbose_name='banned from voting'), | ||
), | ||
migrations.CreateModel( | ||
name='ProblemPointsVote', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('points', models.IntegerField(help_text='The amount of points you think this problem deserves.', | ||
validators=[django.core.validators.MinValueValidator(1), | ||
django.core.validators.MaxValueValidator(50)], | ||
verbose_name='How much this vote is worth')), | ||
('note', models.TextField(blank=True, default='', help_text='Justification for problem points value.', | ||
max_length=2048, verbose_name='note to go along with vote')), | ||
('problem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, | ||
related_name='problem_points_votes', to='judge.Problem')), | ||
('voter', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, | ||
related_name='problem_points_votes', to='judge.Profile')), | ||
], | ||
options={ | ||
'verbose_name': 'Vote', | ||
'verbose_name_plural': 'Votes', | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<style> | ||
.lightbox { | ||
position: fixed; | ||
z-index: 1000; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: rgba(22,27,34,0.8); | ||
display: none; | ||
} | ||
|
||
.lightbox-active { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
</style> | ||
<script> | ||
function closeLightbox(id_lightbox){ | ||
$('#'+id_lightbox).removeClass('lightbox-active') | ||
} | ||
|
||
function createLightbox(id_lightbox, id_content) { | ||
$(`<div id="${id_lightbox}" class="lightbox"/>`) | ||
.appendTo($('body')) | ||
.append($('#'+id_content)) | ||
.on('click', e => { | ||
if (e.target !== e.currentTarget) return; | ||
closeLightbox(id_lightbox); | ||
}); | ||
} | ||
|
||
function activateLightbox(id_lightbox) { | ||
$('#'+id_lightbox).addClass('lightbox-active') | ||
} | ||
</script> |
Oops, something went wrong.