Skip to content

Commit 2c8a384

Browse files
authored
Feature: Organizer and event homepage redesign (#924)
1 parent 641e944 commit 2c8a384

File tree

97 files changed

+12964
-9023
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+12964
-9023
lines changed

backend/app/DomainObjects/Generated/EventSettingDomainObjectAbstract.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
6161
final public const TICKET_DESIGN_SETTINGS = 'ticket_design_settings';
6262
final public const ATTENDEE_DETAILS_COLLECTION_METHOD = 'attendee_details_collection_method';
6363
final public const SHOW_MARKETING_OPT_IN = 'show_marketing_opt_in';
64+
final public const HOMEPAGE_THEME_SETTINGS = 'homepage_theme_settings';
6465

6566
protected int $id;
6667
protected int $event_id;
@@ -113,6 +114,7 @@ abstract class EventSettingDomainObjectAbstract extends \HiEvents\DomainObjects\
113114
protected array|string|null $ticket_design_settings = null;
114115
protected string $attendee_details_collection_method = 'PER_TICKET';
115116
protected bool $show_marketing_opt_in = true;
117+
protected array|string|null $homepage_theme_settings = null;
116118

117119
public function toArray(): array
118120
{
@@ -168,6 +170,7 @@ public function toArray(): array
168170
'ticket_design_settings' => $this->ticket_design_settings ?? null,
169171
'attendee_details_collection_method' => $this->attendee_details_collection_method ?? null,
170172
'show_marketing_opt_in' => $this->show_marketing_opt_in ?? null,
173+
'homepage_theme_settings' => $this->homepage_theme_settings ?? null,
171174
];
172175
}
173176

@@ -732,4 +735,15 @@ public function getShowMarketingOptIn(): bool
732735
{
733736
return $this->show_marketing_opt_in;
734737
}
738+
739+
public function setHomepageThemeSettings(array|string|null $homepage_theme_settings): self
740+
{
741+
$this->homepage_theme_settings = $homepage_theme_settings;
742+
return $this;
743+
}
744+
745+
public function getHomepageThemeSettings(): array|string|null
746+
{
747+
return $this->homepage_theme_settings;
748+
}
735749
}

backend/app/DomainObjects/Generated/ProductDomainObjectAbstract.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ abstract class ProductDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
3434
final public const IS_HIDDEN = 'is_hidden';
3535
final public const PRODUCT_TYPE = 'product_type';
3636
final public const START_COLLAPSED = 'start_collapsed';
37+
final public const IS_HIGHLIGHTED = 'is_highlighted';
38+
final public const HIGHLIGHT_MESSAGE = 'highlight_message';
3739

3840
protected int $id;
3941
protected int $event_id;
@@ -59,6 +61,8 @@ abstract class ProductDomainObjectAbstract extends \HiEvents\DomainObjects\Abstr
5961
protected ?bool $is_hidden = false;
6062
protected string $product_type = 'TICKET';
6163
protected bool $start_collapsed = false;
64+
protected bool $is_highlighted = false;
65+
protected ?string $highlight_message = null;
6266

6367
public function toArray(): array
6468
{
@@ -87,6 +91,8 @@ public function toArray(): array
8791
'is_hidden' => $this->is_hidden ?? null,
8892
'product_type' => $this->product_type ?? null,
8993
'start_collapsed' => $this->start_collapsed ?? null,
94+
'is_highlighted' => $this->is_highlighted ?? null,
95+
'highlight_message' => $this->highlight_message ?? null,
9096
];
9197
}
9298

@@ -353,4 +359,26 @@ public function getStartCollapsed(): bool
353359
{
354360
return $this->start_collapsed;
355361
}
362+
363+
public function setIsHighlighted(bool $is_highlighted): self
364+
{
365+
$this->is_highlighted = $is_highlighted;
366+
return $this;
367+
}
368+
369+
public function getIsHighlighted(): bool
370+
{
371+
return $this->is_highlighted;
372+
}
373+
374+
public function setHighlightMessage(?string $highlight_message): self
375+
{
376+
$this->highlight_message = $highlight_message;
377+
return $this;
378+
}
379+
380+
public function getHighlightMessage(): ?string
381+
{
382+
return $this->highlight_message;
383+
}
356384
}

backend/app/Http/Request/EventSettings/UpdateEventSettingsRequest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,13 @@ public function rules(): array
8888

8989
// Marketing settings
9090
'show_marketing_opt_in' => ['boolean'],
91+
92+
// Homepage theme settings
93+
'homepage_theme_settings' => ['nullable', 'array'],
94+
'homepage_theme_settings.accent' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
95+
'homepage_theme_settings.background' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
96+
'homepage_theme_settings.mode' => ['nullable', 'string', Rule::in(['light', 'dark'])],
97+
'homepage_theme_settings.background_type' => ['nullable', 'string', Rule::in(HomepageBackgroundType::valuesArray())],
9198
];
9299
}
93100

