melmothx / amusewiki

Text::Amuse-based publishing platform
https://amusewiki.org
Other
176 stars 26 forks source link

Arbitrary nested category tree #289

Closed melmothx closed 5 years ago

melmothx commented 5 years ago

The problem is that the category system is currently too rigid and can't go deeper than one level.

The idea is to have a new route, e.g. /tags, where a new DB-only category is introduced, which leverages https://metacpan.org/pod/DBIx::Class::Tree for the adjacency lists.

So, category and authors (and eventually texts) can be attached to a tag (many to many), and then the tags can be organized to an arbitrary deep level. E.g tags/world/europe/italy/veneto/venezia

On display each tag (not only leaf), the tag should define how deep it should go, and so be configurable on this regard.

Each tag should have one or more translation attached, e.g. title_muse, title_html, body_muse, body_html, with the muse ones editable, and the html one prepopulated.

Tags are identified by tags_id, and uri + site_id not-null and unique.

UI admin based on: https://github.com/dbushell/Nestable (or equivalent). The serialized output should define the structure.

The site serializer needs to export/import the tree (and the attached material) correctly.

This is somehow a larger project but seems doable in a reasonable time.

melmothx commented 5 years ago

Work is done in branch tag-nesting-289. The main head-scratching point is the de/serialization. Probably the serialized structure should be dumped and tracked in the git, and (re)loaded when building the static indexes (which always come last), with a temporary copy of the json file used as lock for web editing (so until the temporary file is in place, web editing is disabled).

For the time being, the idea of the fancy UI is dropped. There are more urgent issues and time is limited. Also the adjacency tree module didn't add much value (while messing with the relationship definitions created by dbicdump), so not using that either.

melmothx commented 5 years ago

"tags" renamed to "nodes", which makes more sense for this thingy. Branch is: https://github.com/melmothx/amusewiki/tree/nodes-289

melmothx commented 5 years ago

This is almost done. Some things are left:

melmothx commented 5 years ago

Use https://stackoverflow.com/questions/29063244/consistent-styling-for-nested-lists-with-bootstrap to render the tag overview.

melmothx commented 5 years ago

Node overview needs an optimization to avoid spamming queries.

melmothx commented 5 years ago

This is released, even if in experimental state (menu hidden, but feature reachable at /node)