SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 2a1f2858 authored by George Katsikas's avatar George Katsikas :goat:
Browse files

move newsletter send button to edit page

add newsletter content preview to list
parent f9c7ebba
No related branches found
No related tags found
No related merge requests found
<li class="border p-2 rounded d-flex flex-row justify-content-between">
<div class="d-flex flex-column">
<span>{{ newsletter }}</span>
<span>{{ newsletter.get_status_display }}</span>
<li class="border p-2 rounded d-flex flex-row justify-content-between gap-2">
<div class="d-flex flex-column text-truncate">
<span class="fw-bold">{{ newsletter.title }}</span>
<span class="text-truncate">{{ newsletter.content|striptags|truncatechars:200 }}</span>
</div>
<div class="align-self-end d-flex flex-column align-items-end">
<a href="{% url "mailing_lists:newsletter_edit" newsletter.id %}">Edit</a>
<a href="#"
hx-swap="outerHTML"
hx-confirm="Are you sure you want to send this newsletter?"
hx-get="{% url "mailing_lists:_hx_newsletter_send" newsletter.id %}">Send Now</a>
<span>{{ newsletter.get_status_display }}</span>
</div>
</li>
......@@ -36,8 +36,26 @@
hx-trigger="load once"></div>
<h3 class="mt-4">Actions</h3>
<div class="row">
<div class="col-auto">
{% if newsletter.status == 'sent' %}
<button class="btn btn-secondary" disabled>Send Now</button>
{% else %}
<button class="btn btn-primary"
hx-swap="outerHTML"
hx-confirm="Are you sure you want to send this newsletter?"
hx-get="{% url "mailing_lists:_hx_newsletter_send" newsletter.id %}">Send Now</button>
{% endif %}
</div>
</div>
{% endblock content %}
{% block headsup %}
<link rel="stylesheet"
href="{% static 'scipost/assets/css/newsletter.css' %}" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment