refactor(contacts): Implement multi-page Contact Management with advanced sorting

Split Contact Management into 3 dedicated pages for improved mobile usability:
- /contacts/manage - Settings & navigation hub (manual approval + cleanup)
- /contacts/pending - Full-screen pending contacts view
- /contacts/existing - Full-screen existing contacts with search/filter/sort

New Features:
- Advanced sorting: Name (A-Z/Z-A) & Last advert (newest/oldest)
- URL-based sort state (?sort=name&order=asc)
- Activity indicators: 🟢 active, 🟡 recent, 🔴 inactive
- Changed terminology: "Last seen" → "Last advert" (more accurate)
- Cleanup tool moved from Settings modal to Contact Management page

Technical Changes:
- Created contacts_base.html standalone template
- Split contacts.html into 3 specialized templates
- Refactored contacts.js for multi-page support with page detection
- Added 2 new Flask routes: /contacts/pending, /contacts/existing
- Removed cleanup section from base.html Settings modal

Mobile-first design: Each page has full-screen space with touch-friendly
navigation and back buttons.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
MarekWo
2025-12-30 08:40:22 +01:00
parent d601d714f7
commit cdc8be9eb4
8 changed files with 1011 additions and 68 deletions
+26 -2
View File
@@ -44,10 +44,34 @@ def direct_messages():
@views_bp.route('/contacts/manage')
def contact_management():
"""
Contact Management view - manual approval settings and pending contacts list.
Contact Management Settings - manual approval + cleanup + navigation.
"""
return render_template(
'contacts.html',
'contacts-manage.html',
device_name=config.MC_DEVICE_NAME,
refresh_interval=config.MC_REFRESH_INTERVAL
)
@views_bp.route('/contacts/pending')
def contact_pending_list():
"""
Full-screen pending contacts list.
"""
return render_template(
'contacts-pending.html',
device_name=config.MC_DEVICE_NAME,
refresh_interval=config.MC_REFRESH_INTERVAL
)
@views_bp.route('/contacts/existing')
def contact_existing_list():
"""
Full-screen existing contacts list with search, filter, sort.
"""
return render_template(
'contacts-existing.html',
device_name=config.MC_DEVICE_NAME,
refresh_interval=config.MC_REFRESH_INTERVAL
)