duwiuishsuehgdz

remotes/1693045480750635534/spooky-22
fireworks88 2021-08-23 13:05:56 +02:00
parent 0e4c65912b
commit a0a14eac79
3 changed files with 28 additions and 2 deletions

View File

@ -172,6 +172,8 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
return data
def award_count(self, kind) -> int:
return len([x for x in self.awards if x.kind == kind])
@property
def json_core(self):

View File

@ -15,7 +15,30 @@
{% if (c.is_banned or c.deleted_utc > 0 or c.is_blocking or c.is_blocked) and not (v and v.admin_level>0) and not (v and v.id==c.author_id) %}
{% if c.award_count("gold") and not c.is_banned and not c.is_deleted %}
<script>
document.getElementById("comment-{{c.id}}-only").sparkle({
count: 20,
minAge: 150,
maxAge: 300,
starsource: `
<svg
width="100%"
height="100%"
viewBox="0 0 15 15"
version="1.1"
xmlns="http://www.w3.org/2000/svg" x
mlns:xlink="http://www.w3.org/1999/xlink"
xml:space="preserve"
xmlns:serif="http://www.serif.com/"
style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="M1.125,4.95l4.462,0l1.913,-3.825l0.637,3.825l5.738,0l-4.463,3.188l0.638,5.737l-3.187,-3.825l-4.463,3.825l1.913,-5.737l-3.188,-3.188Z"
style="fill:#aaad00;">
</path>
</svg>`,
});
</script>
{% endif %}
<div id="comment-{{c.id}}" class="comment">

View File

@ -190,8 +190,9 @@
</script>
{% endif %}
{% if p.award_count("gold") %}
<script src="/assets/js/sparkle.min.js" type="text/javascript"></script>
{% if p.award_count("gold") %}
<script>
document.getElementById("post-root").sparkle({
count: 20,