sdfsdf
This commit is contained in:
parent
db976ffd40
commit
c98cae4fd8
6 changed files with 26 additions and 27 deletions
|
@ -352,7 +352,6 @@ def get_post_title(v):
|
|||
url = request.values.get("url", None)
|
||||
if not url: return abort(400)
|
||||
|
||||
#mimic chrome browser agent
|
||||
headers = {"User-Agent": f"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36"}
|
||||
try: x = requests.get(url, headers=headers, timeout=5)
|
||||
except BaseException: return {"error": "Could not reach page"}, 400
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<script src="/assets/js/award_modal.js"></script>
|
||||
<script src="/assets/js/award_modal2.js"></script>
|
||||
|
||||
<div class="modal fade" id="awardModal" tabindex="-1" role="dialog" aria-labelledby="awardModalTitle" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-dialog-centered" role="document">
|
||||
|
|
|
@ -295,10 +295,10 @@
|
|||
{% endif %}
|
||||
{% elif v %}
|
||||
|
||||
<li id="comment-{{c.id}}-up" tabindex="0" class="list-inline-item arrow-up upvote-button d-none d-md-inline-block mr-2 comment-{{c.id}}-up {% if voted==1 %}active{% endif %}" data-bs-id-up="{{c.id}}" data-bs-content-type="comment"></li>
|
||||
<a id="comment-{{c.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('1', 'comment-{{c.id}}-up', 'comment-{{c.id}}-down', 'comment-score-{{c.id}}')" class="list-inline-item arrow-up upvote-button d-none d-md-inline-block mr-2 comment-{{c.id}}-up {% if voted==1 %}active{% endif %}"></a>
|
||||
|
||||
{% else %}
|
||||
<li id="comment-{{c.id}}-up" tabindex="0" class="list-inline-item arrow-up d-none d-md-inline-block mr-2" onclick="location.href='/login';"></li>
|
||||
<a id="comment-{{c.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('1', 'comment-{{c.id}}-up', 'comment-{{c.id}}-down', 'comment-score-{{c.id}}')" class="list-inline-item arrow-up d-none d-md-inline-block mr-2" onclick="location.href='/login';"></a>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
@ -311,11 +311,11 @@
|
|||
<li class="list-inline-item arrow-down d-none d-md-inline-block mr-2 comment-{{c.id}}-down active"></li>
|
||||
{% endif %}
|
||||
{% elif v %}
|
||||
<li {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-{{c.id}}-down" tabindex="0" class="list-inline-item arrow-down downvote-button d-none d-md-inline-block mr-2 comment-{{c.id}}-down {% if voted==-1 %}active{% endif %}" data-bs-id-down="{{c.id}}" data-bs-content-type="comment"></li>
|
||||
<a {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-{{c.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('-1', 'comment-{{c.id}}-up', 'comment-{{c.id}}-down', 'comment-score-{{c.id}}')" class="list-inline-item arrow-down downvote-button d-none d-md-inline-block mr-2 comment-{{c.id}}-down {% if voted==-1 %}active{% endif %}"></a>
|
||||
|
||||
{% else %}
|
||||
|
||||
<li {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-{{c.id}}-down" tabindex="0" class="list-inline-item arrow-down d-none d-md-inline-block" onclick="location.href='/login';"></li>
|
||||
<a {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-{{c.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('-1', 'comment-{{c.id}}-up', 'comment-{{c.id}}-down', 'comment-score-{{c.id}}')" class="list-inline-item arrow-down d-none d-md-inline-block" onclick="location.href='/login';"></a>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
@ -396,9 +396,9 @@
|
|||
{% if v and request.path.startswith('/@') and v.admin_level == 0 %}
|
||||
{% if voted==1 %}<li class="list-inline-item arrow-up d-inline-block d-md-none mr-2 comment-{{c.id}}-up active"></li>{% endif %}
|
||||
{% elif v %}
|
||||
<li id="comment-{{c.id}}-up" tabindex="0" class="list-inline-item arrow-up upvote-button d-inline-block d-md-none mr-2 comment-{{c.id}}-up {% if voted==1 %}active{% endif %}" data-bs-id-up="{{c.id}}" data-bs-content-type="comment"></li>
|
||||
<a id="comment-{{c.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('1', 'comment-{{c.id}}-up', 'comment-{{c.id}}-down', 'comment-score-{{c.id}}')" class="list-inline-item arrow-up upvote-button d-inline-block d-md-none mr-2 comment-{{c.id}}-up {% if voted==1 %}active{% endif %}"></a>
|
||||
{% else %}
|
||||
<li id="comment-{{c.id}}-up" tabindex="0" class="list-inline-item arrow-up d-inline-block d-md-none mr-2" onclick="location.href='/login';"></li>
|
||||
<a id="comment-{{c.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('1', 'comment-{{c.id}}-up', 'comment-{{c.id}}-down', 'comment-score-{{c.id}}')" class="list-inline-item arrow-up d-inline-block d-md-none mr-2" onclick="location.href='/login';"></a>
|
||||
{% endif %}
|
||||
<li class="list-inline-item d-inline-block d-md-none mr-2"><span class="points" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="+{{ups}} | -{{downs}}"><span id="comment-score-{{c.id}}" class="score comment-score-{{c.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}">{{score}}</span></span></li>
|
||||
{% if v and request.path.startswith('/@') and v.admin_level == 0 %}
|
||||
|
@ -406,9 +406,9 @@
|
|||
<li class="list-inline-item arrow-down d-inline-block d-md-none mr-2 comment-{{c.id}}-up active"></li>
|
||||
{% endif %}
|
||||
{% elif v %}
|
||||
<li {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-{{c.id}}-down" tabindex="0" class="list-inline-item arrow-down downvote-button d-inline-block d-md-none mr-2 comment-{{c.id}}-down {% if voted==-1 %}active{% endif %}" data-bs-id-down="{{c.id}}" data-bs-content-type="comment"></li>
|
||||
<a {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-{{c.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('-1', 'comment-{{c.id}}-up', 'comment-{{c.id}}-down', 'comment-score-{{c.id}}')" class="list-inline-item arrow-down downvote-button d-inline-block d-md-none mr-2 comment-{{c.id}}-down {% if voted==-1 %}active{% endif %}"></a>
|
||||
{% else %}
|
||||
<li {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-{{c.id}}-down" tabindex="0" class="list-inline-item arrow-down d-inline-block d-md-none" onclick="location.href='/login';"></li>
|
||||
<a {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-{{c.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('-1', 'comment-{{c.id}}-up', 'comment-{{c.id}}-down', 'comment-score-{{c.id}}')" class="list-inline-item arrow-down d-inline-block d-md-none" onclick="location.href='/login';"></a>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -496,19 +496,19 @@
|
|||
{% if v %}
|
||||
|
||||
<div id="voting" class="voting d-none d-md-block mb-auto">
|
||||
<div id="post-{{p.id}}-up" tabindex="0" data-bs-id-up="{{p.id}}" data-bs-content-type="post" class="mx-auto arrow-up upvote-button post-{{p.id}}-up {% if voted==1 %}active{% endif %}"></div>
|
||||
<div id="post-{{p.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('1', 'post-{{p.id}}-up', 'post-{{p.id}}-down', 'post-score-{{p.id}}')">
|
||||
|
||||
<span id="post-score-{{p.id}}" class="score post-score-{{p.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-original-title="+{{ups}} | -{{downs}}">{{score}}</span>
|
||||
<div {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down" tabindex="0" data-bs-id-down="{{p.id}}" data-bs-content-type="post" class="text-muted mx-auto arrow-down downvote-button post-{{p.id}}-down {% if voted==-1 %}active{% endif %}"></div>
|
||||
<div {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('-1', 'post-{{p.id}}-up', 'post-{{p.id}}-down', 'post-score-{{p.id}}')">
|
||||
</div>
|
||||
|
||||
{% else %}
|
||||
|
||||
<div id="voting" class="voting d-none d-md-block mb-auto">
|
||||
<div id="post-{{p.id}}-up" tabindex="0" class="arrow-up mx-auto" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
|
||||
<div id="post-{{p.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('1', 'post-{{p.id}}-up', 'post-{{p.id}}-down', 'post-score-{{p.id}}')" class="arrow-up mx-auto" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
|
||||
</div>
|
||||
<span id="post-{{p.id}}-score-none" class="score text-muted"{% if not p.is_banned %} data-bs-toggle="tooltip" data-bs-placement="right" data-bs-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
|
||||
<div {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down" tabindex="0" class="arrow-down mx-auto" onclick="location.href='/login?redirect={{request.path | urlencode}}';"></div>
|
||||
<div {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('-1', 'post-{{p.id}}-up', 'post-{{p.id}}-down', 'post-score-{{p.id}}')" class="arrow-down mx-auto" onclick="location.href='/login?redirect={{request.path | urlencode}}';"></div>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
@ -554,10 +554,10 @@
|
|||
{% endif %}
|
||||
<li id="voting-{{p.id}}-mobile" class="voting list-inline-item d-md-none{% if voted==1 %} upvoted{% elif voted==-1 %} downvoted{% endif %}">
|
||||
{% if v %}
|
||||
<span id="post-{{p.id}}-up-mobile" tabindex="0" data-bs-id-up="{{p.id}}" data-bs-content-type="post" class="mr-2 arrow-up upvote-button post-{{p.id}}-up {% if voted==1 %}active{% endif %}">
|
||||
<span id="post-{{p.id}}-up-mobile" tabindex="0">
|
||||
</span>
|
||||
{% else %}
|
||||
<span id="arrow-{{p.id}}-mobile-up" tabindex="0" class="mr-2 arrow-mobile-up" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
|
||||
<span id="arrow-{{p.id}}-mobile-up" tabindex="0" href="javascript:void(0)" onclick="vote('1', 'arrow-{{p.id}}-mobile-up', 'arrow-{{p.id}}-mobile-down', 'post-score-{{p.id}}-mobile') class="mr-2 arrow-mobile-up" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
|
||||
<i class="fas fa-arrow-alt-up mx-0" aria-hidden="true"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
@ -565,9 +565,9 @@
|
|||
<span id="post-score-{{p.id}}" class="score post-score-{{p.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="+{{ups}} | -{{downs}}">{{score}}</span>
|
||||
|
||||
{% if v %}
|
||||
<span {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down-mobile" tabindex="0" data-bs-id-down="{{p.id}}" data-bs-content-type="post" class="ml-2 my-0 arrow-down downvote-button post-{{p.id}}-down {% if voted==-1 %}active{% endif %}"></span>
|
||||
<span {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down-mobile" tabindex="0">
|
||||
{% else %}
|
||||
<span {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="arrow-{{p.id}}-mobile-down" tabindex="0" class="arrow-mobile-down ml-2 my-0" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
|
||||
<span {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="arrow-{{p.id}}-mobile-down" tabindex="0" href="javascript:void(0)" onclick="vote('-1', 'arrow-{{p.id}}-mobile-up', 'arrow-{{p.id}}-mobile-down', 'post-score-{{p.id}}-mobile') class="arrow-mobile-down ml-2 my-0" onclick="location.href='/login?redirect={{request.path | urlencode}}';">
|
||||
<i class="fas fa-arrow-alt-down mx-0" aria-hidden="true"></i>
|
||||
</span>
|
||||
{% endif %}
|
||||
|
|
|
@ -70,19 +70,19 @@
|
|||
|
||||
{% elif v %}
|
||||
|
||||
<div id="post-{{p.id}}-up" tabindex="0" data-bs-id-up="{{p.id}}" data-bs-content-type="post" class="mx-auto arrow-up upvote-button post-{{p.id}}-up {% if voted==1 %}active{% endif %}"></div>
|
||||
<div id="post-{{p.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('1', 'post-{{p.id}}-up', 'post-{{p.id}}-down', 'post-score-{{p.id}}')">
|
||||
|
||||
<span id="post-score-{{p.id}}" class="score post-score-{{p.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}"{% if not p.is_banned %} data-bs-toggle="tooltip" data-bs-placement="right" data-bs-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
|
||||
|
||||
<div {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down" tabindex="0" data-bs-id-down="{{p.id}}" data-bs-content-type="post" class="text-muted mx-auto arrow-down downvote-button post-{{p.id}}-down {% if voted==-1 %}active{% endif %}"></div>
|
||||
<div {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('-1', 'post-{{p.id}}-up', 'post-{{p.id}}-down', 'post-score-{{p.id}}')">
|
||||
|
||||
{% else %}
|
||||
|
||||
<div id="post-{{p.id}}-up" tabindex="0" class="mx-auto arrow-up" onclick="location.href='/login';"></div>
|
||||
<div id="post-{{p.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('1', 'post-{{p.id}}-up', 'post-{{p.id}}-down', 'post-score-{{p.id}}')" class="mx-auto arrow-up" onclick="location.href='/login';"></div>
|
||||
|
||||
<span id="post-{{p.id}}-score-none" class="score"{% if not p.is_banned %} data-bs-toggle="tooltip" data-bs-placement="right" data-bs-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
|
||||
|
||||
<div {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down" tabindex="0" class="text-muted mx-auto arrow-down" onclick="location.href='/login';"></div>
|
||||
<div {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('-1', 'post-{{p.id}}-up', 'post-{{p.id}}-down', 'post-score-{{p.id}}')" class="text-muted mx-auto arrow-down" onclick="location.href='/login';"></div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
@ -289,24 +289,24 @@
|
|||
{% elif v %}
|
||||
<li id="voting-{{p.id}}-mobile" class="voting list-inline-item d-md-none">
|
||||
|
||||
<span id="post-{{p.id}}-up-mobile" tabindex="0" data-bs-id-up="{{p.id}}" data-bs-content-type="post" class="mr-2 arrow-up upvote-button post-{{p.id}}-up {% if voted==1 %}active{% endif %}">
|
||||
<span id="post-{{p.id}}-up-mobile" tabindex="0">
|
||||
</span>
|
||||
|
||||
<span id="post-score-{{p.id}}-mobile" class="score post-score-{{p.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}"{% if not p.is_banned %} data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
|
||||
|
||||
<span {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down-mobile" tabindex="0" data-bs-id-down="{{p.id}}" data-bs-content-type="post" class="ml-2 my-0 arrow-down downvote-button post-{{p.id}}-down {% if voted==-1 %}active{% endif %}">
|
||||
<span {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="post-{{p.id}}-down-mobile" tabindex="0">
|
||||
</span>
|
||||
|
||||
</li>
|
||||
{% else %}
|
||||
<li id="voting-{{p.id}}-mobile" class="voting list-inline-item d-md-none">
|
||||
<span id="arrow-{{p.id}}-mobile-up" tabindex="0" class="mr-2 arrow-mobile-up" onclick="location.href='/login';">
|
||||
<span id="arrow-{{p.id}}-mobile-up" tabindex="0" href="javascript:void(0)" onclick="vote('1', 'arrow-{{p.id}}-mobile-up', 'arrow-{{p.id}}-mobile-down', 'post-score-{{p.id}}-mobile')" class="mr-2 arrow-mobile-up" onclick="location.href='/login';">
|
||||
<i class="fas fa-arrow-alt-up mx-0" aria-hidden="true"></i>
|
||||
</span>
|
||||
</span>"
|
||||
|
||||
<span id="post-score-{{p.id}}-mobile" class="score"{% if not p.is_banned %} data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="+{{ups}} | -{{downs}}"{% endif %}>{{score}}</span>
|
||||
|
||||
<span id="arrow-{{p.id}}-mobile-down" tabindex="0" class="arrow-mobile-down ml-2 my-0" onclick="location.href='/login';">
|
||||
<span id="arrow-{{p.id}}-mobile-down" tabindex="0" href="javascript:void(0)" onclick="vote('-1', 'arrow-{{p.id}}-mobile-up', 'arrow-{{p.id}}-mobile-down', 'post-score-{{p.id}}-mobile') class="arrow-mobile-down ml-2 my-0" onclick="location.href='/login';">
|
||||
<i class="fas fa-arrow-alt-down mx-0" aria-hidden="true"></i>
|
||||
</span>
|
||||
</li>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue