diff --git a/src/app/features/public-form/public-form-config.ts b/src/app/features/public-form/public-form-config.ts index 5672c95309..fc2a56e65a 100644 --- a/src/app/features/public-form/public-form-config.ts +++ b/src/app/features/public-form/public-form-config.ts @@ -15,6 +15,14 @@ export class PublicFormConfig extends Entity { static override route = "admin/public-form"; static override toStringAttributes = ["title"]; + @DatabaseField({ + label: $localize`:PublicFormConfig:Form Logo`, + description: $localize`:PublicFormConfig:Add an image to be displayed at the top of the form`, + dataType: "file", + additional: 300, + }) + logo: string; + @DatabaseField({ label: $localize`:PublicFormConfig:Title`, }) diff --git a/src/app/features/public-form/public-form.component.html b/src/app/features/public-form/public-form.component.html index b284ea67bf..d501bd1882 100644 --- a/src/app/features/public-form/public-form.component.html +++ b/src/app/features/public-form/public-form.component.html @@ -1,7 +1,18 @@ - {{ formConfig?.title }} - {{ formConfig?.description }} +
+ {{ formConfig?.title }} +
+ @if (formConfig?.logo) { + + } +
+ {{ formConfig?.description }} +
@if (formConfig && form) { diff --git a/src/app/features/public-form/public-form.component.scss b/src/app/features/public-form/public-form.component.scss index bdd002d5b5..c1bb6d228d 100644 --- a/src/app/features/public-form/public-form.component.scss +++ b/src/app/features/public-form/public-form.component.scss @@ -10,3 +10,13 @@ button { margin-left: 2.5%; margin-bottom: 10px; } + +.public-form-container{ + text-align: center; +} + +.public-form-image { + max-width: 100%; + height: 100px; + object-fit: contain; +} diff --git a/src/app/features/public-form/public-form.component.ts b/src/app/features/public-form/public-form.component.ts index f3b8e6b1f4..abcc847eb6 100644 --- a/src/app/features/public-form/public-form.component.ts +++ b/src/app/features/public-form/public-form.component.ts @@ -19,13 +19,19 @@ import { FieldGroup } from "../../core/entity-details/form/field-group"; import { InvalidFormFieldError } from "../../core/common-components/entity-form/invalid-form-field.error"; import { FormFieldConfig } from "app/core/common-components/entity-form/FormConfig"; import { DefaultValueConfig } from "../../core/entity/schema/default-value-config"; +import { DisplayImgComponent } from "../file/display-img/display-img.component"; @UntilDestroy() @Component({ selector: "app-public-form", templateUrl: "./public-form.component.html", styleUrls: ["./public-form.component.scss"], - imports: [EntityFormComponent, MatButtonModule, MatCardModule], + imports: [ + EntityFormComponent, + MatButtonModule, + MatCardModule, + DisplayImgComponent, + ], standalone: true, }) export class PublicFormComponent implements OnInit { diff --git a/src/app/features/public-form/public-form.module.ts b/src/app/features/public-form/public-form.module.ts index 2edf37a6e5..070e052448 100644 --- a/src/app/features/public-form/public-form.module.ts +++ b/src/app/features/public-form/public-form.module.ts @@ -80,6 +80,7 @@ const viewConfigs: ViewConfig[] = [ }, "entity", "description", + "logo", ], }, ],