forked from rDrama/rDrama
improve ginger and pumpking award code
parent
95baacfa09
commit
27ede573ea
|
@ -258,9 +258,14 @@ class Post(Base):
|
|||
return 0
|
||||
|
||||
num = len([x for x in self.awards if x.kind == kind])
|
||||
if num > 4 and kind not in {"shit", "fireflies", "gingerbread", "pumpkin", "stalker"}:
|
||||
return 4
|
||||
return num
|
||||
|
||||
if kind in {"shit", "fireflies", "stalker"}:
|
||||
return num
|
||||
|
||||
if kind in {"gingerbread", "pumpkin"}:
|
||||
return min(num, 10)
|
||||
|
||||
return min(num, 4)
|
||||
|
||||
@lazy
|
||||
def realurl(self, v):
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<div class="awards-container">
|
||||
{% set gingerbread_count = p.award_count("gingerbread", v) * 2 if p.award_count("gingerbread", v) <= 10 else 20 %}
|
||||
{% for i in range(gingerbread_count) %}
|
||||
{% for i in range(p.award_count("gingerbread", v)) %}
|
||||
<div class="fall-snowflake">
|
||||
<img loading="lazy" src="{{SITE_FULL_IMAGES}}/assets/events/fistmas/images/awards/gingerbread.webp?x=6" class="animate-spin object-contain" style="width: 40px; height: 40px" alt="animate marsey gingerbread icon">
|
||||
</div>
|
||||
|
|
|
@ -41,12 +41,11 @@
|
|||
{% endif %}
|
||||
|
||||
{% if p.award_count("pumpkin", v) %}
|
||||
{% set count = p.award_count("pumpkin", v) * 2 if p.award_count("pumpkin", v) <= 10 else 20 %}
|
||||
<div class="fall-pumpkins">
|
||||
{% for i in range(count) %}
|
||||
<div class="fall-pumpkin">
|
||||
<img src="/e/marseypumpking.webp" class="animate-spin" alt="animate marsey pumpkin icon">
|
||||
</div>
|
||||
{% for i in range(p.award_count("pumpkin", v)) %}
|
||||
<div class="fall-pumpkin">
|
||||
<img src="/e/marseypumpking.webp" class="animate-spin" alt="animate marsey pumpkin icon">
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue