Reply button added.
This commit is contained in:
@@ -35,6 +35,29 @@
|
|||||||
<pre class="bg-light p-3 border">{{ message.text }}</pre>
|
<pre class="bg-light p-3 border">{{ message.text }}</pre>
|
||||||
|
|
||||||
<p class="nav-links">
|
<p class="nav-links">
|
||||||
<a href="/messages">← Back to Messages</a>
|
<button type="button" class="btn btn-primary btn-sm me-2" id="replyButton">
|
||||||
|
Reply
|
||||||
|
</button>
|
||||||
|
<br/>
|
||||||
|
<a href="/dashboard">← Back to Dashboard</a>
|
||||||
|
{% if request.url.path.startswith("/dashboard/message/") %}
|
||||||
|
| <a href="/messages">All Messages</a>
|
||||||
|
{% endif %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
document.getElementById('replyButton')?.addEventListener('click', function() {
|
||||||
|
// Set the "To" field to the original sender
|
||||||
|
const fromCall = "{{ message.from | e }}"; // safely escape
|
||||||
|
document.getElementById('to_call').value = fromCall;
|
||||||
|
|
||||||
|
// Clear the message body (or optionally pre-fill with quote)
|
||||||
|
document.getElementById('message_text').value = '';
|
||||||
|
|
||||||
|
// Open the compose modal
|
||||||
|
const modal = new bootstrap.Modal(document.getElementById('composeModal'));
|
||||||
|
modal.show();
|
||||||
|
modal._dialog.querySelector('#message_text').focus();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user