remotes/1693045480750635534/spooky-22
fireworks88 2021-08-11 22:20:37 +02:00
parent cbcc93a0d2
commit 0634ef5894
3 changed files with 8 additions and 5 deletions

View File

@ -286,8 +286,8 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
return data
def has_award(self, kind):
return bool(len([x for x in self.awards if x.kind == kind]))
def award_count(self, kind) -> int:
return len([x for x in self.awards if x.kind == kind])
@property
def title(self):

View File

@ -29,6 +29,7 @@ ACTIONS = {
ALLOW_MULTIPLE = (
"ban",
"shit"
)

View File

@ -175,14 +175,16 @@
{% block content %}
{% if p.has_award("shit") %}
{% if p.award_count("shit") %}
<script src="/assets/js/bug-min.js" type="text/javascript"></script>
{% set minbugs = 10*p.award_count("shit") if p.award_count("shit") <= 5 else 50 %}
{% set maxbugs = 20*p.award_count("shit") if p.award_count("shit") <= 5 else 100 %}
<script type="text/javascript">
new BugController({
imageSprite: "/assets/images/fly-sprite.png",
canDie: false,
minBugs: 10,
maxBugs: 20,
minBugs: {{ minbugs }},
maxBugs: {{ maxbugs }},
mouseOver: "multiply"
});
</script>