- 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>
231 lines
6.7 KiB
HTML
Executable File
231 lines
6.7 KiB
HTML
Executable File
{% extends "base.html" %}
|
|
|
|
{% block title %}Nowa wiadomosc - Norda Biznes Partner{% endblock %}
|
|
|
|
{% block extra_css %}
|
|
<style>
|
|
.compose-container {
|
|
max-width: 700px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.compose-header {
|
|
margin-bottom: var(--spacing-xl);
|
|
}
|
|
|
|
.compose-header h1 {
|
|
font-size: var(--font-size-3xl);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.compose-card {
|
|
background: var(--surface);
|
|
border-radius: var(--radius-lg);
|
|
padding: var(--spacing-xl);
|
|
box-shadow: var(--shadow);
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: var(--spacing-lg);
|
|
}
|
|
|
|
.form-group label {
|
|
display: block;
|
|
font-weight: 500;
|
|
margin-bottom: var(--spacing-xs);
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.form-group input,
|
|
.form-group select,
|
|
.form-group textarea {
|
|
width: 100%;
|
|
padding: var(--spacing-sm) var(--spacing-md);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius);
|
|
font-size: var(--font-size-base);
|
|
transition: var(--transition);
|
|
}
|
|
|
|
.form-group input:focus,
|
|
.form-group select:focus,
|
|
.form-group textarea:focus {
|
|
outline: none;
|
|
border-color: var(--primary);
|
|
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
|
|
}
|
|
|
|
.form-actions {
|
|
display: flex;
|
|
gap: var(--spacing-md);
|
|
margin-top: var(--spacing-xl);
|
|
}
|
|
|
|
.back-link {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: var(--spacing-xs);
|
|
color: var(--text-secondary);
|
|
text-decoration: none;
|
|
margin-bottom: var(--spacing-lg);
|
|
}
|
|
|
|
.back-link:hover {
|
|
color: var(--primary);
|
|
}
|
|
|
|
.recipient-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--spacing-md);
|
|
padding: var(--spacing-md);
|
|
background: var(--background);
|
|
border-radius: var(--radius);
|
|
margin-bottom: var(--spacing-lg);
|
|
}
|
|
|
|
.recipient-avatar {
|
|
width: 48px;
|
|
height: 48px;
|
|
border-radius: 50%;
|
|
background: var(--primary);
|
|
color: white;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-weight: 600;
|
|
font-size: var(--font-size-lg);
|
|
}
|
|
|
|
.recipient-name {
|
|
font-weight: 500;
|
|
}
|
|
|
|
.recipient-email {
|
|
font-size: var(--font-size-sm);
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.context-info {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--spacing-md);
|
|
padding: var(--spacing-md);
|
|
background: #eff6ff;
|
|
border: 1px solid #bfdbfe;
|
|
border-radius: var(--radius);
|
|
margin-bottom: var(--spacing-lg);
|
|
}
|
|
|
|
.context-icon {
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: var(--radius);
|
|
background: var(--primary);
|
|
color: white;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.context-label {
|
|
font-size: var(--font-size-sm);
|
|
color: var(--text-secondary);
|
|
}
|
|
|
|
.context-title {
|
|
font-weight: 500;
|
|
color: var(--text-primary);
|
|
}
|
|
|
|
.context-title a {
|
|
color: var(--primary);
|
|
text-decoration: none;
|
|
}
|
|
|
|
.context-title a:hover {
|
|
text-decoration: underline;
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="compose-container">
|
|
<a href="{{ url_for('messages_inbox') }}" class="back-link">
|
|
<svg width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
|
<path d="M19 12H5M12 19l-7-7 7-7"/>
|
|
</svg>
|
|
Powrot do wiadomosci
|
|
</a>
|
|
|
|
<div class="compose-header">
|
|
<h1>Nowa wiadomosc</h1>
|
|
</div>
|
|
|
|
<div class="compose-card">
|
|
{% if recipient %}
|
|
<div class="recipient-info">
|
|
<div class="recipient-avatar">{{ (recipient.name or recipient.email)[0].upper() }}</div>
|
|
<div>
|
|
<div class="recipient-name">{{ recipient.name or recipient.email.split('@')[0] }}</div>
|
|
{% if recipient.privacy_show_email != False %}
|
|
<div class="recipient-email">{{ recipient.email }}</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if context %}
|
|
<div class="context-info">
|
|
<div class="context-icon">
|
|
<svg width="20" height="20" 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>
|
|
</div>
|
|
<div>
|
|
<div class="context-label">Dotyczy ogloszenia B2B:</div>
|
|
<div class="context-title"><a href="{{ context.url }}" target="_blank">{{ context.title }}</a></div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<form method="POST" action="{{ url_for('messages_send') }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
{% if context_type %}
|
|
<input type="hidden" name="context_type" value="{{ context_type }}">
|
|
<input type="hidden" name="context_id" value="{{ context_id }}">
|
|
{% endif %}
|
|
|
|
{% if recipient %}
|
|
<input type="hidden" name="recipient_id" value="{{ recipient.id }}">
|
|
{% else %}
|
|
<div class="form-group">
|
|
<label for="recipient_id">Do *</label>
|
|
<select id="recipient_id" name="recipient_id" required>
|
|
<option value="">Wybierz odbiorcę...</option>
|
|
{% for user in users %}
|
|
<option value="{{ user.id }}">{{ user.name or user.email.split('@')[0] }}{% if user.privacy_show_email != False %} ({{ user.email }}){% endif %}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="form-group">
|
|
<label for="subject">Temat</label>
|
|
<input type="text" id="subject" name="subject" maxlength="255" placeholder="Temat wiadomosci (opcjonalnie)" value="{{ context_subject or '' }}">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="content">Tresc *</label>
|
|
<textarea id="content" name="content" rows="8" required placeholder="Napisz wiadomosc..."></textarea>
|
|
</div>
|
|
|
|
<div class="form-actions">
|
|
<button type="submit" class="btn btn-primary">Wyslij</button>
|
|
<a href="{{ url_for('messages_inbox') }}" class="btn btn-secondary">Anuluj</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|