forked from rDrama/rDrama
master
parent
b2ed0fa5fe
commit
19d85aaeb5
|
@ -8,6 +8,9 @@ from files.helpers.const import SLURS
|
||||||
from files.__main__ import Base
|
from files.__main__ import Base
|
||||||
from .mix_ins import *
|
from .mix_ins import *
|
||||||
from .flags import CommentFlag
|
from .flags import CommentFlag
|
||||||
|
from os import environ
|
||||||
|
|
||||||
|
site = environ.get("DOMAIN").strip()
|
||||||
|
|
||||||
class CommentAux(Base):
|
class CommentAux(Base):
|
||||||
|
|
||||||
|
@ -139,6 +142,11 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing):
|
||||||
if not r and r != []: r = sorted([x for x in self.child_comments], key=lambda x: x.score, reverse=True)
|
if not r and r != []: r = sorted([x for x in self.child_comments], key=lambda x: x.score, reverse=True)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
|
@property
|
||||||
|
@lazy
|
||||||
|
def shortlink(self):
|
||||||
|
return f"https://{site}/comment/{self.id}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def permalink(self):
|
def permalink(self):
|
||||||
|
|
|
@ -119,7 +119,12 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
|
||||||
@lazy
|
@lazy
|
||||||
def fullname(self):
|
def fullname(self):
|
||||||
return f"t2_{self.id}"
|
return f"t2_{self.id}"
|
||||||
|
|
||||||
|
@property
|
||||||
|
@lazy
|
||||||
|
def shortlink(self):
|
||||||
|
return f"https://{site}/post/{self.id}"
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def permalink(self):
|
def permalink(self):
|
||||||
|
|
|
@ -333,7 +333,7 @@
|
||||||
|
|
||||||
{% if v and v.admin_level==6 and v.id != c.author_id %}
|
{% if v and v.admin_level==6 and v.id != c.author_id %}
|
||||||
<li id="unban-{{c.id}}" class="list-inline-item d-none {% if c.author.is_suspended %}d-md-inline-block{% endif %}"><a class="text-success" id="unexile-comment-{{c.id}}" href="javascript:void(0)" onclick="post_toast3('/unban_user/{{c.author_id}}','ban-{{c.id}}','unban-{{c.id}}')"><i class="fas fa-user-slash text-success fa-fw"></i>Unban user</a></li>
|
<li id="unban-{{c.id}}" class="list-inline-item d-none {% if c.author.is_suspended %}d-md-inline-block{% endif %}"><a class="text-success" id="unexile-comment-{{c.id}}" href="javascript:void(0)" onclick="post_toast3('/unban_user/{{c.author_id}}','ban-{{c.id}}','unban-{{c.id}}')"><i class="fas fa-user-slash text-success fa-fw"></i>Unban user</a></li>
|
||||||
<li id="ban-{{c.id}}" class="list-inline-item d-none {% if not c.author.is_suspended %}d-md-inline-block{% endif %}"><a class="text-danger" id="exile-comment-{{c.id}}" href="javascript:void(0)" onclick="post_toast3('/ban_user/{{c.author_id}}?reason={{c.permalink}}','ban-{{c.id}}','unban-{{c.id}}')"><i class="fas fa-user-slash text-danger fa-fw"></i>Ban user</a></li>
|
<li id="ban-{{c.id}}" class="list-inline-item d-none {% if not c.author.is_suspended %}d-md-inline-block{% endif %}"><a class="text-danger" id="exile-comment-{{c.id}}" href="javascript:void(0)" onclick="post_toast3('/ban_user/{{c.author_id}}?reason={{c.shortlink}}','ban-{{c.id}}','unban-{{c.id}}')"><i class="fas fa-user-slash text-danger fa-fw"></i>Ban user</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if v and v.admin_level >=4 and c.oauth_app %}
|
{% if v and v.admin_level >=4 and c.oauth_app %}
|
||||||
|
@ -490,7 +490,7 @@
|
||||||
|
|
||||||
{% if v and (c.post and v.admin_level == 6) %}
|
{% if v and (c.post and v.admin_level == 6) %}
|
||||||
{% if c.author_id != v.id %}
|
{% if c.author_id != v.id %}
|
||||||
<li id="ban2-{{c.id}}" class="{% if c.author.is_suspended %}d-none{% endif %} list-group-item"><a class="text-danger d-block" id="exile-comment2-{{c.id}}" href="javascript:void(0)" onclick="post_toast2('/ban_user/{{c.author_id}}?reason={{c.permalink}}','ban2-{{c.id}}','unban2-{{c.id}}')" data-dismiss="modal"><i class="fas fa-user-minus fa-fw text-danger"></i>Ban user</a></li>
|
<li id="ban2-{{c.id}}" class="{% if c.author.is_suspended %}d-none{% endif %} list-group-item"><a class="text-danger d-block" id="exile-comment2-{{c.id}}" href="javascript:void(0)" onclick="post_toast2('/ban_user/{{c.author_id}}?reason={{c.shortlink}}','ban2-{{c.id}}','unban2-{{c.id}}')" data-dismiss="modal"><i class="fas fa-user-minus fa-fw text-danger"></i>Ban user</a></li>
|
||||||
<li id="unban2-{{c.id}}" class="{% if not c.author.is_suspended %}d-none{% endif %} list-group-item"><a class="text-success d-block" id="unexile-comment2-{{c.id}}" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{c.author_id}}','ban2-{{c.id}}','unban2-{{c.id}}')" data-dismiss="modal"><i class="fas fa-user-minus fa-fw text-success"></i>Unban user</a></li>
|
<li id="unban2-{{c.id}}" class="{% if not c.author.is_suspended %}d-none{% endif %} list-group-item"><a class="text-success d-block" id="unexile-comment2-{{c.id}}" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{c.author_id}}','ban2-{{c.id}}','unban2-{{c.id}}')" data-dismiss="modal"><i class="fas fa-user-minus fa-fw text-success"></i>Unban user</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -176,7 +176,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if v and v.admin_level == 6 and v.id!=p.author_id %}
|
{% if v and v.admin_level == 6 and v.id!=p.author_id %}
|
||||||
<button id="ban2-{{p.id}}" class="{% if p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-danger text-left" href="javascript:void(0)" onclick="post_toast2('/ban_user/{{p.author_id}}?reason={{p.permalink}}','ban2-{{p.id}}','unban2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-user-minus mr-3"></i>Ban user</a></button>
|
<button id="ban2-{{p.id}}" class="{% if p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-danger text-left" href="javascript:void(0)" onclick="post_toast2('/ban_user/{{p.author_id}}?reason={{p.shortlink}}','ban2-{{p.id}}','unban2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-user-minus mr-3"></i>Ban user</a></button>
|
||||||
<button id="unban2-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-success text-left" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban2-{{p.id}}','unban2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-user-minus mr-3"></i>Unban user</a></button>
|
<button id="unban2-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-success text-left" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban2-{{p.id}}','unban2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-user-minus mr-3"></i>Unban user</a></button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -478,7 +478,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if v.admin_level >=3 and v.id!=p.author_id %}
|
{% if v.admin_level >=3 and v.id!=p.author_id %}
|
||||||
<li id="ban-{{p.id}}" class="{% if p.author.is_suspended %}d-none{% endif %} list-inline-item"><a class="text-danger" id="exile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast2('/ban_user/{{p.author_id}}?reason={{p.permalink}}','ban-{{p.id}}','unban-{{p.id}}')"><i class="fas fa-user-slash"></i>Ban user</a></li>
|
<li id="ban-{{p.id}}" class="{% if p.author.is_suspended %}d-none{% endif %} list-inline-item"><a class="text-danger" id="exile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast2('/ban_user/{{p.author_id}}?reason={{p.shortlink}}','ban-{{p.id}}','unban-{{p.id}}')"><i class="fas fa-user-slash"></i>Ban user</a></li>
|
||||||
<li id="unban-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} list-inline-item"><a class="text-danger" id="unexile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban-{{p.id}}','unban-{{p.id}}')"><i class="fas fa-user-slash"></i>Unban user</a></li>
|
<li id="unban-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} list-inline-item"><a class="text-danger" id="unexile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban-{{p.id}}','unban-{{p.id}}')"><i class="fas fa-user-slash"></i>Unban user</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -205,7 +205,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if v.admin_level >=3 and v.id!=p.author_id %}
|
{% if v.admin_level >=3 and v.id!=p.author_id %}
|
||||||
<li id="ban-{{p.id}}" class="{% if p.author.is_suspended %}d-none{% endif %} list-inline-item"><a class="text-danger" id="exile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast2('/ban_user/{{p.author_id}}?reason={{p.permalink}}','ban-{{p.id}}','unban-{{p.id}}')"><i class="fas fa-user-slash"></i>Ban user</a></li>
|
<li id="ban-{{p.id}}" class="{% if p.author.is_suspended %}d-none{% endif %} list-inline-item"><a class="text-danger" id="exile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast2('/ban_user/{{p.author_id}}?reason={{p.shortlink}}','ban-{{p.id}}','unban-{{p.id}}')"><i class="fas fa-user-slash"></i>Ban user</a></li>
|
||||||
<li id="unban-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} list-inline-item"><a class="text-danger" id="unexile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban-{{p.id}}','unban-{{p.id}}')"><i class="fas fa-user-slash"></i>Unban user</a></li>
|
<li id="unban-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} list-inline-item"><a class="text-danger" id="unexile2-user-{{p.id}}" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban-{{p.id}}','unban-{{p.id}}')"><i class="fas fa-user-slash"></i>Unban user</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -364,7 +364,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if v and v.admin_level == 6 and v.id!=p.author_id %}
|
{% if v and v.admin_level == 6 and v.id!=p.author_id %}
|
||||||
<button id="ban2-{{p.id}}" class="{% if p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-danger text-left" href="javascript:void(0)" onclick="post_toast2('/ban_user/{{p.author_id}}?reason={{p.permalink}}','ban2-{{p.id}}','unban2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-user-minus mr-3"></i>Ban user</a></button>
|
<button id="ban2-{{p.id}}" class="{% if p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-danger text-left" href="javascript:void(0)" onclick="post_toast2('/ban_user/{{p.author_id}}?reason={{p.shortlink}}','ban2-{{p.id}}','unban2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-user-minus mr-3"></i>Ban user</a></button>
|
||||||
<button id="unban2-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-success text-left" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban2-{{p.id}}','unban2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-user-minus mr-3"></i>Unban user</a></button>
|
<button id="unban2-{{p.id}}" class="{% if not p.author.is_suspended %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-success text-left" href="javascript:void(0)" onclick="post_toast2('/unban_user/{{p.author_id}}','ban2-{{p.id}}','unban2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-user-minus mr-3"></i>Unban user</a></button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue