Closed ThoAppelsin closed 6 years ago
I just made some contributions to this PR:
Be aware that we still can't share a post with a template, because it's just the UI part. Posting is connected to the backend yet 😄
All features are tested on Chrome 62, macOS 10.13.1.
@triforce930 Review, please 👓
Wow, this looks amazing. Accepted :+1:, I guess...
@Morgazipa Thanks for checking, you're right, it wasn't working in Firefox. I made some fixes, now it works 👍 Tested in Firefox 57 (Quantum).
@triforce930 Review, please 👓
I can confirm that all these now work very smoothly on my browser too 👍
About
We ought to implement the UI for preparation, creation and usage of the data templates. The preparation and creation parts are coarsely done, i.e. looks bad but functionally OK. As for the usage, the user can see the available templates, switch to them, however may not share a post with them.
Changes
All the changes are on the group details page.
A modal pops up for template creation.
One of the three fields can be added to the template: Checkbox, Multiple Selection, and Text Area.
Labels and legends can be edited through clicking, finalized through clicking away or hitting enter.
"Create!" button submits the template creation form, into the database.
Dropdown is now only for selecting the active template, creation is a separate button.
Dropdown now properly displays the templates of the group.
Two more buttons are for editing and extending the currently selected template, but not yet functional.
Sharing posts through templates is not yet available.
Visuals
See the below comment from @smddzcy.
Testing
How can this contribution be tested? Use the following structure:
Assuming your database already has a user and at least one group.
Click the "Create Template" button.
Prepare a template through the "+" button and editing labels as described above.
Submit the template.
Check back the template on the group details page.
Check if the template is available on the group details page of another group.
And more...
Closes #127