From 7fd8c976bf325403fb4b90cb5c32697f443c465b Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Mon, 4 May 2026 17:35:36 -0400 Subject: [PATCH] Hide empty journal attachments --- .../ae_comp__journal_entry_obj_file_li.svelte | 233 +++++++++--------- 1 file changed, 115 insertions(+), 118 deletions(-) diff --git a/src/routes/journals/ae_comp__journal_entry_obj_file_li.svelte b/src/routes/journals/ae_comp__journal_entry_obj_file_li.svelte index e84c52fd..b07a980a 100644 --- a/src/routes/journals/ae_comp__journal_entry_obj_file_li.svelte +++ b/src/routes/journals/ae_comp__journal_entry_obj_file_li.svelte @@ -191,124 +191,121 @@ async function handle_remove_file(file_id: string) { } -
- -
-

- - Attachments - {#if unified_file_li.length} - {unified_file_li.length} - {/if} -

- - {#if $ae_loc.edit_mode} - - {/if} -
- - - {#if unified_file_li.length} -
- {#each unified_file_li as file (file.hosted_file_id ?? file.id)} - {@const file_id = - file.hosted_file_id || file.id || file.hosted_file_id} -
-
- -
- -
- {#if $ae_loc.edit_mode} - - {/if} -
-
- {/each} -
- {:else if !$ae_loc.edit_mode} -

- No files attached to this entry. -

- {/if} - - - {#if $ae_loc.edit_mode} +{#if $ae_loc.edit_mode || unified_file_li.length > 0} +
+
- {#if $ae_sess.files.add_to_use_files_method === 'upload'} - - {#snippet label()} -
-
- -
-
-

Upload new attachment

-

- Drag and drop or click to browse -

-
-
- {/snippet} -
- {:else} -
-

- Select from existing hosted files: -

- -
+ class="border-surface-500/20 flex items-center justify-between border-b pb-2"> +

+ + Attachments + {#if unified_file_li.length} + {unified_file_li.length} + {/if} +

+ + {#if $ae_loc.edit_mode} + {/if}
- {/if} -
+ + + {#if unified_file_li.length} +
+ {#each unified_file_li as file (file.hosted_file_id ?? file.id)} + {@const file_id = + file.hosted_file_id || file.id || file.hosted_file_id} +
+
+ +
+ +
+ {#if $ae_loc.edit_mode} + + {/if} +
+
+ {/each} +
+ {/if} + + + {#if $ae_loc.edit_mode} +
+ {#if $ae_sess.files.add_to_use_files_method === 'upload'} + + {#snippet label()} +
+
+ +
+
+

Upload new attachment

+

+ Drag and drop or click to browse +

+
+
+ {/snippet} +
+ {:else} +
+

+ Select from existing hosted files: +

+ +
+ {/if} +
+ {/if} +
+{/if}