Files
ShooterHub/frontend/messages.html
2026-04-02 11:24:30 +02:00

141 lines
5.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Messages ShooterHub</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link rel="stylesheet" href="/css/app.css">
<style>
.msg-pane { height: calc(100vh - 140px); display: flex; flex-direction: column; }
.msg-list { overflow-y: auto; flex: 1; }
.msg-row { padding: .55rem .75rem; border-bottom: 1px solid #f0f0f0; cursor: pointer;
border-radius: 6px; transition: background .12s; }
.msg-row:hover { background: #f0f4ff; }
.msg-row.active { background: #e8f0fe; }
.msg-row.unread .msg-subject { font-weight: 600; }
.msg-subject { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-meta { font-size: .73rem; color: #6c757d; white-space: nowrap; }
.msg-detail { height: calc(100vh - 140px); overflow-y: auto; }
.detail-header { border-bottom: 1px solid #dee2e6; padding-bottom: 1rem; margin-bottom: 1rem; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: #0d6efd;
display: inline-block; flex-shrink: 0; }
</style>
</head>
<body>
<div id="navbar"></div>
<div class="container-fluid py-3">
<div class="row g-3">
<!-- Left sidebar -->
<div class="col-md-4 col-lg-3">
<div class="d-flex align-items-center justify-content-between mb-2">
<h5 class="fw-bold mb-0"><i class="bi bi-envelope me-2 text-primary"></i>Messages</h5>
<button class="btn btn-sm btn-primary" id="composeBtn">
<i class="bi bi-pencil-square me-1"></i>Compose
</button>
</div>
<!-- Inbox / Sent tabs -->
<ul class="nav nav-pills nav-fill mb-2" id="msgTabs">
<li class="nav-item">
<button class="nav-link active" data-tab="inbox">
Inbox <span class="badge bg-danger ms-1 d-none" id="unreadBadge"></span>
</button>
</li>
<li class="nav-item">
<button class="nav-link" data-tab="sent">Sent</button>
</li>
</ul>
<div class="msg-pane border rounded bg-white">
<div class="msg-list p-1" id="msgList">
<div class="text-center py-4 text-muted small">Loading…</div>
</div>
</div>
</div>
<!-- Right: detail / empty state -->
<div class="col-md-8 col-lg-9">
<div class="card border-0 shadow-sm msg-detail p-4" id="msgDetail">
<div class="text-center text-muted py-5" id="detailEmpty">
<i class="bi bi-envelope-open" style="font-size:3rem;opacity:.25;"></i>
<p class="mt-3 mb-0">Select a message to read it.</p>
</div>
<div class="d-none" id="detailContent">
<div class="detail-header">
<h5 class="fw-semibold mb-1" id="detailSubject"></h5>
<div class="text-muted small d-flex flex-wrap gap-3" id="detailMeta"></div>
</div>
<div id="detailBody" style="white-space:pre-wrap;line-height:1.7;"></div>
<div class="mt-4">
<button class="btn btn-sm btn-outline-danger" id="detailDeleteBtn">
<i class="bi bi-trash me-1"></i>Delete
</button>
<button class="btn btn-sm btn-outline-secondary ms-2" id="detailReplyBtn">
<i class="bi bi-reply me-1"></i>Reply
</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Compose modal -->
<div class="modal fade" id="composeModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><i class="bi bi-pencil-square me-2"></i>New message</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>
<div class="modal-body">
<div class="alert alert-danger d-none" id="composeAlert"></div>
<!-- Recipient search -->
<div class="mb-3">
<label class="form-label small fw-semibold">To</label>
<input type="text" class="form-control form-control-sm" id="recipientSearch"
placeholder="Search by username…" autocomplete="off">
<div class="list-group mt-1 d-none" id="recipientResults"></div>
<input type="hidden" id="recipientId">
<div class="mt-1 d-none" id="recipientChosen">
<span class="badge bg-primary" id="recipientLabel"></span>
<button type="button" class="btn-close btn-close-sm ms-1" id="recipientClear" style="font-size:.6rem"></button>
</div>
</div>
<div class="mb-3">
<label class="form-label small fw-semibold">Subject</label>
<input type="text" class="form-control form-control-sm" id="composeSubject" maxlength="200">
</div>
<div class="mb-1">
<label class="form-label small fw-semibold">Message</label>
<textarea class="form-control form-control-sm" id="composeBody" rows="6"></textarea>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary btn-sm" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary btn-sm" id="composeSendBtn">
<span class="spinner-border spinner-border-sm d-none me-1" id="composeSpin"></span>
Send
</button>
</div>
</div>
</div>
</div>
<div id="toastContainer"></div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="/js/api.js"></script>
<script src="/js/utils.js"></script>
<script src="/js/i18n.js"></script>
<script src="/js/nav.js"></script>
<script src="/js/messages.js"></script>
</body>
</html>