mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-07-05 17:31:39 +02:00
cdc8be9eb4
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>
86 lines
3.6 KiB
HTML
86 lines
3.6 KiB
HTML
{% extends "contacts_base.html" %}
|
|
|
|
{% block title %}Contact Management Settings - mc-webui{% endblock %}
|
|
|
|
{% block navbar_content %}
|
|
<span class="navbar-brand mb-0 h1">
|
|
<i class="bi bi-person-check"></i> Contact Management
|
|
</span>
|
|
<div class="d-flex align-items-center gap-2">
|
|
<button class="btn btn-outline-light btn-sm" onclick="window.location.href='/';" title="Home">
|
|
<i class="bi bi-house"></i>
|
|
</button>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block page_content %}
|
|
<div id="managePageContent">
|
|
<!-- Page Header -->
|
|
<div class="mb-4">
|
|
<h2 class="mb-1">
|
|
<i class="bi bi-gear"></i> Settings
|
|
</h2>
|
|
<p class="text-muted small mb-0">Configure contact management preferences</p>
|
|
</div>
|
|
|
|
<!-- Manual Approval Settings Section -->
|
|
<div class="compact-setting">
|
|
<div class="form-check form-switch mb-0 d-flex align-items-center gap-2">
|
|
<input class="form-check-input" type="checkbox" role="switch" id="manualApprovalSwitch" style="cursor: pointer; min-width: 3rem; min-height: 1.5rem;">
|
|
<label class="form-check-label mb-0" for="manualApprovalSwitch" style="cursor: pointer; font-weight: 500;">
|
|
<span id="switchLabel">Loading...</span>
|
|
</label>
|
|
</div>
|
|
<i class="bi bi-info-circle info-icon"
|
|
data-bs-toggle="tooltip"
|
|
data-bs-placement="top"
|
|
title="When enabled, new contacts must be manually approved before they can communicate with your node"></i>
|
|
</div>
|
|
|
|
<!-- Cleanup Inactive Contacts Section -->
|
|
<div class="cleanup-section">
|
|
<h6><i class="bi bi-trash"></i> Cleanup Inactive Contacts</h6>
|
|
<p class="small text-muted mb-3">Remove contacts that haven't sent an advertisement in a specified time period.</p>
|
|
<div class="mb-3">
|
|
<label for="inactiveHours" class="form-label">Remove contacts inactive for:</label>
|
|
<div class="input-group">
|
|
<input type="number" class="form-control" id="inactiveHours" value="48" min="1">
|
|
<span class="input-group-text">hours</span>
|
|
</div>
|
|
</div>
|
|
<button class="btn btn-danger" id="cleanupBtn">
|
|
<i class="bi bi-trash"></i> Clean Inactive Contacts
|
|
</button>
|
|
</div>
|
|
|
|
<!-- Navigation Section -->
|
|
<div class="mb-4">
|
|
<h5 class="mb-3">
|
|
<i class="bi bi-list-ul"></i> Manage Contacts
|
|
</h5>
|
|
|
|
<!-- Pending Contacts Card -->
|
|
<div class="nav-card" onclick="window.location.href='/contacts/pending';">
|
|
<div>
|
|
<h6><i class="bi bi-hourglass-split"></i> Pending Contacts</h6>
|
|
<small class="text-muted">Contacts awaiting manual approval</small>
|
|
</div>
|
|
<span class="badge bg-primary rounded-pill" id="pendingBadge" style="font-size: 1.1rem;">
|
|
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
</span>
|
|
</div>
|
|
|
|
<!-- Existing Contacts Card -->
|
|
<div class="nav-card" onclick="window.location.href='/contacts/existing';">
|
|
<div>
|
|
<h6><i class="bi bi-person-lines-fill"></i> Existing Contacts</h6>
|
|
<small class="text-muted">View and manage your approved contacts</small>
|
|
</div>
|
|
<span class="badge counter-badge counter-ok rounded-pill" id="existingBadge" style="font-size: 1.1rem;">
|
|
<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|