I have a page that, when accessed, displays a table of information related to the video:
- Embed code
- Title
- Description
- Current gallery
- Thumbnail Image
This information is read-only when the page opens first.
There is a selection menu that has the following options:
- Change Description
- Create thumbnail (upload / replace)
- Change embed code
- Change Gallery
- Delete video
When the user selects a parameter, the same initial data table is displayed, but the corresponding form input is displayed if necessary.
For example, if "Change Description" is selected, the page reload and description text are replaced by text input. If Create Thumbnail is selected, the input to download the file is displayed.
The idea is to display all the information together, but limit how much you can edit at a time.
I know that a state template is a possible solution, since each piece of data can be at least one of two states:
- Display status
- Form Input Status
But, my question is, will using a state template be redundant?
Currently, each time the page is accessed, each part of the form decides with the switch statement whether it should be in the "display" or "input" state, and then acts accordingly. I wonder if the implementation of the state template can change the form and create similar forms in the future.
Thanks!
source share