forked from rDrama/rDrama
dfsfsd
parent
63cea44693
commit
483568363e
|
@ -432,19 +432,19 @@
|
||||||
{% if v and request.path.startswith('/@') and v.admin_level == 0 %}
|
{% 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 %}
|
{% 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 %}
|
{% elif v %}
|
||||||
<li id="comment-mobile-{{c.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('comment-mobile', '{{c.id}}', '1')" 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 %}"></li>
|
<li id="comment-mobile-{{c.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('comment-mobile', '{{c.id}}', '1')" class="list-inline-item arrow-up upvote-button d-inline-block d-md-none mx-0 pr-1 comment-{{c.id}}-up {% if voted==1 %}active{% endif %}"></li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li id="comment-{{c.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('comment', '{{c.id}}', '1')" class="list-inline-item arrow-up d-inline-block d-md-none mr-2" onclick="location.href='/login';"></li>
|
<li id="comment-{{c.id}}-up" tabindex="0" href="javascript:void(0)" onclick="vote('comment', '{{c.id}}', '1')" class="list-inline-item arrow-up d-inline-block d-md-none mx-0 pr-1" onclick="location.href='/login';"></li>
|
||||||
{% endif %}
|
{% 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" title="" data-bs-original-title="+{{ups}} | -{{downs}}"><span id="comment-mobile-score-{{c.id}}" class="score comment-score-{{c.id}} {% if voted==1 %}score-up{% elif voted==-1%}score-down{% endif %}">{{score}}</span></span></li>
|
<li class="list-inline-item d-inline-block d-md-none mx-0"><span class="points" data-bs-toggle="tooltip" data-bs-placement="top" title="" data-bs-original-title="+{{ups}} | -{{downs}}"><span id="comment-mobile-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 %}
|
{% if v and request.path.startswith('/@') and v.admin_level == 0 %}
|
||||||
{% if voted==-1 %}
|
{% if voted==-1 %}
|
||||||
<li class="list-inline-item arrow-down d-inline-block d-md-none mr-2 comment-{{c.id}}-up active"></li>
|
<li class="list-inline-item arrow-down d-inline-block d-md-none mr-2 comment-{{c.id}}-up active"></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% elif v %}
|
{% elif v %}
|
||||||
<li {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-mobile-{{c.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('comment-mobile', '{{c.id}}', '-1')" 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 %}"></li>
|
<li {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-mobile-{{c.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('comment-mobile', '{{c.id}}', '-1')" class="list-inline-item arrow-down downvote-button d-inline-block d-md-none mx-0 pl-1 comment-{{c.id}}-down {% if voted==-1 %}active{% endif %}"></li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-{{c.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('comment', '{{c.id}}', '-1')" class="list-inline-item arrow-down d-inline-block d-md-none" onclick="location.href='/login';"></li>
|
<li {% if environ.get('DISABLE_DOWNVOTES') == '1' %}style="display:None!important"{% endif %} id="comment-{{c.id}}-down" tabindex="0" href="javascript:void(0)" onclick="vote('comment', '{{c.id}}', '-1')" class="list-inline-item arrow-down mx-0 pl-1 d-inline-block d-md-none" onclick="location.href='/login';"></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -728,10 +728,12 @@
|
||||||
showNewCommentCounts('{{p.id}}', {{p.comment_count}})
|
showNewCommentCounts('{{p.id}}', {{p.comment_count}})
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if "?context" not in request.full_path %}
|
||||||
const comments = JSON.parse(localStorage.getItem("comment-counts")) || {}
|
const comments = JSON.parse(localStorage.getItem("comment-counts")) || {}
|
||||||
const newTotal = {{p.comment_count}} || ((comments['{{p.id}}'] || { c: 0 }).c + 1)
|
const newTotal = {{p.comment_count}} || ((comments['{{p.id}}'] || { c: 0 }).c + 1)
|
||||||
comments['{{p.id}}'] = { c: newTotal, t: Date.now() }
|
comments['{{p.id}}'] = { c: newTotal, t: Date.now() }
|
||||||
window.localStorage.setItem("comment-counts", JSON.stringify(comments))
|
window.localStorage.setItem("comment-counts", JSON.stringify(comments))
|
||||||
|
{% endif %}
|
||||||
})()
|
})()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,10 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
(() => {
|
(() => {
|
||||||
const date = new Date('{{p.created_datetime}}');
|
const date = new Date({{p.created_utc*1000}});
|
||||||
document.getElementById('timestamp-{{p.id}}').title = date.toString();
|
document.getElementById('timestamp-{{p.id}}').title = date.toString();
|
||||||
{% if p.edited_utc %}
|
{% if p.edited_utc %}
|
||||||
const dateEdited = new Date('{{p.edited_datetime}}');
|
const dateEdited = new Date({{p.edited_utc*1000}});
|
||||||
document.getElementById('edited_timestamp-{{p.id}}').title = dateEdited.toString();
|
document.getElementById('edited_timestamp-{{p.id}}').title = dateEdited.toString();
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue