forked from rDrama/rDrama
fds
parent
69fd0aabec
commit
7c90b95880
File diff suppressed because one or more lines are too long
|
@ -218,7 +218,7 @@ def award_post(pid, v):
|
||||||
if not post:
|
if not post:
|
||||||
return {"error": "That post doesn't exist."}, 404
|
return {"error": "That post doesn't exist."}, 404
|
||||||
|
|
||||||
if kind == "ghosts" and post.distinguish_level: return {"error": "You can't use the ghosts award on distinguished posts."}, 403
|
if kind == "ghost" and post.distinguish_level: return {"error": "You can't use the ghost award on distinguished posts."}, 403
|
||||||
|
|
||||||
post_award.submission_id = post.id
|
post_award.submission_id = post.id
|
||||||
g.db.add(post_award)
|
g.db.add(post_award)
|
||||||
|
@ -392,7 +392,7 @@ def award_post(pid, v):
|
||||||
g.db.add(badge)
|
g.db.add(badge)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}")
|
send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}")
|
||||||
elif kind == "ghosts":
|
elif kind == "ghost":
|
||||||
post.ghost = True
|
post.ghost = True
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
for c in post.comments:
|
for c in post.comments:
|
||||||
|
@ -451,7 +451,7 @@ def award_comment(cid, v):
|
||||||
if not c:
|
if not c:
|
||||||
return {"error": "That comment doesn't exist."}, 404
|
return {"error": "That comment doesn't exist."}, 404
|
||||||
|
|
||||||
if kind == "ghosts" and c.distinguish_level: return {"error": "You can't use the ghosts award on distinguished comments."}, 403
|
if kind == "ghost" and c.distinguish_level: return {"error": "You can't use the ghost award on distinguished comments."}, 403
|
||||||
|
|
||||||
comment_award.comment_id = c.id
|
comment_award.comment_id = c.id
|
||||||
g.db.add(comment_award)
|
g.db.add(comment_award)
|
||||||
|
@ -622,7 +622,7 @@ def award_comment(cid, v):
|
||||||
g.db.add(badge)
|
g.db.add(badge)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}")
|
send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}")
|
||||||
elif kind == "ghosts":
|
elif kind == "ghost":
|
||||||
c.ghost = True
|
c.ghost = True
|
||||||
g.db.add(c)
|
g.db.add(c)
|
||||||
elif kind == "nword":
|
elif kind == "nword":
|
||||||
|
|
|
@ -58,7 +58,7 @@ def ghost_price(v):
|
||||||
|
|
||||||
def submit_ghost(v,db):
|
def submit_ghost(v,db):
|
||||||
ghost = db.query(AwardRelationship.id).filter(
|
ghost = db.query(AwardRelationship.id).filter(
|
||||||
AwardRelationship.kind == 'ghosts',
|
AwardRelationship.kind == 'ghost',
|
||||||
AwardRelationship.user_id == v.id,
|
AwardRelationship.user_id == v.id,
|
||||||
AwardRelationship.submission_id == None,
|
AwardRelationship.submission_id == None,
|
||||||
AwardRelationship.comment_id == None
|
AwardRelationship.comment_id == None
|
||||||
|
@ -1126,7 +1126,7 @@ def submit_post(v, sub=None):
|
||||||
if request.values.get('ghost'):
|
if request.values.get('ghost'):
|
||||||
|
|
||||||
ghost_award = g.db.query(AwardRelationship).filter(
|
ghost_award = g.db.query(AwardRelationship).filter(
|
||||||
AwardRelationship.kind == 'ghosts',
|
AwardRelationship.kind == 'ghost',
|
||||||
AwardRelationship.user_id == v.id,
|
AwardRelationship.user_id == v.id,
|
||||||
AwardRelationship.submission_id == None,
|
AwardRelationship.submission_id == None,
|
||||||
AwardRelationship.comment_id == None
|
AwardRelationship.comment_id == None
|
||||||
|
|
|
@ -185,7 +185,7 @@
|
||||||
|
|
||||||
{% if c.awards %}
|
{% if c.awards %}
|
||||||
{% for a in c.awards %}
|
{% for a in c.awards %}
|
||||||
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{a.title}} Award{% if a.kind != 'ghosts' %} given by @{{a.user.username}}{% endif %}" data-bs-original-title="{{a.title}} Award{% if a.kind != 'ghosts' %} given by @{{a.user.username}}{% endif %}"></i>
|
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{a.title}} Award{% if a.kind != 'ghost' %} given by @{{a.user.username}}{% endif %}" data-bs-original-title="{{a.title}} Award{% if a.kind != 'ghost' %} given by @{{a.user.username}}{% endif %}"></i>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -706,7 +706,7 @@
|
||||||
|
|
||||||
{% if p.awards %}
|
{% if p.awards %}
|
||||||
{% for a in p.awards %}
|
{% for a in p.awards %}
|
||||||
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{a.title}} Award{% if a.kind != 'ghosts' %} given by @{{a.user.username}}{% endif %}" data-bs-original-title="{{a.title}} Award{% if a.kind != 'ghosts' %} given by @{{a.user.username}}{% endif %}"></i>
|
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{a.title}} Award{% if a.kind != 'ghost' %} given by @{{a.user.username}}{% endif %}" data-bs-original-title="{{a.title}} Award{% if a.kind != 'ghost' %} given by @{{a.user.username}}{% endif %}"></i>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if v and v.admin_level > 1 and p.author.shadowbanned %}<i class="fas fa-user-times text-admin" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Shadowbanned by @{{p.author.shadowbanned}}" data-bs-original-title="Shadowbanned by @{{p.author.shadowbanned}}"></i>{% endif %}
|
{% if v and v.admin_level > 1 and p.author.shadowbanned %}<i class="fas fa-user-times text-admin" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Shadowbanned by @{{p.author.shadowbanned}}" data-bs-original-title="Shadowbanned by @{{p.author.shadowbanned}}"></i>{% endif %}
|
||||||
|
|
|
@ -166,7 +166,7 @@
|
||||||
|
|
||||||
{% if p.awards %}
|
{% if p.awards %}
|
||||||
{% for a in p.awards %}
|
{% for a in p.awards %}
|
||||||
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{a.title}} Award{% if a.kind != 'ghosts' %} given by @{{a.user.username}}{% endif %}" data-bs-original-title="{{a.title}} Award{% if a.kind != 'ghosts' %} given by @{{a.user.username}}{% endif %}"></i>
|
<i class="{{a.class_list}} px-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{a.title}} Award{% if a.kind != 'ghost' %} given by @{{a.user.username}}{% endif %}" data-bs-original-title="{{a.title}} Award{% if a.kind != 'ghost' %} given by @{{a.user.username}}{% endif %}"></i>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue