diff --git a/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte b/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte index 3a0fe028..6b79dacf 100644 --- a/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte +++ b/src/routes/journals/ae_comp__journal_entry_obj_id_view.svelte @@ -615,73 +615,69 @@ function handle_cut_string(old_string: string) {
-
- - - // if ($ae_loc.trusted_access && !$journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id]) { - // trigger_decrypt = true; - // } - }} - class="btn btn-icon-sm inline-block" - title="Toggle edit mode for this journal entry" - > - {#if $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id]} - - +

+ + + + + {#if $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] == 'current'} + {:else} - - {/if} - - -

- - - - - {#if $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id]} - + {#if ($lq__journal_entry_obj?.name)} + + {@html $lq__journal_entry_obj?.name} {:else} - {#if ($lq__journal_entry_obj?.name)} - - {@html $lq__journal_entry_obj?.name} - {:else} - - {ae_util.iso_datetime_formatter($lq__journal_entry_obj?.created_on, 'datetime_iso_12_no_seconds')} - {/if} + + {ae_util.iso_datetime_formatter($lq__journal_entry_obj?.created_on, 'datetime_iso_12_no_seconds')} {/if} - + {/if} + -

-

+ +
- {#if $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id]} -
+ {#if $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] == 'current'} +
@@ -718,7 +714,7 @@ function handle_cut_string(old_string: string) { {/if} - {#if $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id]} + {#if $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] == 'current'} - +
@@ -758,7 +754,7 @@ function handle_cut_string(old_string: string) { {/each} - +
{:else} @@ -768,7 +764,7 @@ function handle_cut_string(old_string: string) { type="button" onclick={() => { // Toggle edit mode - $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] = true; + $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] = 'current'; // tmp_entry_obj.category_code = $lq__journal_entry_obj.category_code; console.log('Editing category:', tmp_entry_obj.category_code); }} @@ -790,11 +786,11 @@ function handle_cut_string(old_string: string) { @@ -1137,6 +1133,47 @@ function handle_cut_string(old_string: string) {
+ + {#if $ae_loc.edit_mode && $lq__journal_obj_li?.length} +
+ + + + + + + +
+ {/if}
{/if} @@ -1150,228 +1187,338 @@ function handle_cut_string(old_string: string) {
- - - - + + - - - + + + + + + + + {/if} - - + - decrypted_content = await handle_decrypt_string(tmp_entry_obj?.content_encrypted, journal_key); - tmp_entry_obj.content = decrypted_content; - console.log('TEST: Decrypted content:', decrypted_content); - } else { - return false; + + + + + + + + + + - - - {/if} - - + }} + class="btn-icon btn-icon-sm variant-soft-secondary hover:variant-filled-secondary transition" + title="Toggle shared visibility of this journal entry" + > + {#if $lq__journal_entry_obj?.shared} + + {:else} + + {/if} + --> - + + {#if ($lq__journal_entry_obj?.history || $lq__journal_entry_obj?.history_encrypted)} +
+ - - - + // if ($journals_sess.show__content__journal_entry_history == 'view') { + // $journals_sess.show__content__journal_entry_history = 'hide'; + // } else if ($journals_sess.show__content__journal_entry_history == 'edit') { + // $journals_sess.show__content__journal_entry_history = 'hide'; + // } else if ($journals_sess.show__content__journal_entry_history == 'hide') { + // $journals_sess.show__content__journal_entry_history = 'view'; + // } else if (!$journals_sess.show__content__journal_entry_history) { + // $journals_sess.show__content__journal_entry_history = 'view'; + // } - + // !tmp_entry_obj?.history && + if (tmp_entry_obj?.history_encrypted) { + decrypted_history = await handle_decrypt_string(tmp_entry_obj.history_encrypted, journal_key); + console.log('Decrypted history:', decrypted_history); + tmp_entry_obj.history = decrypted_history; + } + + }} + class:variant-filled-secondary={$journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] == 'history'} + class:variant-soft-secondary={$journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] != 'history'} + class="btn btn-sm hover:variant-filled-secondary *:hover:inline lg:text-xs" + title="Toggle history of this journal entry" + > + {#if !$journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] || $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] == 'current'} + + {:else if $journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] == 'history'} + + {/if} + + + + + + +
+ {/if}
@@ -1397,10 +1544,7 @@ tabindex={$ae_loc.edit_mode ? 0 : -1} --> > {#if (!$journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id])} -
+ {#if ($lq__journal_entry_obj?.content_encrypted && !decrypted_content)}
bg-slate-100 text-gray-900 dark:bg-slate-900 dark:text-gray-100 shadow-lg rounded-lg - border border-gray-200 dark:border-gray-700 - hover:border-gray-500 dark:hover:border-gray-500 + border border-orange-200 dark:border-orange-700 + hover:border-orange-500 dark:hover:border-orange-500 " placeholder="Edit journal entry content here..." > @@ -1557,91 +1700,7 @@ tabindex={$ae_loc.edit_mode ? 0 : -1} --> {/if} - -{/if} - - - - - -{#if ($lq__journal_entry_obj?.history || $lq__journal_entry_obj?.history_encrypted)} -
-
- - - - -
+{:else if ($journals_loc.entry.edit_kv[$lq__journal_entry_obj?.journal_entry_id] == 'history')}
- {#if $journals_sess?.show__content__journal_entry_history == 'view'} -
- {@html tmp_entry_obj?.history_md_html} -
- {:else if $journals_sess?.show__content__journal_entry_history == 'edit'} - - {/if} + {#if $journals_sess?.show__content__journal_entry_history == 'view'} +
+ {@html tmp_entry_obj?.history_md_html} +
+ {:else if $journals_sess?.show__content__journal_entry_history == 'edit'} + + {/if}
-
+ + + {/if} + + + + + + + +
-->
- - - - - - - - - - {#if $lq__journal_entry_obj?.sort} - {$lq__journal_entry_obj.sort} - {:else} - - - {/if} - - - - - - - { - update_journal_entry(); - }} - class:hidden={!$ae_loc.edit_mode} - class="input input-sm input-bordered w-24" - title="Set group (for sorting) of this journal entry" - /> - - - - - { - update_journal_entry(); - }} - class:hidden={!$ae_loc.edit_mode} - class="input input-sm input-bordered w-auto border-none" - title="Set archive on datetime for archiving this journal entry" - /> - - {#if $lq__journal_entry_obj?.archive_on} - - - {:else} - - - {/if} - - - - - - - - - - - {#if !$ae_loc.edit_mode} @@ -1941,43 +1796,7 @@ tabindex={$ae_loc.edit_mode ? 0 : -1} --> - -{#if $ae_loc.edit_mode && $lq__journal_obj_li?.length} -
- - - -
-{/if}