mirror of
https://codeberg.org/rimu/pyfedi
synced 2025-01-23 19:36:56 -08:00
fix pagination next/back url_for paths
This commit is contained in:
parent
7305b6072c
commit
272e9bc860
1 changed files with 6 additions and 6 deletions
|
@ -264,8 +264,8 @@ def list_local_communities():
|
||||||
# Pagination
|
# Pagination
|
||||||
communities = communities.paginate(page=page, per_page=250 if current_user.is_authenticated and not low_bandwidth else 50,
|
communities = communities.paginate(page=page, per_page=250 if current_user.is_authenticated and not low_bandwidth else 50,
|
||||||
error_out=False)
|
error_out=False)
|
||||||
next_url = url_for('main.list_communities', page=communities.next_num, sort_by=sort_by, language_id=language_id) if communities.has_next else None
|
next_url = url_for('main.list_local_communities', page=communities.next_num, sort_by=sort_by, language_id=language_id) if communities.has_next else None
|
||||||
prev_url = url_for('main.list_communities', page=communities.prev_num, sort_by=sort_by, language_id=language_id) if communities.has_prev and page != 1 else None
|
prev_url = url_for('main.list_local_communities', page=communities.prev_num, sort_by=sort_by, language_id=language_id) if communities.has_prev and page != 1 else None
|
||||||
|
|
||||||
return render_template('list_communities.html', communities=communities, search=search_param, title=_('Local Communities'),
|
return render_template('list_communities.html', communities=communities, search=search_param, title=_('Local Communities'),
|
||||||
SUBSCRIPTION_PENDING=SUBSCRIPTION_PENDING, SUBSCRIPTION_MEMBER=SUBSCRIPTION_MEMBER,
|
SUBSCRIPTION_PENDING=SUBSCRIPTION_PENDING, SUBSCRIPTION_MEMBER=SUBSCRIPTION_MEMBER,
|
||||||
|
@ -311,8 +311,8 @@ def list_subscribed_communities():
|
||||||
# Pagination
|
# Pagination
|
||||||
communities = communities.paginate(page=page, per_page=250 if current_user.is_authenticated and not low_bandwidth else 50,
|
communities = communities.paginate(page=page, per_page=250 if current_user.is_authenticated and not low_bandwidth else 50,
|
||||||
error_out=False)
|
error_out=False)
|
||||||
next_url = url_for('main.list_communities', page=communities.next_num, sort_by=sort_by, language_id=language_id) if communities.has_next else None
|
next_url = url_for('main.list_subscribed_communities', page=communities.next_num, sort_by=sort_by, language_id=language_id) if communities.has_next else None
|
||||||
prev_url = url_for('main.list_communities', page=communities.prev_num, sort_by=sort_by, language_id=language_id) if communities.has_prev and page != 1 else None
|
prev_url = url_for('main.list_subscribed_communities', page=communities.prev_num, sort_by=sort_by, language_id=language_id) if communities.has_prev and page != 1 else None
|
||||||
|
|
||||||
else:
|
else:
|
||||||
communities = []
|
communities = []
|
||||||
|
@ -376,8 +376,8 @@ def list_not_subscribed_communities():
|
||||||
# Pagination
|
# Pagination
|
||||||
communities = communities.paginate(page=page, per_page=250 if current_user.is_authenticated and not low_bandwidth else 50,
|
communities = communities.paginate(page=page, per_page=250 if current_user.is_authenticated and not low_bandwidth else 50,
|
||||||
error_out=False)
|
error_out=False)
|
||||||
next_url = url_for('main.list_communities', page=communities.next_num, sort_by=sort_by, language_id=language_id) if communities.has_next else None
|
next_url = url_for('main.list_not_subscribed_communities', page=communities.next_num, sort_by=sort_by, language_id=language_id) if communities.has_next else None
|
||||||
prev_url = url_for('main.list_communities', page=communities.prev_num, sort_by=sort_by, language_id=language_id) if communities.has_prev and page != 1 else None
|
prev_url = url_for('main.list_not_subscribed_communities', page=communities.prev_num, sort_by=sort_by, language_id=language_id) if communities.has_prev and page != 1 else None
|
||||||
|
|
||||||
else:
|
else:
|
||||||
communities = []
|
communities = []
|
||||||
|
|
Loading…
Add table
Reference in a new issue