|
|
|
@ -12,7 +12,7 @@ from suchwow import config
|
|
|
|
|
from suchwow.models import Post, Profile, Comment, Notification, db, Moderator
|
|
|
|
|
from suchwow.routes import auth, comment, post, profile, leaderboard, api
|
|
|
|
|
from suchwow.utils.decorators import login_required, moderator_required
|
|
|
|
|
from suchwow.utils.helpers import post_webhook
|
|
|
|
|
from suchwow.utils.helpers import post_webhook, get_activity
|
|
|
|
|
from suchwow.reddit import make_post
|
|
|
|
|
from suchwow.discord import post_discord_webhook
|
|
|
|
|
from suchwow import wownero, filters
|
|
|
|
@ -36,6 +36,11 @@ def index():
|
|
|
|
|
itp = 15
|
|
|
|
|
page = request.args.get("page", 1)
|
|
|
|
|
submitter = request.args.get("submitter", None)
|
|
|
|
|
content = request.args.get("content", None)
|
|
|
|
|
if content == "trending":
|
|
|
|
|
posts = get_activity()
|
|
|
|
|
return render_template("index.html", posts=posts)
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
page = int(page)
|
|
|
|
|
except:
|
|
|
|
@ -44,7 +49,7 @@ def index():
|
|
|
|
|
|
|
|
|
|
posts = Post.select().where(Post.approved==True).order_by(Post.timestamp.desc())
|
|
|
|
|
if submitter:
|
|
|
|
|
posts = posts.where(Post.submitter == submitter)
|
|
|
|
|
posts = posts.where(Post.submitter==submitter)
|
|
|
|
|
|
|
|
|
|
paginated_posts = posts.paginate(page, itp)
|
|
|
|
|
total_pages = ceil(posts.count() / itp)
|
|
|
|
|