mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-02-03 00:31:25 -08:00
comment cleanup
This commit is contained in:
parent
25091be841
commit
f78538941b
1 changed files with 3 additions and 11 deletions
|
@ -33,7 +33,7 @@ from app.models import Community, CommunityMember, Post, Site, User, utcnow, Dom
|
|||
|
||||
@bp.route('/', methods=['HEAD', 'GET', 'POST'])
|
||||
@bp.route('/home', methods=['GET', 'POST'])
|
||||
# @bp.route('/home/<sort>', methods=['GET', 'POST'])
|
||||
@bp.route('/home/<sort>', methods=['GET', 'POST'])
|
||||
@bp.route('/home/<sort>/<view_filter>', methods=['GET', 'POST'])
|
||||
@cache.cached(make_cache_key=make_cache_key)
|
||||
def index(sort=None, view_filter=None):
|
||||
|
@ -52,7 +52,7 @@ def index(sort=None, view_filter=None):
|
|||
|
||||
|
||||
@bp.route('/popular', methods=['GET'])
|
||||
# @bp.route('/popular/<sort>', methods=['GET'])
|
||||
@bp.route('/popular/<sort>', methods=['GET'])
|
||||
@bp.route('/popular/<sort>/<view_filter>', methods=['GET', 'POST'])
|
||||
@cache.cached(timeout=5, make_cache_key=make_cache_key)
|
||||
def popular(sort=None, view_filter=None):
|
||||
|
@ -67,7 +67,7 @@ def popular(sort=None, view_filter=None):
|
|||
|
||||
|
||||
@bp.route('/all', methods=['GET'])
|
||||
# @bp.route('/all/<sort>', methods=['GET'])
|
||||
@bp.route('/all/<sort>', methods=['GET'])
|
||||
@bp.route('/all/<sort>/<view_filter>', methods=['GET', 'POST'])
|
||||
@cache.cached(timeout=5, make_cache_key=make_cache_key)
|
||||
def all_posts(sort=None, view_filter=None):
|
||||
|
@ -100,12 +100,6 @@ def home_page(type, sort, view_filter):
|
|||
|
||||
if current_user.is_anonymous:
|
||||
flash(_('Create an account to tailor this feed to your interests.'))
|
||||
# view filter
|
||||
# anon can only filter to local/all
|
||||
# if view_filter == 'local':
|
||||
# posts = Post.query.filter(Post.from_bot == False, Post.nsfw == False, Post.nsfl == False, Post.deleted == False, Post.instance_id == 1)
|
||||
# else:
|
||||
# posts = Post.query.filter(Post.from_bot == False, Post.nsfw == False, Post.nsfl == False, Post.deleted == False)
|
||||
posts = Post.query.filter(Post.from_bot == False, Post.nsfw == False, Post.nsfl == False, Post.deleted == False)
|
||||
posts = posts.join(Community, Community.id == Post.community_id)
|
||||
if type == 'home':
|
||||
|
@ -168,8 +162,6 @@ def home_page(type, sort, view_filter):
|
|||
elif sort == 'active':
|
||||
posts = posts.order_by(desc(Post.last_active))
|
||||
|
||||
# flash(_(f'posts: {posts}'))
|
||||
|
||||
# Pagination
|
||||
posts = posts.paginate(page=page, per_page=100 if current_user.is_authenticated and not low_bandwidth else 50, error_out=False)
|
||||
if type == 'home':
|
||||
|
|
Loading…
Add table
Reference in a new issue