remove unused extra notes
This commit is contained in:
parent
13110044eb
commit
711407bc58
@ -12,7 +12,7 @@ function initSubscriptionsModule() {
|
||||
{
|
||||
title: "Name",
|
||||
data: "name",
|
||||
className: "text-truncate",
|
||||
className: "text-truncate col-3",
|
||||
render: function(data, type, row) {
|
||||
const name = sanitise(data);
|
||||
return `<button type="button" class="btn btn-link text-start text-decoration-none edit-modal">${name}</button>`;
|
||||
@ -21,7 +21,7 @@ function initSubscriptionsModule() {
|
||||
{
|
||||
title: "URL",
|
||||
data: "url",
|
||||
className: "text-truncate",
|
||||
className: "text-truncate col-4",
|
||||
render: function(data, type) {
|
||||
const url = sanitise(data);
|
||||
return `<a href="${url}" class="btn btn-link text-start text-decoration-none" target="_blank">${url}</a>`;
|
||||
@ -30,7 +30,7 @@ function initSubscriptionsModule() {
|
||||
{
|
||||
title: "Rules",
|
||||
data: "unique_rules",
|
||||
className: "text-center text-nowrap",
|
||||
className: "text-center text-nowrap col-1",
|
||||
render: function(data, type) {
|
||||
let badges = $("<div>");
|
||||
data.forEach(function(rule, idx) {
|
||||
@ -45,6 +45,7 @@ function initSubscriptionsModule() {
|
||||
{
|
||||
title: "Created At",
|
||||
data: "created_at",
|
||||
className: "col-3",
|
||||
render: function(data, type) {
|
||||
let dateTime = new Date(data);
|
||||
return $(`
|
||||
@ -58,29 +59,11 @@ function initSubscriptionsModule() {
|
||||
`).popover()[0];
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "Notes",
|
||||
data: "extra_notes",
|
||||
orderable: false,
|
||||
className: "text-center",
|
||||
render: function(data, type) {
|
||||
if (!data) { return "" }
|
||||
const extraNotes = sanitise(data);
|
||||
return $(`
|
||||
<i class="bi bi-chat-left-text"
|
||||
data-bs-trigger="hover focus"
|
||||
data-bs-toggle="popover"
|
||||
data-bs-title="Extra Notes"
|
||||
data-bs-content="${extraNotes}">
|
||||
</i>
|
||||
`).popover()[0];
|
||||
}
|
||||
},
|
||||
{
|
||||
title: "Active",
|
||||
title: "Enabled",
|
||||
data: "active",
|
||||
orderable: false,
|
||||
className: "text-center form-switch",
|
||||
className: "text-center form-switch col-1",
|
||||
render: function(data, type) {
|
||||
return `<input type="checkbox" class="sub-toggle-active form-check-input ms-0" ${data ? "checked" : ""} />`
|
||||
}
|
||||
@ -147,11 +130,11 @@ async function openSubModal(id) {
|
||||
if (type === "checkbox") {
|
||||
$(this).prop("checked", defaultVal === "true");
|
||||
}
|
||||
else if ($(this).is("select")) {
|
||||
$(this).val(defaultVal).change();
|
||||
else if (type === "datetime-local") {
|
||||
$(this).val(getCurrentDateTime());
|
||||
}
|
||||
else {
|
||||
$(this).val(defaultVal);
|
||||
$(this).val(defaultVal).change();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -159,7 +142,7 @@ async function openSubModal(id) {
|
||||
$modal.find(".form-create").hide();
|
||||
$modal.find(".form-edit").show();
|
||||
|
||||
let data = await ajaxRequest(`/api/subscriptions/${id}/`, "GET");
|
||||
const data = await ajaxRequest(`/api/subscriptions/${id}/`, "GET");
|
||||
|
||||
$modal.find("[data-field]").each(function() {
|
||||
const key = $(this).attr("data-field");
|
||||
@ -172,7 +155,7 @@ async function openSubModal(id) {
|
||||
$(this).val(value.split('+')[0].substring(0, 16));
|
||||
}
|
||||
else {
|
||||
$(this).val(value);
|
||||
$(this).val(value).change();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -180,6 +163,7 @@ async function openSubModal(id) {
|
||||
$modal.modal("show");
|
||||
}
|
||||
|
||||
|
||||
// region Load Modal Options
|
||||
|
||||
$(document).on("selectedServerChange", async function() {
|
||||
@ -187,7 +171,7 @@ $(document).on("selectedServerChange", async function() {
|
||||
});
|
||||
|
||||
async function loadMessageStyleOptions() {
|
||||
let = $input = $(subModalId).find('[data-field="message_style"]');
|
||||
let $input = $(subModalId).find('[data-field="message_style"]');
|
||||
|
||||
// Disable and clear input
|
||||
$input.val("").change();
|
||||
|
Loading…
x
Reference in New Issue
Block a user