2026-05-10 09:08:12 +02:00
|
|
|
{% extends "base.html" %}
|
|
|
|
|
{% block extra_head %}
|
|
|
|
|
<link rel="stylesheet" href="/static/css/messages.css">
|
|
|
|
|
{% endblock %}
|
|
|
|
|
{% block content %}
|
2026-05-11 05:30:51 +02:00
|
|
|
<h1 class="sr-only">Messages</h1>
|
|
|
|
|
<div class="page-messages">
|
2026-05-10 09:08:12 +02:00
|
|
|
<div class="messages-layout">
|
|
|
|
|
<div class="messages-list">
|
|
|
|
|
<div class="messages-list-header">
|
|
|
|
|
<input type="text" id="message-search" placeholder="Search conversations..." value="{{ search }}">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="messages-conversations">
|
|
|
|
|
{% for conv in conversations %}
|
|
|
|
|
<a href="/messages?with_uid={{ conv.other_user['uid'] }}" class="conversation-item {% if current_conversation == conv.other_user['uid'] %}active{% endif %}">
|
2026-05-11 05:30:51 +02:00
|
|
|
<img src="{{ avatar_url('multiavatar', conv.other_user['username'], 32) }}" class="avatar-img avatar-sm" alt="{{ conv.other_user['username'] }}" loading="lazy">
|
2026-05-10 09:08:12 +02:00
|
|
|
<div class="conversation-info">
|
|
|
|
|
<div class="conversation-name">{{ conv.other_user['username'] }}</div>
|
|
|
|
|
<div class="conversation-preview">{{ conv.last_message[:60] }}</div>
|
|
|
|
|
</div>
|
2026-05-12 12:45:52 +02:00
|
|
|
<span class="conversation-time">{{ format_date(conv.last_message_at) }}</span>
|
2026-05-10 09:08:12 +02:00
|
|
|
</a>
|
|
|
|
|
{% else %}
|
2026-05-10 21:33:53 +02:00
|
|
|
<div class="empty-state" style="border: none;">No conversations yet</div>
|
2026-05-10 09:08:12 +02:00
|
|
|
{% endfor %}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="messages-main">
|
|
|
|
|
{% if other_user %}
|
|
|
|
|
<div class="messages-main-header">
|
feat: add responsive layout with media queries for mobile and tablet breakpoints
Implement responsive design adjustments across admin, auth, base, feed, gists, landing, messages, news, notifications, post, profile, projects, and services CSS files with collapsible sidebar, touch-friendly navigation, and reordered content sections for screen widths below 768px and 480px. Add hamburger menu toggle, mobile overlay panel, and back button for messages view in Application.js.
2026-05-16 01:34:45 +02:00
|
|
|
<button class="messages-back-btn" id="messages-back-btn" aria-label="Back to conversations">←</button>
|
2026-05-11 05:30:51 +02:00
|
|
|
<a href="/profile/{{ other_user['username'] }}">
|
|
|
|
|
<img src="{{ avatar_url('multiavatar', other_user['username'], 32) }}" class="avatar-img avatar-sm" alt="{{ other_user['username'] }}" loading="lazy">
|
|
|
|
|
</a>
|
|
|
|
|
<a href="/profile/{{ other_user['username'] }}"><h3>{{ other_user['username'] }}</h3></a>
|
2026-05-10 09:08:12 +02:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="messages-thread">
|
|
|
|
|
{% for msg in messages %}
|
|
|
|
|
<div class="message-bubble {% if msg.is_mine %}mine{% else %}theirs{% endif %}">
|
2026-05-11 05:30:51 +02:00
|
|
|
<div class="rendered-content" data-render>{{ msg.message['content'] }}</div>
|
2026-05-12 15:07:34 +02:00
|
|
|
{% if msg.attachments %}
|
|
|
|
|
{% with attachments=msg.attachments %}
|
|
|
|
|
{% include "_attachment_display.html" %}
|
|
|
|
|
{% endwith %}
|
|
|
|
|
{% endif %}
|
2026-05-10 09:08:12 +02:00
|
|
|
<span class="message-time">{{ msg.time_ago }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<form class="messages-input-area" method="POST" action="/messages/send">
|
|
|
|
|
<input type="hidden" name="receiver_uid" value="{{ other_user['uid'] }}">
|
2026-05-12 15:07:34 +02:00
|
|
|
<input type="text" name="content" placeholder="Type a message..." required maxlength="2000" autocomplete="off" autofocus data-mention>
|
|
|
|
|
<div class="attachment-upload-container" data-attachment-upload
|
|
|
|
|
data-max-size="{{ max_upload_size_mb() }}"
|
|
|
|
|
data-max-files="5"
|
|
|
|
|
data-allowed-types="{{ allowed_file_types() }}"></div>
|
2026-05-10 09:08:12 +02:00
|
|
|
<button type="submit" class="messages-send-btn">➤</button>
|
|
|
|
|
</form>
|
|
|
|
|
{% else %}
|
|
|
|
|
<div class="messages-empty">
|
|
|
|
|
<p>Select a conversation to start chatting</p>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-05-11 05:30:51 +02:00
|
|
|
</div>
|
2026-05-16 03:02:10 +02:00
|
|
|
|
|
|
|
|
{% block extra_js %}
|
|
|
|
|
{% if other_user %}
|
|
|
|
|
<script>
|
|
|
|
|
document.addEventListener("DOMContentLoaded", function() {
|
|
|
|
|
var input = document.querySelector('.messages-input-area input[name="content"]');
|
|
|
|
|
if (input) {
|
|
|
|
|
var scrollTarget = document.querySelector('.messages-thread');
|
|
|
|
|
if (scrollTarget) {
|
|
|
|
|
scrollTarget.scrollTop = scrollTarget.scrollHeight;
|
|
|
|
|
}
|
|
|
|
|
input.focus();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
{% endif %}
|
|
|
|
|
{% endblock %}
|
2026-05-10 09:08:12 +02:00
|
|
|
{% endblock %}
|