feat: Integrate new Collage Designer and replace old Generator#1353
feat: Integrate new Collage Designer and replace old Generator#1353dasGOLE wants to merge 63 commits intoPhotoboothProject:devfrom
Conversation
82f2f78 to
61134e4
Compare
96005c2 to
c6ca64a
Compare
1102822 to
f660e55
Compare
|
rebased and cs/ci fixes |
This commit introduces a new, dedicated Collage Designer, replacing the legacy collage generator. The goal is to provide a more flexible and robust platform for designing collages and also be able to move all collage settings in this designer in the future, laying the groundwork for future enhancements and a better user experience.
Key changes include:
- **Removal of Legacy Collage Generator:** The old generator's entry points and related files have been removed or redirected. (Note: A dedicated cleanup commit for all generator-related files is planned for the future.)
- **New Collage Designer Structure:** A dedicated directory and file structure for the new Collage Designer (`admin/collage-designer/`) have been established to encapsulate its logic and assets.
- **Initial Collage Designer Layout:** The foundational HTML/CSS layout for the Collage Designer has been created, providing a basic UI for future design capabilities.
- **Unified Configuration Rendering:** The `renderConfigManager` was introduced and integrated into `inputAdmin.php` to standardize the rendering of configuration options across the admin panel, improving consistency and maintainability.
- **Theme Renderer Adaptation:** The theme renderer has been updated to utilize the new, general `renderConfigManager`, ensuring that theme-specific configurations are also processed through the unified rendering system.
- **Enhanced Admin Panel Navigation:**
- The "Collage Designer" button in the admin panel now directly navigates to the new designer within the same tab, providing a smoother user flow.
- **Optimized Admin Settings Save Logic:**
- A centralized `saveAdminSettings()` JavaScript function has been implemented for handling API requests to save admin configurations.
- This function uses Promises for asynchronous handling and allows configurable behavior (e.g., page reload) via options.
- An `isDirty` check (based on `$('#save-admin-btn').hasClass('isDirty')`) ensures that settings are only saved if actual changes have occurred, preventing unnecessary API calls and improving responsiveness.
- The "Collage Designer" button now conditionally saves admin settings before navigation *only if* there are pending changes, otherwise, it navigates directly.
- The main "Save" button in the admin panel retains its original behavior of reloading the page after saving.
Change-Id: Iecdac17ee959247347cfef99f687e1e93431d55d
New back button functionality in a dedicated helper file (`admin/helper/backBtn.php`). This new component provides a robust "Back" button experience by leveraging the browser's `history.back()` JavaScript API, ensuring navigation to preceding page in the browser history, including hash fragments. Additionally, an `AdminInput` renderer was created. Key changes include: - **New File:** `admin/helper/backBtn.php` containing the `getBackBtn` function. - ** Back Button Logic:** The `getBackBtn` function uses `href="javascript:history.back()"` and `onclick="event.preventDefault(); history.back();"` for reliable client-side navigation. - **Admin Input Renderer:** Implemented a new renderer for the back button, allowing it to be easily added to admin forms and layouts. Change-Id: I79e2d12f3c5f6e4dfebf5c1025f74a2fc8b48c69
Change-Id: I487e4a1a755d2f2a10ef1f47d7e1aa2d1cef3772
Key changes include: - **new CollageLayoutScanner:** new scanner to dynamically scan all available json-designs. - **Nested Grouping:** Collage layouts grouped into two levels (e.g., "Standard Layouts" > "Portrait Layouts", "Custom Layouts" > "Community Layouts") for better organization and clarity. - **Dynamic Directory Creation:** The scanner automatically creates missing base (`private/collage`) and subdirectories (`private/collage/portrait`, `private/collage/community`) if they don't exist. - **Robust Layout Naming:** Each layout is guaranteed to have a display name, using the `name` field from its JSON configuration or falling back to the filename (`layoutId`) if `name` is missing. - **changes Collage template:** added `name` field
…esigner
Key changes include:
- **Adapted Layout Selection:** The collage layout selection mechanism has been updated to align with the new designer's data structure. This means `config['collage']['layout']` now stores the relative path to the layout's JSON configuration file instead of an enum value.
- **Persistent Collage Configuration:** The calculation of the collage limit and other related settings (e.g., placeholder properties) are now always saved to the main configuration, regardless of whether the collage feature is currently enabled. This ensures that the configuration is consistently up-to-date and prevents issues where stale limit values were used, leading to "Undefined array key" errors.
- **Removed `CollageLayoutEnum`:** The `CollageLayoutEnum` and all its references have been deprecated and removed, simplifying the code and eliminating unnecessary abstraction now that layout paths are directly used.
- **Enhanced `AdminInput::renderSelect`:** The `renderSelect` method in `AdminInput` now supports providing an HTML string as an option list, allowing for more flexible and dynamic dropdown constructions (e.g., with `optgroup` elements).
- **Extended `CollageLayoutScanner`:** The `CollageLayoutScanner` class has been extended with new utility methods:
- `getLayoutData()`: To retrieve detailed data for a specific layout.
- `getLayoutSelectOptionsHtml()`: To generate the formatted HTML options for the select dropdown, including `optgroup` for better organization.
- `getCollageConfigPath()`: To correctly determine the full file path for a given collage layout.
**draw current layout to canvas **drag and drop placeholder (translation)
- add handles for interactive scaling
- add handle for interactive rotation
- removed unproportional scaling (didn't work reliable)
- refractored some of the Designer-Layout - added new .js for the element-settings-panel (`collage-designer-elemntSetPnl.js`) - rewritten `element-settings-panel.php` - changed dragging behavior, to ensure no dragging while selecting
- added aspect ratio functionality - added the property 'type' to canvas elements - some refactoring
new behavior: placeholder are now active, if a path is present in `elements.src` in the JSON file. Therefore more than one placeholder can be configured and even diffrent images! (needs additional changes in the backend!)
- changed icon for placeholder in img-settings-panel - changed padding for `remove placeholder`button
- added button to add text fields - added buttons, functions and element attributes to enable bold, italic and underlined text - added buttons and functions for applying alignment to the text - some refactoring
… rewritten. A new drawHandles function has been added to centralise all Handle actions.
- Back button is now aligned with the left border
- added function to update state of distribution buttons
- renamed `showElmntOutline` to `showElmntOutlineBtn`
allow design specific - background img - background color - Frame (single over whole collage) with its own checkbox Todo: change Demensions
added: - `collage-designer-history.js` - `collage-designer-mouseEvents.js` - `collage-designer-utils.js` cleaned up: - `collage-designer.js` - `collage-designer-tolls.js`
a122260 to
d6639f8
Compare
V1 of the designer reached.I've been working on further features for the past few weeks, but since I haven't had time to reintegrate the back button or deal with the latest commits, it took a while to push the latest status. @reloxx13 I had to remove your commits regarding the removal of the back button and opening the designer in a new tab. Therefore, I adjusted the history and removed them. However, I believe all fundamental functions required for the designer are now included. There are still a few design decisions on how certain things should be handled in the future: Open "questions":
Currently, the designer requires the following JSON structure, for example: The new JSON structure could also store the background image, the single frame, and it might be possible to set a custom/different frame for each placeholder (this would then need to be supplemented in the JSON structure and the designer). Currently, the designer is not functional due to conflicts with CollageLayoutEnum. Additionally, a rebase onto the current I'm eager for your feedback, and if this looks good, we could now proceed to the backend and the migration to the new JSON structure. :) |
This commit introduces a new, dedicated Collage Designer, replacing the legacy collage generator. The goal is to provide a more flexible and robust platform for designing collages and also be able to move all collage settings in this designer in the future, laying the groundwork for future enhancements and a better user experience.
Prerequisites checklist
What is the purpose of this pull request? (put an "x" next to an item)
What changes did you make? (Give an overview)
Key changes include:
admin/collage-designer/) have been established to encapsulate its logic and assets.renderConfigManagerwas introduced and integrated intoinputAdmin.phpto standardize the rendering of configuration options across the admin panel, improving consistency and maintainability.renderConfigManager, ensuring that theme-specific configurations are also processed through the unified rendering system.saveAdminSettings()JavaScript function has been implemented for handling API requests to save admin configurations.isDirtycheck (based on$('#save-admin-btn').hasClass('isDirty')) ensures that settings are only saved if actual changes have occurred, preventing unnecessary API calls and improving responsiveness.Is there anything you'd like reviewers to focus on?