- Add ClassifiedInterest model for tracking user interest in listings - Add ClassifiedQuestion model for public Q&A on listings - Add context_type/context_id to PrivateMessage for B2B linking - Add interest toggle button and interests list modal - Add Q&A section with ask/answer/hide functionality - Update messages to show B2B context badge - Create migration 034_classified_interactions.sql Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
232 lines
6.2 KiB
HTML
Executable File
232 lines
6.2 KiB
HTML
Executable File
{% extends "base.html" %}
|
|
|
|
{% block title %}Wyslane wiadomosci - Norda Biznes Partner{% endblock %}
|
|
|
|
{% block extra_css %}
|
|
<style>
|
|
.messages-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: var(--spacing-xl);
|
|
}
|
|
|
|
.messages-header h1 {
|
|
font-size: var(--font-size-3xl);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.messages-tabs {
|
|
display: flex;
|
|
gap: var(--spacing-md);
|
|
margin-bottom: var(--spacing-lg);
|
|
}
|
|
|
|
.tab-link {
|
|
padding: var(--spacing-sm) var(--spacing-lg);
|
|
border-radius: var(--radius);
|
|
text-decoration: none;
|
|
color: var(--text-secondary);
|
|
font-weight: 500;
|
|
transition: var(--transition);
|
|
}
|
|
|
|
.tab-link:hover {
|
|
background: var(--background);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.tab-link.active {
|
|
background: var(--primary);
|
|
color: white;
|
|
}
|
|
|
|
.messages-list {
|
|
background: var(--surface);
|
|
border-radius: var(--radius-lg);
|
|
box-shadow: var(--shadow);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.message-item {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: var(--spacing-md) var(--spacing-lg);
|
|
border-bottom: 1px solid var(--border);
|
|
text-decoration: none;
|
|
color: inherit;
|
|
transition: var(--transition);
|
|
}
|
|
|
|
.message-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.message-item:hover {
|
|
background: var(--background);
|
|
}
|
|
|
|
.message-avatar {
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 50%;
|
|
background: var(--secondary);
|
|
color: white;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-weight: 600;
|
|
margin-right: var(--spacing-md);
|
|
flex-shrink: 0;
|
|
}
|
|
|
|
.message-content {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
.message-subject {
|
|
font-size: var(--font-size-base);
|
|
color: var(--text-primary);
|
|
margin-bottom: var(--spacing-xs);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.message-preview {
|
|
font-size: var(--font-size-sm);
|
|
color: var(--text-secondary);
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
}
|
|
|
|
.message-meta {
|
|
text-align: right;
|
|
flex-shrink: 0;
|
|
margin-left: var(--spacing-md);
|
|
}
|
|
|
|
.message-date {
|
|
font-size: var(--font-size-sm);
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.message-to {
|
|
font-size: var(--font-size-sm);
|
|
color: var(--text-primary);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: var(--spacing-2xl);
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.read-status {
|
|
font-size: var(--font-size-xs);
|
|
color: var(--success);
|
|
}
|
|
|
|
.context-badge-small {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
padding: 2px 8px;
|
|
background: #eff6ff;
|
|
border-radius: var(--radius-sm);
|
|
font-size: var(--font-size-xs);
|
|
color: var(--primary);
|
|
margin-left: var(--spacing-sm);
|
|
}
|
|
|
|
.context-badge-small svg {
|
|
width: 12px;
|
|
height: 12px;
|
|
}
|
|
|
|
.pagination {
|
|
display: flex;
|
|
justify-content: center;
|
|
gap: var(--spacing-sm);
|
|
margin-top: var(--spacing-xl);
|
|
}
|
|
|
|
.pagination a {
|
|
padding: var(--spacing-sm) var(--spacing-md);
|
|
border-radius: var(--radius);
|
|
text-decoration: none;
|
|
color: var(--text-secondary);
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
}
|
|
|
|
.pagination a:hover {
|
|
background: var(--background);
|
|
}
|
|
|
|
.pagination a.active {
|
|
background: var(--primary);
|
|
color: white;
|
|
border-color: var(--primary);
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="messages-header">
|
|
<h1>Wyslane wiadomosci</h1>
|
|
<a href="{{ url_for('messages_new') }}" class="btn btn-primary">Nowa wiadomosc</a>
|
|
</div>
|
|
|
|
<div class="messages-tabs">
|
|
<a href="{{ url_for('messages_inbox') }}" class="tab-link">Odebrane</a>
|
|
<a href="{{ url_for('messages_sent') }}" class="tab-link active">Wyslane</a>
|
|
</div>
|
|
|
|
<div class="messages-list">
|
|
{% if messages %}
|
|
{% for msg in messages %}
|
|
<a href="{{ url_for('messages_view', message_id=msg.id) }}" class="message-item">
|
|
<div class="message-avatar">
|
|
{{ (msg.recipient.name or msg.recipient.email)[0].upper() }}
|
|
</div>
|
|
<div class="message-content">
|
|
<div class="message-subject">
|
|
{{ msg.subject or '(brak tematu)' }}
|
|
{% if msg.context_type == 'classified' %}
|
|
<span class="context-badge-small">
|
|
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"/></svg>
|
|
B2B
|
|
</span>
|
|
{% endif %}
|
|
</div>
|
|
<div class="message-preview">{{ msg.content[:80] }}{% if msg.content|length > 80 %}...{% endif %}</div>
|
|
</div>
|
|
<div class="message-meta">
|
|
<div class="message-to">Do: {{ msg.recipient.name or msg.recipient.email.split('@')[0] }}</div>
|
|
<div class="message-date">{{ msg.created_at.strftime('%d.%m.%Y %H:%M') }}</div>
|
|
{% if msg.is_read %}
|
|
<div class="read-status">Przeczytana</div>
|
|
{% endif %}
|
|
</div>
|
|
</a>
|
|
{% endfor %}
|
|
{% else %}
|
|
<div class="empty-state">
|
|
<p>Brak wyslanych wiadomosci</p>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if total_pages > 1 %}
|
|
<div class="pagination">
|
|
{% for p in range(1, total_pages + 1) %}
|
|
<a href="{{ url_for('messages_sent', page=p) }}" class="{% if p == page %}active{% endif %}">{{ p }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|