Background
In the core module of deme, there are currently 2 ways in Deme of viewing lists of items:
There are also 3 more ways of viewing specific types of lists of items in the core module, all seen on the side bar of every page:
- The {% calculatecomments %} tag. In cms/templatetags/item_tags.py around line 805, this method will display the threaded list of comments for the current item in a view.
- The {% calculate_relationships %} tag. In cms/templatetags/item_tags.py around line 918, this method will display a list of all single-link relationship categories of other items pointing to this item, and within each relationship category will list all of the items with that relationship.
There are 3 ways of viewing lists which are not actually items, but special models in Deme that do not inherit from Item: the {% permissions_box %} tag which lists permissions/abilities, the {% calculatehistory %} tag which lists versions, and the {% calculateactionnotices %} tag which lists action notices.
And finally, there are other very specific ways of viewing lists of items, such as when you click "Login As" and it displays a list of agents you can login as.
Proposal
I propose in all of our improvements for viewing lists of items, we focus our efforts on the generic list view. It should at least be able to replace the collection viewer, so the collection viewer can just embed a generic list view. It should also be able to replace calculate_relationships tag. Ideally we will come up with a way to incorporate threaded comments into this view, so it should be able to replace the calculatecomments tag. It will be nice if it can also replace any other instances in the core module we have of viewing lists of items (such as the "Login As" page). However, I do not think it is feasible to generalize it to the non-item list views. Presumably the permissions, history, and action notice views will need to be very specialized anyway, so it would not save much effort.
Of course, each specialized case that the generic list view replaces will actually just embed the list view with a set of parameters describing exactly how it needs to look in the particular use case.
It will be easy to share the work in searching, sorting, filtering, etc. across all areas where we display lists. But what I see as the main obstacle is being able to perform state-changing actions within the displayed lists. A collection view would need a "delete" button which would deactivate memberships, or potentially give the option to deactivate the underlying items as well. The "Login As" view would need a "login as" button which would take the selected agent and login. It would be nice to generically be able to display an "add" button to any list: for collections it might create a new membership with a selected item, for "your contact methods" or "your authentication methods" it would create a new method that belongs to you. But what about multi-link relationships: for collections perhaps you wanted to create an arbitrary item and then have it automatically create a membership afterward that adds the item to the collection, for your subscriptions maybe it needs to create a contact method first and then a subscription. This is done specifically when you click "Add Located Comment" (it creates a comment, and then a transclusion), but can we come up with a general solution?