Files
mc-webui/app/templates/contacts-existing.html
T
MarekWo a1f91816af refactor: Improve Contact Management modal pages layout
After removing navbars from modal embedded pages, add proper page headers
and optimize button layout for better mobile UX.

Changes to Pending Contacts page:
- Add H4 page header "Pending Contacts" with badge counter
- Replace two large buttons (Contact Management + Home) with smaller ones
- Change Home button to Refresh button (more useful in modal context)
- Use btn-sm for compact button sizes
- Replace back-buttons class with d-flex gap-2 for simpler layout

Changes to Existing Contacts page:
- Add H4 page header "Existing Contacts" with counter badge
- Same button improvements as Pending Contacts
- Replace Home button with Refresh button

Changes to Contact Management settings:
- Set default "Days of Inactivity" value to 0 (ignore) instead of 2
- This is safer default as 0 means "do not filter by inactivity"

Result:
- Clear page headers indicate current location in modal
- Smaller, more compact buttons save screen space
- Refresh buttons are more useful than Home (which is Close in modal)
- Safer default value for cleanup prevents accidental bulk deletions

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-01 21:50:18 +01:00

81 lines
3.0 KiB
HTML

{% extends "contacts_base.html" %}
{% block title %}Existing Contacts - mc-webui{% endblock %}
{% block page_content %}
<div id="existingPageContent" class="p-3">
<!-- Page Header -->
<div class="mb-3">
<h4 class="mb-2">
<i class="bi bi-person-lines-fill"></i> Existing Contacts
<span class="badge counter-badge counter-ok rounded-pill" id="contactsCounter" style="display: none; font-size: 0.8rem;">0 / 350</span>
</h4>
</div>
<!-- Action Buttons -->
<div class="d-flex gap-2 mb-3">
<button class="btn btn-outline-secondary btn-sm" onclick="navigateTo('/contacts/manage');">
<i class="bi bi-arrow-left"></i> Back
</button>
<button class="btn btn-outline-primary btn-sm" id="refreshExistingBtn">
<i class="bi bi-arrow-clockwise"></i> Refresh
</button>
</div>
<!-- Search Toolbar -->
<div class="search-toolbar">
<input type="text" class="form-control" id="searchInput" placeholder="Search by name or public key...">
</div>
<!-- Filter and Sort Toolbar -->
<div class="filter-sort-toolbar">
<!-- Type Filter -->
<select class="form-select" id="typeFilter" style="max-width: 150px;">
<option value="ALL">All Types</option>
<option value="CLI">CLI</option>
<option value="REP">REP</option>
<option value="ROOM">ROOM</option>
<option value="SENS">SENS</option>
</select>
<!-- Sort Buttons -->
<div class="sort-buttons">
<button class="sort-btn" data-sort="name" id="sortByName" title="Sort by contact name">
<span>Name</span>
<i class="bi bi-sort-down"></i>
</button>
<button class="sort-btn active" data-sort="last_advert" id="sortByLastAdvert" title="Sort by last advertisement time">
<span>Last advert</span>
<i class="bi bi-sort-down"></i>
</button>
</div>
</div>
<!-- Loading State -->
<div id="existingLoading" class="text-center py-5" style="display: none;">
<div class="spinner-border text-primary" role="status">
<span class="visually-hidden">Loading...</span>
</div>
<p class="mt-3 text-muted">Loading contacts...</p>
</div>
<!-- Empty State -->
<div id="existingEmpty" class="empty-state" style="display: none;">
<i class="bi bi-inbox"></i>
<p class="mb-0">No contacts found</p>
<small class="text-muted">Contacts will appear here once added</small>
</div>
<!-- Existing Contacts List (Full-screen) -->
<div id="existingList" class="contacts-list-fullscreen">
<!-- Dynamically populated by contacts.js -->
</div>
<!-- Error State -->
<div id="existingError" class="alert alert-danger" style="display: none;" role="alert">
<i class="bi bi-exclamation-triangle"></i>
<span id="existingErrorMessage">Failed to load contacts</span>
</div>
</div>
{% endblock %}