Minor update to logic
This commit is contained in:
@@ -890,49 +890,72 @@ $effect(() => {
|
||||
</button>
|
||||
|
||||
{#if $idaa_slct.archive_content_id && !$idaa_slct.archive_content_obj?.hosted_file_id}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
if (!confirm('Are you sure you want to delete this archive content?')) {return false;}
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
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) {
|
||||
// if (confirm('You have trusted access. Do you want to permanently delete this archive content? (OK = Permanent Delete, Cancel = Disable)')) {
|
||||
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
|
||||
});
|
||||
|
||||
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="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}
|
||||
$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="Disable this archive content"
|
||||
>
|
||||
<span class="fas fa-minus m-1"></span>
|
||||
Remove
|
||||
{#if $ae_loc.administrator_access}
|
||||
(Disable)
|
||||
{/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}
|
||||
</button>
|
||||
{:else if $idaa_slct.archive_content_obj.hosted_file_id}
|
||||
{#if $ae_loc.administrator_access}
|
||||
Can not delete. Remove hosted file first.
|
||||
@@ -943,7 +966,3 @@ $effect(() => {
|
||||
</form>
|
||||
|
||||
</section> <!-- END: section ae_edit archive_content_obj -->
|
||||
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user