notebook
notebook copied to clipboard
Content should be able to be nested under other content
Expected behavior
- Instead of just a one-dimensional list of content under each content type (characters, locations, etc), we should allow each piece of content to have a parent and/or child content.
- We also need to figure out how to rearrange things in the UI to make these relationships clear to set, while also avoiding people "losing" nested content (that might not otherwise be in e.g. the top-level Characters list).
Implementation steps
- [ ] Add
parent_content_id
andparent_content_type
fields on all content types to add a polymorphic hierarchy of content linking across all types - [ ] Add a
child_content
method to content (probably through a concern so we can reuse it across all types) for getting all children content
Design
- [ ] Rework the sidebar from a list of content types to a hierarchical view of a user's content, with content-without-a-parent nested under the (current) content types. For example:
Characters
Bob
Alice
Locations
Empiria
Citytown
Mr. Mayor
Superchurchplace
Towntown
Magic
Elemental Magic
Fireball
Nature Magic
Earthball
- [ ] Since we can nest any kind of content under any other kind of content, we want to include an icon for the content type next to each name. So, for example, Mr. Mayor should have a character icon next to it in the above list.
- [ ] When a user only has one universe, omit the
Universes
section in the sidebar. - [ ] When a user has multiple universes, use them as the top-level elements in the hierarchy and nest Characters, Locations, Items, etc under the selected universe.
- [ ] All content should be collapsible/expandable.
Here's a screenshot of a user who offered this as feedback on how they're organizing their magic structure: