Skip to content

Commit

Permalink
Polish styles, text, signposting, localize metadata label
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Apr 25, 2024
1 parent e9f65a7 commit 2178716
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ const addHeader = (event: FileUploadBeforeSendEvent) => {
:alt="image.metadata[0]?.alt"
width="200"
>
<span
v-if="!item.images.length"
:style="{ fontSize: 'small'}"
>
{{ $gettext("No images.") }}
</span>
</div>
<FileUpload
accept="image/*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const languageName = (code: string) => {
<Column
field="language_id"
:header="$gettext('Language')"
style="width: 10%; min-width: 8rem; height: 4rem;"
style="width: 10%; min-width: 8rem; height: 4rem; padding-left: 1rem;"
>
<template #editor="{ data, field }">
<Dropdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ const heading = computed(() => {
return $gettext(
"List Editor > %{listName}",
{ listName: displayedRow.value.name },
true, // disable HTML escaping: RDM Admins are trusted users
);
}
return $gettext(
"Item Editor > %{bestLabel}",
{ bestLabel: bestLabel(displayedRow.value, selectedLanguage.value.code).value },
true, // disable HTML escaping: RDM Admins are trusted users
);
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const { $gettext } = useGettext();
class="fa fa-reply"
aria-hidden="true"
/>
{{ $gettext("Edit node") }}
{{ $gettext("Edit graph") }}
</a>
</span>
</template>
Expand Down
1 change: 1 addition & 0 deletions arches/app/src/types/ControlledListManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type ControlledListItemImageMetadata = {
controlled_list_image_id: string,
language_id: string,
metadata_type: string,
metadata_label: string,
};

export type ControlledListItemImage = {
Expand Down
4 changes: 4 additions & 0 deletions arches/app/views/controlled_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,13 @@ def serialize(obj, depth_map=None, flat=False):
]
}
case ControlledListItemImageMetadata():
choices = ControlledListItemImageMetadata.MetadataChoices
return {
field: str(value)
for (field, value) in vars(obj).items() if not field.startswith("_")
} | {
# Get localized label for metadata type
"metadata_label": str(choices(obj.metadata_type).label)
}


Expand Down

0 comments on commit 2178716

Please sign in to comment.