duwiuishsuehgdz
This commit is contained in:
parent
aca1034400
commit
595753d323
3 changed files with 28 additions and 2 deletions
|
@ -172,6 +172,8 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def award_count(self, kind) -> int:
|
||||||
|
return len([x for x in self.awards if x.kind == kind])
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def json_core(self):
|
def json_core(self):
|
||||||
|
|
|
@ -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.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">
|
<div id="comment-{{c.id}}" class="comment">
|
||||||
|
|
||||||
|
|
|
@ -190,8 +190,9 @@
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if p.award_count("gold") %}
|
|
||||||
<script src="/assets/js/sparkle.min.js" type="text/javascript"></script>
|
<script src="/assets/js/sparkle.min.js" type="text/javascript"></script>
|
||||||
|
|
||||||
|
{% if p.award_count("gold") %}
|
||||||
<script>
|
<script>
|
||||||
document.getElementById("post-root").sparkle({
|
document.getElementById("post-root").sparkle({
|
||||||
count: 20,
|
count: 20,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue