liqd/adhocracy — pull request #270 by nidico (2013-03-10 04:01:48+00:00)
Title: Hierarchical categories (#95)

This allows to assign categories in a hierarchical manner.

* It basically adds an optional *parent* category to categories.
* A noteworthiness is the `select_child_description` attribute, which allows to specify a description text, which prompts the user to select from the subcategories under this category.
* Another peculiarity is that in order to allow to specify the toplevel selection prompt, a single, *virtual* toplevel prompt with the desired `select_child_description` attribute can be introduced, which has the *real* toplevel items as children. The *virtual* category is hidden from the UI though.

Furthermore, this PR does:
* It allows to declare facets as exclusive, which means that only one item can be selected (e.g. used for categories). The counters behind the individual facet items still represent the number of items you'd get when clicking on this item. This can be a bit tricky, and is a bit hacked due to [lack of LocalParams support in sunburnt](tow/sunburnt#6).
* Add checkboxes in front of all facet items
* Puts the proposal facets in a box

I have split this from the `feature-191-thumbnail-badges_and_95-hierarchical-badges+` branch, which itself is a rebase of `feature-thumbnail_badges_#191_hierarchical_badge_#95`. I'm keeping both branches around in order to resolve potential issues due to rebase and split, until this and the #191 PR is merged.

Yet missing before merge:
* Make sure single-instance categories can only be children of categories of the same instance (or possibly of global categories), while global categories can only be children of global categories
* A bit more explanation text in the category creation UI, especially about the "select_child_description" attribute.