General clean up. Show menu instead of link to all journals list. For now it just includes the most recent Entries loaded.
This commit is contained in:
@@ -57,6 +57,8 @@ if (log_lvl) {
|
||||
// $journals_sess.entry_li = [];
|
||||
// $journals_slct.journal_id = ae_acct.slct.journal_id;
|
||||
|
||||
let show_menu__all_journals: boolean = $state(false);
|
||||
|
||||
let lq__journal_obj = $derived(liveQuery(async () => {
|
||||
if (log_lvl) {
|
||||
console.log(`lq__journal_obj: journal_id = ${$journals_slct?.journal_id}`);
|
||||
@@ -176,27 +178,103 @@ let lq__journal_obj = $derived(liveQuery(async () => {
|
||||
py-2
|
||||
w-full
|
||||
hover:bg-slate-100 hover:dark:bg-slate-700
|
||||
|
||||
relative transition-all
|
||||
"
|
||||
>
|
||||
<a href="/journals"
|
||||
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => {
|
||||
show_menu__all_journals = !show_menu__all_journals;
|
||||
}}
|
||||
class="
|
||||
btn btn-sm
|
||||
preset-tonal-tertiary
|
||||
preset-outlined-tertiary-600-400
|
||||
hover:preset-outlined-tertiary-700-300
|
||||
hover:preset-filled-tertiary-100-900
|
||||
hover:preset-filled-tertiary-300-700
|
||||
transition-all
|
||||
"
|
||||
title="View all journals for this account: {$ae_loc.account_name}"
|
||||
title="View all journals menu: {$ae_loc.account_name}"
|
||||
>
|
||||
<!-- <BookHeart /> -->
|
||||
<!-- <Library /> -->
|
||||
<SquareLibrary class="text-gray-500"/>
|
||||
{#if show_menu__all_journals}
|
||||
<X class="text-orange-500"/>
|
||||
{:else}
|
||||
<SquareLibrary class="text-gray-500"/>
|
||||
{/if}
|
||||
<span class="hidden md:inline">
|
||||
All Journals
|
||||
Journals
|
||||
</span>
|
||||
|
||||
</a>
|
||||
</button>
|
||||
|
||||
|
||||
<div
|
||||
class="
|
||||
absolute top-12 left-0
|
||||
p-4 z-50 w-80
|
||||
space-y-0.5
|
||||
bg-white dark:bg-gray-800
|
||||
border border-gray-500
|
||||
shadow-xl rounded-lg
|
||||
min-w-72
|
||||
max-w-fit
|
||||
"
|
||||
class:hidden={show_menu__all_journals}
|
||||
>
|
||||
<a href="/journals"
|
||||
class="
|
||||
btn btn-sm
|
||||
preset-tonal-tertiary
|
||||
preset-outlined-tertiary-600-400
|
||||
hover:preset-outlined-tertiary-700-300
|
||||
hover:preset-filled-tertiary-300-700
|
||||
transition-all
|
||||
"
|
||||
title="View all journals for this account: {$ae_loc.account_name}"
|
||||
>
|
||||
<!-- <BookHeart /> -->
|
||||
<!-- <Library /> -->
|
||||
<SquareLibrary class="text-blue-500"/>
|
||||
<span class="">
|
||||
All Journals
|
||||
</span>
|
||||
|
||||
</a>
|
||||
|
||||
<!-- List of recent entries here... -->
|
||||
<!-- $journals_loc.entry_view_history_li -->
|
||||
{#if $journals_loc?.entry_view_history_li?.length > 0}
|
||||
<select
|
||||
bind:value={$journals_slct.journal_entry_id}
|
||||
onchange={() => {
|
||||
if ($journals_slct.journal_entry_id) {
|
||||
goto(`/journals/${$journals_slct?.journal_id}/entry/${$journals_slct.journal_entry_id}`);
|
||||
}
|
||||
}}
|
||||
class="
|
||||
form-select
|
||||
w-full
|
||||
text-sm
|
||||
border border-neutral-400-600
|
||||
p-1
|
||||
"
|
||||
>
|
||||
<option value="" disabled selected>
|
||||
Recent Entries...
|
||||
</option>
|
||||
{#each $journals_loc.entry_view_history_li as entry (entry.id)}
|
||||
<option value={entry.id}>
|
||||
{entry.name}
|
||||
</option>
|
||||
{/each}
|
||||
</select>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
|
||||
{#if $journals_slct?.journal_entry_id}
|
||||
<a
|
||||
@@ -205,7 +283,8 @@ let lq__journal_obj = $derived(liveQuery(async () => {
|
||||
btn btn-sm
|
||||
preset-tonal-tertiary
|
||||
preset-outlined-tertiary-600-400
|
||||
hover:preset-filled-tertiary-100-900
|
||||
hover:preset-outlined-tertiary-700-300
|
||||
hover:preset-filled-tertiary-300-700
|
||||
transition-all
|
||||
"
|
||||
title="View all journal entries for this journal: {$lq__journal_obj?.name}"
|
||||
@@ -303,7 +382,8 @@ let lq__journal_obj = $derived(liveQuery(async () => {
|
||||
btn btn-sm
|
||||
preset-tonal-tertiary
|
||||
preset-outlined-tertiary-600-400
|
||||
hover:preset-filled-tertiary-100-900
|
||||
hover:preset-outlined-tertiary-700-300
|
||||
hover:preset-filled-tertiary-300-700
|
||||
transition-all
|
||||
"
|
||||
title="Create a new journal entry for this journal: {$lq__journal_obj?.name}"
|
||||
|
||||
Reference in New Issue
Block a user