Fix Signal messages and replies
This commit is contained in:
@@ -81,20 +81,33 @@
|
||||
<span>Commands</span>
|
||||
</button>
|
||||
<div class="compose-command-menu-panel is-hidden">
|
||||
<p class="is-size-7 has-text-grey" style="margin-bottom: 0.45rem;">
|
||||
This chat currently has {{ bp_binding_summary.ingress_count }} ingress and {{ bp_binding_summary.egress_count }} egress bindings for bp.
|
||||
</p>
|
||||
{% for option in command_options %}
|
||||
<label class="compose-command-option">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="compose-command-toggle"
|
||||
data-command-slug="{{ option.slug }}"
|
||||
data-command-slug="{{ option.toggle_slug|default:option.slug }}"
|
||||
data-command-row-slug="{{ option.slug }}"
|
||||
{% if option.enabled_here %}checked{% endif %}>
|
||||
<span class="compose-command-option-title">{{ option.name }}</span>
|
||||
{% if option.mode_label %}
|
||||
<span class="tag is-light is-info is-rounded compose-command-option-badge">{{ option.mode_label }}</span>
|
||||
{% endif %}
|
||||
{% if option.enabled_label %}
|
||||
<span class="tag is-light is-rounded compose-command-option-badge">{{ option.enabled_label }}</span>
|
||||
{% endif %}
|
||||
{% if option.trigger_token %}
|
||||
<span class="compose-command-option-token">{{ option.trigger_token }}</span>
|
||||
{% endif %}
|
||||
</label>
|
||||
{% endfor %}
|
||||
<a class="compose-command-settings-link" href="{% url 'command_routing' %}">Open command routing</a>
|
||||
<p class="help" style="margin-top: 0.5rem;">
|
||||
Enabling a command in this menu enables ingress and egress for this chat identifier.
|
||||
</p>
|
||||
<a class="compose-command-settings-link" href="{% if command_routing_scoped_url %}{{ command_routing_scoped_url }}{% else %}{% url 'command_routing' %}{% endif %}">Open command routing</a>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="button is-light is-rounded compose-export-toggle" aria-expanded="false">
|
||||
@@ -153,6 +166,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if signal_ingest_warning %}
|
||||
<article class="message is-warning is-light" style="margin-top: 0.75rem; margin-bottom: 0.75rem;">
|
||||
<div class="message-body is-size-7">
|
||||
{{ signal_ingest_warning }}
|
||||
</div>
|
||||
</article>
|
||||
{% endif %}
|
||||
|
||||
<div id="{{ panel_id }}-status" class="compose-status">
|
||||
{% include "partials/compose-send-status.html" %}
|
||||
</div>
|
||||
@@ -903,6 +924,12 @@
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
font-size: 0.68rem;
|
||||
}
|
||||
#{{ panel_id }} .compose-command-option-badge {
|
||||
font-size: 0.62rem;
|
||||
padding: 0 0.42rem;
|
||||
height: 1.15rem;
|
||||
line-height: 1.15rem;
|
||||
}
|
||||
#{{ panel_id }} .compose-command-settings-link {
|
||||
margin-top: 0.2rem;
|
||||
font-size: 0.72rem;
|
||||
@@ -2154,6 +2181,13 @@
|
||||
return;
|
||||
}
|
||||
const shouldEnable = !!checkbox.checked;
|
||||
if (shouldEnable) {
|
||||
const confirmText = "Enable this command for this chat and route output to configured egress channels?";
|
||||
if (!window.confirm(confirmText)) {
|
||||
checkbox.checked = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
checkbox.disabled = true;
|
||||
try {
|
||||
const params = queryParams({
|
||||
@@ -2173,6 +2207,9 @@
|
||||
String(result.message || (slug + (shouldEnable ? " enabled." : " disabled."))),
|
||||
"success"
|
||||
);
|
||||
menu.querySelectorAll('.compose-command-toggle[data-command-slug=\"' + slug + '\"]').forEach(function (peer) {
|
||||
peer.checked = shouldEnable;
|
||||
});
|
||||
} catch (err) {
|
||||
checkbox.checked = !shouldEnable;
|
||||
setStatus("Failed to update command binding.", "danger");
|
||||
|
||||
@@ -22,22 +22,24 @@
|
||||
<td>
|
||||
<div class="buttons">
|
||||
<button
|
||||
type="button"
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
{% if account_unlink_url_name %}
|
||||
hx-delete="{% url account_unlink_url_name type=type account=item %}"
|
||||
hx-post="{% url account_unlink_url_name type=type account=item %}"
|
||||
hx-trigger="click"
|
||||
hx-target="#{{ context_object_name|slugify }}-panel"
|
||||
hx-swap="outerHTML"
|
||||
{% endif %}
|
||||
{% if account_unlink_url_name %}
|
||||
hx-confirm="Are you sure you wish to unlink {{ item }}?"
|
||||
hx-confirm="Unlink {{ item }} from this bridge client so you can relink by scanning a new QR code?"
|
||||
{% endif %}
|
||||
class="button"
|
||||
class="button is-light"
|
||||
{% if not account_unlink_url_name %}disabled{% endif %}>
|
||||
<span class="icon-text">
|
||||
<span class="icon">
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
<i class="fa-solid fa-rotate"></i>
|
||||
</span>
|
||||
<span>{{ account_unlink_label|default:"Unlink" }}</span>
|
||||
</span>
|
||||
</button>
|
||||
{% if show_contact_actions %}
|
||||
@@ -97,9 +99,15 @@
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
{% if account_unlink_label == "Relink" %}
|
||||
<p class="help" style="margin-bottom: 0.6rem;">
|
||||
Relink flow: click <strong>Relink</strong> on the current account, then use
|
||||
<strong>Add account</strong> below to generate and scan a fresh QR code.
|
||||
</p>
|
||||
{% endif %}
|
||||
<form
|
||||
hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'
|
||||
hx-post="{% url account_add_url_name type=type %}"
|
||||
hx-post="{% url account_add_url_name type=account_add_type|default:type %}"
|
||||
hx-target="{% if account_add_target %}{{ account_add_target }}{% else %}#widgets-here{% endif %}"
|
||||
hx-swap="{% if account_add_swap %}{{ account_add_swap }}{% else %}innerHTML{% endif %}">
|
||||
{% csrf_token %}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{% load cache %}
|
||||
{% include 'mixins/partials/notify.html' %}
|
||||
{% cache 600 objects_signal_chats request.user.id object_list type %}
|
||||
<table
|
||||
class="table is-fullwidth is-hoverable"
|
||||
hx-target="#{{ context_object_name }}-table"
|
||||
@@ -146,4 +144,3 @@
|
||||
{% endfor %}
|
||||
|
||||
</table>
|
||||
{% endcache %}
|
||||
|
||||
Reference in New Issue
Block a user