rename truecoins -> truescore (#544)
This commit is contained in:
parent
64880c87fa
commit
46714fd520
9 changed files with 53 additions and 27 deletions
|
@ -631,7 +631,7 @@ def loggedin_list(v):
|
|||
ids = [x for x, val in cache.get(f'{SITE}_loggedin').items() \
|
||||
if (time.time() - val) < LOGGEDIN_ACTIVE_TIME]
|
||||
users = g.db.query(User).filter(User.id.in_(ids)) \
|
||||
.order_by(User.admin_level.desc(), User.truecoins.desc()).all()
|
||||
.order_by(User.admin_level.desc(), User.truescore.desc()).all()
|
||||
return render_template("admin/loggedin.html", v=v, users=users)
|
||||
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ def api_comment(v):
|
|||
|
||||
abort(403, "Too much spam!")
|
||||
|
||||
is_filtered = v.should_comments_be_filtered()
|
||||
is_filtered = v.should_comments_be_filtered
|
||||
|
||||
c = Comment(author_id=v.id,
|
||||
parent_submission=parent_post.id,
|
||||
|
|
|
@ -199,9 +199,9 @@ def patrons(v):
|
|||
@auth_desired
|
||||
def admins(v):
|
||||
if v and v.admin_level >= 3:
|
||||
admins = g.db.query(User).filter(User.admin_level>1).order_by(User.truecoins.desc()).all()
|
||||
admins += g.db.query(User).filter(User.admin_level==1).order_by(User.truecoins.desc()).all()
|
||||
else: admins = g.db.query(User).filter(User.admin_level>0).order_by(User.truecoins.desc()).all()
|
||||
admins = g.db.query(User).filter(User.admin_level>1).order_by(User.truescore.desc()).all()
|
||||
admins += g.db.query(User).filter(User.admin_level==1).order_by(User.truescore.desc()).all()
|
||||
else: admins = g.db.query(User).filter(User.admin_level>0).order_by(User.truescore.desc()).all()
|
||||
return render_template("admins.html", v=v, admins=admins)
|
||||
|
||||
|
||||
|
|
|
@ -377,7 +377,7 @@ def leaderboard(v:User):
|
|||
comments = SimpleLeaderboard(v, LeaderboardMeta("Comments", "comment count", "comments", "Comments", "comments"), g.db, users, User.comment_count)
|
||||
received_awards = SimpleLeaderboard(v, LeaderboardMeta("Awards", "received awards", "awards", "Awards", None), g.db, users, User.received_award_count)
|
||||
coins_spent = SimpleLeaderboard(v, LeaderboardMeta("Spent in shop", "coins spent in shop", "spent", "Coins", None), g.db, users, User.coins_spent)
|
||||
truescore = SimpleLeaderboard(v, LeaderboardMeta("Truescore", "truescore", "truescore", "Truescore", None), g.db, users, User.truecoins)
|
||||
truescore = SimpleLeaderboard(v, LeaderboardMeta("Truescore", "truescore", "truescore", "Truescore", None), g.db, users, User.truescore)
|
||||
badges = BadgeMarseyLeaderboard(v, LeaderboardMeta("Badges", "badges", "badges", "Badges", None), g.db, Badge.user_id)
|
||||
blocks = UserBlockLeaderboard(v, LeaderboardMeta("Blocked", "most blocked", "blocked", "Blocked By", "blockers"), g.db, UserBlock.target_id)
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ def api_vote_post(post_id, new, v):
|
|||
# remove the old score data
|
||||
if points_matter:
|
||||
post.author.coins -= vote.vote_type
|
||||
post.author.truecoins -= vote.vote_type
|
||||
post.author.truescore -= vote.vote_type
|
||||
# we'll be saving later anyway, so don't bother doing so here
|
||||
else:
|
||||
# create new vote data
|
||||
|
@ -105,7 +105,7 @@ def api_vote_post(post_id, new, v):
|
|||
# add relevant points
|
||||
if points_matter:
|
||||
post.author.coins += vote.vote_type
|
||||
post.author.truecoins += vote.vote_type
|
||||
post.author.truescore += vote.vote_type
|
||||
|
||||
# database it up
|
||||
g.db.add(post.author)
|
||||
|
@ -151,7 +151,7 @@ def api_vote_comment(comment_id, new, v):
|
|||
# remove the old score data
|
||||
if points_matter:
|
||||
comment.author.coins -= vote.vote_type
|
||||
comment.author.truecoins -= vote.vote_type
|
||||
comment.author.truescore -= vote.vote_type
|
||||
# we'll be saving later anyway, so don't bother doing so here
|
||||
else:
|
||||
# create new vote data
|
||||
|
@ -173,7 +173,7 @@ def api_vote_comment(comment_id, new, v):
|
|||
# add relevant points
|
||||
if points_matter:
|
||||
comment.author.coins += vote.vote_type
|
||||
comment.author.truecoins += vote.vote_type
|
||||
comment.author.truescore += vote.vote_type
|
||||
|
||||
# database it up
|
||||
g.db.add(comment.author)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue