Fix Signal receiving
This commit is contained in:
@@ -13,7 +13,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="level-right">
|
||||
<a class="button is-light" href="{% url 'compose_workspace' %}">
|
||||
<form id="create-all-form" method="post" action="{% url 'compose_contact_create_all' %}">
|
||||
{% csrf_token %}
|
||||
<button
|
||||
type="submit"
|
||||
class="button is-info is-light js-create-all"
|
||||
id="create-all-btn"
|
||||
title="Create persons for all unlinked contacts with detected names">
|
||||
<span class="icon is-small"><i class="fa-solid fa-user-plus"></i></span>
|
||||
<span>Create All</span>
|
||||
</button>
|
||||
</form>
|
||||
<a class="button is-light ml-2" href="{% url 'compose_workspace' %}">
|
||||
<span class="icon is-small"><i class="fa-solid fa-table-cells-large"></i></span>
|
||||
<span>Manual Workspace</span>
|
||||
</a>
|
||||
@@ -187,23 +198,43 @@
|
||||
</td>
|
||||
<td data-discovered-col="3" class="discovered-col-3"><code>{{ row.identifier }}</code></td>
|
||||
<td data-discovered-col="4" class="discovered-col-4">
|
||||
{% if not row.linked_person and row.suggestions %}
|
||||
{% if not row.linked_person %}
|
||||
<div class="buttons are-small">
|
||||
{% for suggestion in row.suggestions %}
|
||||
<form method="post" style="display: inline-flex;">
|
||||
{% if row.detected_name %}
|
||||
<form method="post" action="{% url 'compose_contact_create' %}" style="display: inline-flex;">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="service" value="{{ row.service }}">
|
||||
<input type="hidden" name="identifier" value="{{ row.identifier }}">
|
||||
<input type="hidden" name="person_id" value="{{ suggestion.person.id }}">
|
||||
<input type="hidden" name="person_name" value="{{ row.detected_name }}">
|
||||
<button
|
||||
type="submit"
|
||||
class="button is-small is-success is-light is-rounded"
|
||||
title="Accept suggested match">
|
||||
<span class="icon is-small"><i class="fa-solid fa-check"></i></span>
|
||||
<span>{{ suggestion.person.name }}</span>
|
||||
class="button is-small is-info is-light js-create-contact"
|
||||
data-service="{{ row.service }}"
|
||||
data-identifier="{{ row.identifier }}"
|
||||
data-name="{{ row.detected_name }}"
|
||||
title="Create new person from detected name">
|
||||
<span class="icon is-small"><i class="fa-solid fa-plus"></i></span>
|
||||
<span>Create</span>
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if row.suggestions %}
|
||||
{% for suggestion in row.suggestions %}
|
||||
<form method="post" style="display: inline-flex;">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="service" value="{{ row.service }}">
|
||||
<input type="hidden" name="identifier" value="{{ row.identifier }}">
|
||||
<input type="hidden" name="person_id" value="{{ suggestion.person.id }}">
|
||||
<button
|
||||
type="submit"
|
||||
class="button is-small is-success is-light is-rounded"
|
||||
title="Accept suggested match">
|
||||
<span class="icon is-small"><i class="fa-solid fa-check"></i></span>
|
||||
<span>{{ suggestion.person.name }}</span>
|
||||
</button>
|
||||
</form>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<span class="has-text-grey">-</span>
|
||||
@@ -436,6 +467,41 @@
|
||||
if (ev.key === "Escape") hidePopover();
|
||||
});
|
||||
|
||||
document.querySelectorAll(".js-create-contact").forEach((btn) => {
|
||||
btn.addEventListener("click", function (ev) {
|
||||
const name = this.dataset.name || "this contact";
|
||||
const identifier = this.dataset.identifier || "";
|
||||
const service = this.dataset.service || "";
|
||||
const confirmMsg = "Create new person '" + name + "' and link to " + identifier + " (" + service + ")?";
|
||||
if (!confirm(confirmMsg)) {
|
||||
ev.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const createAllBtn = document.getElementById("create-all-btn");
|
||||
if (createAllBtn) {
|
||||
createAllBtn.addEventListener("click", function (ev) {
|
||||
const table = document.getElementById("discovered-contacts-table");
|
||||
if (!table) return;
|
||||
const unlinkedWithName = table.querySelectorAll("tbody tr").filter((row) => {
|
||||
const statusCell = row.querySelector('[data-discovered-col="5"]');
|
||||
return statusCell && statusCell.textContent.includes("unlinked");
|
||||
}).length;
|
||||
if (unlinkedWithName === 0) {
|
||||
ev.preventDefault();
|
||||
alert("No unlinked contacts with detected names to create.");
|
||||
return false;
|
||||
}
|
||||
const confirmMsg = "Create " + unlinkedWithName + " new contact" + (unlinkedWithName > 1 ? "s" : "") + " from detected names?";
|
||||
if (!confirm(confirmMsg)) {
|
||||
ev.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
applyFilters();
|
||||
applyColumns();
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user