55 lines
2.3 KiB
HTML
55 lines
2.3 KiB
HTML
{% extends "admin/layout.html" %}
|
|
{% let active_page = "leads" %}
|
|
|
|
{% block title %}{{ t.leads_title }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="page-head">
|
|
<h1>{{ t.leads_title }}</h1>
|
|
{% if show_all %}
|
|
<a href="/admin/leads?lang={{ lang.code() }}" class="button is-small is-light">{{ t.filter_show_active }}</a>
|
|
{% else %}
|
|
<a href="/admin/leads?lang={{ lang.code() }}&all=1" class="button is-small is-light">{{ t.filter_show_all }}</a>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if leads.is_empty() %}
|
|
<p class="has-text-grey">{{ t.leads_empty }}</p>
|
|
{% else %}
|
|
{% for lead in &leads %}
|
|
<div class="item-card">
|
|
<div class="item-card-header">
|
|
<span class="name">{{ lead.name }}</span>
|
|
<span class="badge badge-{{ lead.status }}">{{ t.lead_status(&lead.status) }}</span>
|
|
</div>
|
|
<div class="item-card-meta">
|
|
{% if let Some(phone) = lead.phone.as_deref() %}
|
|
<span><a href="tel:{{ phone }}" style="color:inherit;text-decoration:none;">📞 {{ phone }}</a></span>
|
|
{% endif %}
|
|
{% if let Some(comment) = lead.comment.as_deref() %}
|
|
<span>💬 {{ comment }}</span>
|
|
{% endif %}
|
|
<span>🕐 {{ lead.created_at.format("%d.%m.%Y %H:%M") }}</span>
|
|
</div>
|
|
{% if lead.status == "new" || lead.status == "in_progress" %}
|
|
<div class="item-card-actions">
|
|
{% if lead.status == "new" %}
|
|
<form method="post" action="/admin/leads/{{ lead.id }}/status">
|
|
<input type="hidden" name="status" value="in_progress">
|
|
<button type="submit" class="button is-small is-info is-outlined btn-sm">{{ t.action_in_progress }}</button>
|
|
</form>
|
|
{% endif %}
|
|
<form method="post" action="/admin/leads/{{ lead.id }}/convert">
|
|
<button type="submit" class="button is-small is-success is-outlined btn-sm">{{ t.action_convert }}</button>
|
|
</form>
|
|
<form method="post" action="/admin/leads/{{ lead.id }}/status">
|
|
<input type="hidden" name="status" value="rejected">
|
|
<button type="submit" class="button is-small is-danger is-outlined btn-sm">{{ t.action_reject }}</button>
|
|
</form>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endblock %}
|