@@ -124,6 +131,12 @@ public function messages(): array
124131
'ticket_design_settings.accent_color' => $colorMessage,
125132
'ticket_design_settings.footer_text.max' => __('The footer text may not be greater than 500 characters.'),
126133
'ticket_design_settings.layout_type.in' => __('The layout type must be default or modern.'),
134+
135+
// Homepage theme settings messages
136+
'homepage_theme_settings.accent' => $colorMessage,
137+
'homepage_theme_settings.background' => $colorMessage,
138+
'homepage_theme_settings.mode.in' => __('The mode must be light or dark.'),
139+
'homepage_theme_settings.background_type.in' => __('The background type must be COLOR or MIRROR_COVER_IMAGE.'),
127140
];
128141
}
129142
}

backend/app/Http/Request/Organizer/Settings/PartialUpdateOrganizerSettingsRequest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ public static function rules(): array
5555

5656
// Homepage
5757
'homepage_visibility' => ['nullable', Rule::in(OrganizerHomepageVisibility::valuesArray())],
58-
'homepage_background_color' => ['nullable', ...RulesHelper::HEX_COLOR],
59-
'homepage_primary_color' => ['nullable', ...RulesHelper::HEX_COLOR],
60-
'homepage_primary_text_color' => ['nullable', ...RulesHelper::HEX_COLOR],
61-
'homepage_secondary_color' => ['nullable', ...RulesHelper::HEX_COLOR],
62-
'homepage_secondary_text_color' => ['nullable', ...RulesHelper::HEX_COLOR],
63-
'homepage_content_background_color' => ['nullable', ...RulesHelper::HEX_COLOR],
64-
'homepage_background_type' => ['nullable', Rule::in(HomepageBackgroundType::valuesArray())],
58+
59+
// Homepage theme settings
60+
'homepage_theme_settings' => ['nullable', 'array'],
61+
'homepage_theme_settings.accent' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
62+
'homepage_theme_settings.background' => ['nullable', 'string', ...RulesHelper::HEX_COLOR],
63+
'homepage_theme_settings.mode' => ['nullable', 'string', Rule::in(['light', 'dark'])],
64+
'homepage_theme_settings.background_type' => ['nullable', 'string', Rule::in(HomepageBackgroundType::valuesArray())],
6565

6666
// SEO
6767
'seo_keywords' => ['sometimes', 'nullable', 'string', 'max:255'],

backend/app/Http/Request/Product/UpsertProductRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public function rules(): array
4141
'product_type' => ['required', Rule::in(ProductType::valuesArray())],
4242
'tax_and_fee_ids' => 'array',
4343
'product_category_id' => ['required', 'integer'],
44+
'is_highlighted' => 'boolean',
45+
'highlight_message' => 'string|nullable|max:255',
4446
];
4547
}
4648

backend/app/Models/EventSetting.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ protected function getCastMap(): array
1414
'location_details' => 'array',
1515
'payment_providers' => 'array',
1616
'ticket_design_settings' => 'array',
17+
'homepage_theme_settings' => 'array',
1718
];
1819
}
1920
}

backend/app/Resources/Event/EventSettingsResource.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ public function toArray($request): array
7070

7171
// Marketing settings
7272
'show_marketing_opt_in' => $this->getShowMarketingOptIn(),
73+
74+
// Homepage theme settings
75+
'homepage_theme_settings' => $this->getHomepageThemeSettings(),
7376
];
7477
}
7578
}

backend/app/Resources/Event/EventSettingsResourcePublic.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public function toArray($request): array
7676

7777
// Marketing settings
7878
'show_marketing_opt_in' => $this->getShowMarketingOptIn(),
79+
80+
// Homepage theme settings
81+
'homepage_theme_settings' => $this->getHomepageThemeSettings(),
7982
];
8083
}
8184
}

backend/app/Resources/Product/ProductResource.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public function toArray(Request $request): array
6161
fn() => ProductPriceResource::collection($this->getProductPrices())
6262
),
6363
'product_category_id' => $this->getProductCategoryId(),
64+
'is_highlighted' => $this->getIsHighlighted(),
65+
'highlight_message' => $this->getHighlightMessage(),
6466
];
6567
}
6668
}

backend/app/Resources/Product/ProductResourcePublic.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public function toArray(Request $request): array
5050
'is_sold_out' => $this->isSoldOut(),
5151
]),
5252
'product_category_id' => $this->getProductCategoryId(),
53+
'is_highlighted' => $this->getIsHighlighted(),
54+
'highlight_message' => $this->getHighlightMessage(),
5355
];
5456
}
5557
}

0 commit comments

Comments
 (0)