Increase security and reformat
This commit is contained in:
@@ -475,7 +475,7 @@
|
||||
</button>
|
||||
<button type="submit" class="button is-info is-light" onclick="giaEngageSetAction('{{ person.id }}', 'queue');">
|
||||
<span class="icon is-small"><i class="fa-solid fa-inbox-in"></i></span>
|
||||
<span>Add To Queue</span>
|
||||
<span>Queue For Approval</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
@@ -867,35 +867,35 @@
|
||||
};
|
||||
|
||||
defineGlobal("giaMitigationToggleEdit", function(button) {
|
||||
const form = button && button.closest ? button.closest("form") : null;
|
||||
if (!form) return;
|
||||
const editing = button.dataset.editState === "edit";
|
||||
if (!editing) {
|
||||
form.querySelectorAll('[data-editable="1"]').forEach(function(field) { field.removeAttribute("readonly"); });
|
||||
form.querySelectorAll('[data-editable-toggle="1"]').forEach(function(field) { field.removeAttribute("disabled"); });
|
||||
const card = form.closest(".mitigation-artifact-card");
|
||||
if (card) card.classList.add("is-editing");
|
||||
button.dataset.editState = "edit";
|
||||
button.classList.remove("is-light");
|
||||
button.title = "Save";
|
||||
button.innerHTML = '<span class="icon is-small"><i class="fa-solid fa-check"></i></span>';
|
||||
resizeEditableTextareas(form);
|
||||
return;
|
||||
}
|
||||
form.requestSubmit();
|
||||
const form = button && button.closest ? button.closest("form") : null;
|
||||
if (!form) return;
|
||||
const editing = button.dataset.editState === "edit";
|
||||
if (!editing) {
|
||||
form.querySelectorAll('[data-editable="1"]').forEach(function(field) { field.removeAttribute("readonly"); });
|
||||
form.querySelectorAll('[data-editable-toggle="1"]').forEach(function(field) { field.removeAttribute("disabled"); });
|
||||
const card = form.closest(".mitigation-artifact-card");
|
||||
if (card) card.classList.add("is-editing");
|
||||
button.dataset.editState = "edit";
|
||||
button.classList.remove("is-light");
|
||||
button.title = "Save";
|
||||
button.innerHTML = '<span class="icon is-small"><i class="fa-solid fa-check"></i></span>';
|
||||
resizeEditableTextareas(form);
|
||||
return;
|
||||
}
|
||||
form.requestSubmit();
|
||||
});
|
||||
|
||||
defineGlobal("giaEngageSetAction", function(pid, action) {
|
||||
const actionInput = document.getElementById("engage-action-input-" + pid);
|
||||
if (actionInput) actionInput.value = action;
|
||||
if (action === "send") window.giaEngageSyncSendOverride(pid);
|
||||
const actionInput = document.getElementById("engage-action-input-" + pid);
|
||||
if (actionInput) actionInput.value = action;
|
||||
if (action === "send") window.giaEngageSyncSendOverride(pid);
|
||||
});
|
||||
|
||||
defineGlobal("giaEngageAutoPreview", function(pid) {
|
||||
const form = document.getElementById("engage-form-" + pid);
|
||||
if (!form) return;
|
||||
window.giaEngageSetAction(pid, "preview");
|
||||
form.requestSubmit();
|
||||
const form = document.getElementById("engage-form-" + pid);
|
||||
if (!form) return;
|
||||
window.giaEngageSetAction(pid, "preview");
|
||||
form.requestSubmit();
|
||||
});
|
||||
|
||||
window.giaEngageSetTarget = function(pid, targetId) {
|
||||
@@ -908,14 +908,14 @@
|
||||
};
|
||||
|
||||
defineGlobal("giaEngageSelect", function(pid, kind, value, node) {
|
||||
const inputId = kind === "share" ? ("engage-share-input-" + pid) : (kind === "framing" ? ("engage-framing-input-" + pid) : "");
|
||||
const input = inputId ? document.getElementById(inputId) : null;
|
||||
if (input) input.value = value;
|
||||
const li = node && node.closest ? node.closest("li") : null;
|
||||
if (!li || !li.parentElement) return;
|
||||
Array.from(li.parentElement.children).forEach(function(child) { child.classList.remove("is-active"); });
|
||||
li.classList.add("is-active");
|
||||
window.giaEngageAutoPreview(pid);
|
||||
const inputId = kind === "share" ? ("engage-share-input-" + pid) : (kind === "framing" ? ("engage-framing-input-" + pid) : "");
|
||||
const input = inputId ? document.getElementById(inputId) : null;
|
||||
if (input) input.value = value;
|
||||
const li = node && node.closest ? node.closest("li") : null;
|
||||
if (!li || !li.parentElement) return;
|
||||
Array.from(li.parentElement.children).forEach(function(child) { child.classList.remove("is-active"); });
|
||||
li.classList.add("is-active");
|
||||
window.giaEngageAutoPreview(pid);
|
||||
});
|
||||
|
||||
window.giaMitigationShowTab(personId, "{{ active_tab|default:'plan_board' }}");
|
||||
|
||||
Reference in New Issue
Block a user