forked from MarseyWorld/MarseyWorld
remove "warm" sorting
parent
b2de11cb1a
commit
5fb6bd86f9
|
@ -120,7 +120,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
||||||
if request.host == 'rdrama.net': num = 5
|
if request.host == 'rdrama.net': num = 5
|
||||||
else: num = 0.5
|
else: num = 0.5
|
||||||
|
|
||||||
if sort in ("hot","warm"):
|
if sort == 'hot':
|
||||||
ti = int(time.time()) + 3600
|
ti = int(time.time()) + 3600
|
||||||
if SITE == 'watchpeopledie.co':
|
if SITE == 'watchpeopledie.co':
|
||||||
posts = posts.order_by(-1000000*(Submission.upvotes - Submission.downvotes + 1 + Submission.comment_count/num)/(func.power(((ti - Submission.created_utc)/1000), 1.23)), Submission.created_utc.desc())
|
posts = posts.order_by(-1000000*(Submission.upvotes - Submission.downvotes + 1 + Submission.comment_count/num)/(func.power(((ti - Submission.created_utc)/1000), 1.23)), Submission.created_utc.desc())
|
||||||
|
|
|
@ -237,7 +237,7 @@ def settings_profile_post(v):
|
||||||
|
|
||||||
defaultsorting = request.values.get("defaultsorting")
|
defaultsorting = request.values.get("defaultsorting")
|
||||||
if defaultsorting:
|
if defaultsorting:
|
||||||
if defaultsorting in {"hot", "warm", "bump", "new", "old", "comments", "controversial", "top", "bottom"}:
|
if defaultsorting in {"hot", "bump", "new", "old", "comments", "controversial", "top", "bottom"}:
|
||||||
v.defaultsorting = defaultsorting
|
v.defaultsorting = defaultsorting
|
||||||
updated = True
|
updated = True
|
||||||
else: abort(400)
|
else: abort(400)
|
||||||
|
|
|
@ -78,7 +78,6 @@
|
||||||
<div class="dropdown dropdown-actions ml-2">
|
<div class="dropdown dropdown-actions ml-2">
|
||||||
<button class="btn btn-secondary dropdown-toggle smol-fp" type="button" id="dropdownMenuButton2" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button class="btn btn-secondary dropdown-toggle smol-fp" type="button" id="dropdownMenuButton2" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
{% if sort=="hot" %}<i class="fas fa-fire mr-2 "></i>{% endif %}
|
{% if sort=="hot" %}<i class="fas fa-fire mr-2 "></i>{% endif %}
|
||||||
{% if sort=="warm" %}<i class="fas fa-fire mr-2 "></i>{% endif %}
|
|
||||||
{% if sort=="bump" %}<i class="fas fa-arrow-up mr-2 "></i>{% endif %}
|
{% if sort=="bump" %}<i class="fas fa-arrow-up mr-2 "></i>{% endif %}
|
||||||
{% if sort=="top" %}<i class="fas fa-arrow-alt-circle-up mr-2 "></i>{% endif %}
|
{% if sort=="top" %}<i class="fas fa-arrow-alt-circle-up mr-2 "></i>{% endif %}
|
||||||
{% if sort=="bottom" %}<i class="fas fa-arrow-alt-circle-down mr-2 "></i>{% endif %}
|
{% if sort=="bottom" %}<i class="fas fa-arrow-alt-circle-down mr-2 "></i>{% endif %}
|
||||||
|
@ -90,7 +89,6 @@
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu smol-fp" aria-labelledby="dropdownMenuButton2" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
|
<div class="dropdown-menu smol-fp" aria-labelledby="dropdownMenuButton2" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px;">
|
||||||
{% if sort != "hot" %}<a class="dropdown-item" href="?sort=hot&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-fire mr-2 "></i>Hot</a>{% endif %}
|
{% if sort != "hot" %}<a class="dropdown-item" href="?sort=hot&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-fire mr-2 "></i>Hot</a>{% endif %}
|
||||||
{% if sort != "warm" %}<a class="dropdown-item" href="?sort=warm&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-fire mr-2 "></i>Warm</a>{% endif %}
|
|
||||||
{% if sort != "bump" %}<a class="dropdown-item" href="?sort=bump&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-arrow-up mr-2 "></i>Bump</a>{% endif %}
|
{% if sort != "bump" %}<a class="dropdown-item" href="?sort=bump&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-arrow-up mr-2 "></i>Bump</a>{% endif %}
|
||||||
{% if sort != "top" %}<a class="dropdown-item" href="?sort=top&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-arrow-alt-circle-up mr-2 "></i>Top</a>{% endif %}
|
{% if sort != "top" %}<a class="dropdown-item" href="?sort=top&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-arrow-alt-circle-up mr-2 "></i>Top</a>{% endif %}
|
||||||
{% if sort != "bottom" %}<a class="dropdown-item" href="?sort=bottom&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-arrow-alt-circle-down mr-2 "></i>Bottom</a>{% endif %}
|
{% if sort != "bottom" %}<a class="dropdown-item" href="?sort=bottom&t={{t}}&ccmode={{ccmode}}"><i class="fas fa-arrow-alt-circle-down mr-2 "></i>Bottom</a>{% endif %}
|
||||||
|
|
|
@ -90,7 +90,7 @@
|
||||||
<p>Change the default sorting for posts.</p>
|
<p>Change the default sorting for posts.</p>
|
||||||
<div class="input-group mb2">
|
<div class="input-group mb2">
|
||||||
<select autocomplete="off" id='defaultsorting' class="form-control" form="profile-settings" name="defaultsorting" onchange="post_toast(this,'/settings/profile?defaultsorting='+document.getElementById('defaultsorting').value)">
|
<select autocomplete="off" id='defaultsorting' class="form-control" form="profile-settings" name="defaultsorting" onchange="post_toast(this,'/settings/profile?defaultsorting='+document.getElementById('defaultsorting').value)">
|
||||||
{% for entry in ["hot", "warm", "bump", "new", "old", "top", "bottom", "controversial", "comments"] %}
|
{% for entry in ["hot", "bump", "new", "old", "top", "bottom", "controversial", "comments"] %}
|
||||||
<option value="{{entry}}"{{' selected' if v.defaultsorting==entry}}>{{entry}}</option>
|
<option value="{{entry}}"{{' selected' if v.defaultsorting==entry}}>{{entry}}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue