Minor update to logic
This commit is contained in:
@@ -890,49 +890,72 @@ $effect(() => {
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
{#if $idaa_slct.archive_content_id && !$idaa_slct.archive_content_obj?.hosted_file_id}
|
{#if $idaa_slct.archive_content_id && !$idaa_slct.archive_content_obj?.hosted_file_id}
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
if (!confirm('Are you sure you want to delete this archive content?')) {return false;}
|
if (!confirm('Are you sure you want to remove this archive content?')) {return false;}
|
||||||
|
|
||||||
let method = 'disable';
|
let method = 'disable';
|
||||||
|
|
||||||
if ($ae_loc.administrator_access && $ae_loc.edit_mode) {
|
prom_api__archive_content_obj = archives_func.delete_ae_obj_id__archive_content({
|
||||||
// if (confirm('You have trusted access. Do you want to permanently delete this archive content? (OK = Permanent Delete, Cancel = Disable)')) {
|
api_cfg: $ae_api,
|
||||||
method = 'delete';
|
archive_content_id: $idaa_slct.archive_content_id,
|
||||||
// }
|
method: method,
|
||||||
}
|
log_lvl: log_lvl
|
||||||
|
});
|
||||||
|
|
||||||
prom_api__archive_content_obj = archives_func.delete_ae_obj_id__archive_content({
|
$idaa_slct.archive_content_id = null;
|
||||||
api_cfg: $ae_api,
|
$idaa_slct.archive_content_obj = {};
|
||||||
archive_content_id: $idaa_slct.archive_content_id,
|
$idaa_sess.archives.show__modal_edit__archive_content_id = false;
|
||||||
method: method,
|
$idaa_sess.archives.show__modal_view__archive_content_id = false;
|
||||||
log_lvl: log_lvl
|
}}
|
||||||
});
|
class="
|
||||||
|
novi_btn
|
||||||
$idaa_slct.archive_content_id = null;
|
btn btn-sm
|
||||||
$idaa_slct.archive_content_obj = {};
|
preset-filled-warning-200-800 hover:preset-filled-error-200-800
|
||||||
$idaa_sess.archives.show__modal_edit__archive_content_id = false;
|
transition
|
||||||
$idaa_sess.archives.show__modal_view__archive_content_id = false;
|
"
|
||||||
}}
|
title="Disable this archive content"
|
||||||
class="
|
>
|
||||||
novi_btn
|
<span class="fas fa-minus m-1"></span>
|
||||||
btn btn-sm
|
Remove
|
||||||
preset-filled-warning-200-800 hover:preset-filled-error-200-800
|
{#if $ae_loc.administrator_access}
|
||||||
transition
|
|
||||||
"
|
|
||||||
title="Disable this archive content"
|
|
||||||
>
|
|
||||||
<span class="fas fa-minus m-1"></span>
|
|
||||||
Delete
|
|
||||||
{#if $ae_loc.administrator_access}
|
|
||||||
{#if $ae_loc.edit_mode}
|
|
||||||
(Permanent Delete)
|
|
||||||
{:else}
|
|
||||||
(Disable)
|
(Disable)
|
||||||
{/if}
|
{/if}
|
||||||
|
</button>
|
||||||
|
|
||||||
|
{#if $ae_loc.administrator_access && $ae_loc.edit_mode}
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onclick={() => {
|
||||||
|
if (!confirm('Are you sure you want to delete this archive content?')) {return false;}
|
||||||
|
|
||||||
|
let method = 'delete';
|
||||||
|
|
||||||
|
prom_api__archive_content_obj = archives_func.delete_ae_obj_id__archive_content({
|
||||||
|
api_cfg: $ae_api,
|
||||||
|
archive_content_id: $idaa_slct.archive_content_id,
|
||||||
|
method: method,
|
||||||
|
log_lvl: log_lvl
|
||||||
|
});
|
||||||
|
|
||||||
|
$idaa_slct.archive_content_id = null;
|
||||||
|
$idaa_slct.archive_content_obj = {};
|
||||||
|
$idaa_sess.archives.show__modal_edit__archive_content_id = false;
|
||||||
|
$idaa_sess.archives.show__modal_view__archive_content_id = false;
|
||||||
|
}}
|
||||||
|
class="
|
||||||
|
novi_btn
|
||||||
|
btn btn-sm
|
||||||
|
preset-filled-warning-200-800 hover:preset-filled-error-200-800
|
||||||
|
transition
|
||||||
|
"
|
||||||
|
title="Delete this archive content"
|
||||||
|
>
|
||||||
|
<span class="fas fa-minus m-1"></span>
|
||||||
|
Delete
|
||||||
|
</button>
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
|
||||||
{:else if $idaa_slct.archive_content_obj.hosted_file_id}
|
{:else if $idaa_slct.archive_content_obj.hosted_file_id}
|
||||||
{#if $ae_loc.administrator_access}
|
{#if $ae_loc.administrator_access}
|
||||||
Can not delete. Remove hosted file first.
|
Can not delete. Remove hosted file first.
|
||||||
@@ -943,7 +966,3 @@ $effect(() => {
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
</section> <!-- END: section ae_edit archive_content_obj -->
|
</section> <!-- END: section ae_edit archive_content_obj -->
|
||||||
|
|
||||||
|
|
||||||
<style>
|
|
||||||
</style>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user