Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/src/dto/ContentDto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,9 @@ export class ContentDto extends _contentBaseDto {
@IsString()
@Expose()
parentImageBucketId?: string; // Inherited from parent Post/Tag for image storage

@IsOptional()
@IsString()
@Expose()
copyright?: string;
}
6 changes: 6 additions & 0 deletions app/src/pages/SingleContent/SingleContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,12 @@ const quickLanguageSwitch = (languageId: string) => {
>
By {{ content.author }}
</div>
<div
v-if="(content as any).copyright"
class="text-center text-xs text-zinc-500 dark:text-slate-300"
>
{{ (content as any).copyright }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should only in very exeptional cases cast a variable as "any" as this bypasses type checking and can cause runtime errors.

</div>
<div
class="text-center text-xs text-zinc-500 dark:text-slate-300"
v-if="content.publishDate && content.parentPublishDateVisible"
Expand Down
13 changes: 13 additions & 0 deletions cms/src/components/content/EditContentBasic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,19 @@ const clearExpiryDate = () => {
</div>
</div>

<!-- Copyright -->
<div class="mt-2 flex items-center gap-5">
<FormLabel class="whitespace-nowrap">Copyright</FormLabel>
<LInput
name="copyright"
:disabled="disabled"
inputType="textarea"
placeholder="© 2024 My Company"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the placeholder.

v-model="(content as any).copyright"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment on casting as "any"

class="flex-1"
/>
</div>

<!-- Status -->
<div class="mt-2 flex items-center justify-between gap-2">
<FormLabel class="self-start py-2">Status</FormLabel>
Expand Down
14 changes: 3 additions & 11 deletions cms/src/components/forms/LCombobox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ onClickOutside(
() => {
showDropdown.value = false;
},
{ ignore: [dropdown] },
{ ignore: [dropdown, triggerRef] },
);

const highlightedIndex = ref(-1);
Expand Down Expand Up @@ -111,15 +111,6 @@ const toggle = () => {
});
};

const open = () => {
if (!showDropdown.value) {
showDropdown.value = true;
}
nextTick(() => {
inputElement.value?.focus();
});
};

watch(showEditModal, (newVal) => {
if (newVal) {
nextTick(() => {
Expand Down Expand Up @@ -223,7 +214,7 @@ const placementClass = computed(() => {
class="relative flex justify-between gap-2 rounded-md border-[1px] border-zinc-300 bg-white pl-3 pr-8 focus-within:outline focus-within:outline-offset-[-2px] focus-within:outline-zinc-950"
tabindex="0"
v-bind="attrsWithoutStyles"
@click="open()"
@click="toggle()"
>
<div class="flex items-center justify-center gap-2">
<div v-if="icon" class="flex items-center">
Expand Down Expand Up @@ -311,6 +302,7 @@ const placementClass = computed(() => {
class="overflow-y-auto rounded-md bg-white shadow-md focus:outline-none"
:class="[placementClass, 'max-h-48']"
data-test="options"
@click.self="showDropdown = false"
@wheel.stop
@touchmove.stop
>
Expand Down
1 change: 1 addition & 0 deletions shared/src/types/dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export type ContentDto = ContentBaseDto & {
parentTaggedDocs?: Uuid[];
availableTranslations?: Uuid[];
parentImageBucketId?: Uuid;
copyright?: string;
};

export type ContentParentDto = ContentBaseDto & {
Expand Down
Loading