Refactor pagination logic in admin ads list keyboard

- Updated the pagination row to only display when multiple pages are available, improving the user interface for ad navigation.
- Enhanced the inline keyboard structure for better clarity and usability in the admin panel's ads management section.
This commit is contained in:
machka-pasla
2025-09-05 15:17:01 +03:00
parent 8113908a98
commit 9a6ff6f636
+2 -1
View File
@@ -148,7 +148,8 @@ def get_ads_list_keyboard(
callback_data=f"admin_ads:card:{c.ad_campaign_id}:{current_page}", callback_data=f"admin_ads:card:{c.ad_campaign_id}:{current_page}",
) )
# Pagination row # Pagination row (only when needed)
if total_pages > 1:
row = [] row = []
if current_page > 0: if current_page > 0:
row.append( row.append(