List view proposal

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 What is the third way? 1 repliesrelationship.
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.

There is actually one important way of viewing lists of items that I forgot, and it's actually one of the most lacking on the site right now: selecting items from a dropdown/autocomplete box on the site. Right now we can either use the Ajax autocomplete search box (which is very primitive and hard to use if you don't know the item name off the top of your head, or it doesn't even have an item name), or we can use the built-in Django drop-down box which unfortunately does not scale to more than a few dozen items easily. Ideally clicking on the dropdown would open a small popup with the search view in an ajaxy way. If we could share the same searching/filtering interface we use everywhere else, that would be a huge gain for forms with foreign keys.

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?

We also need to distinguish item-specific state changing (relatively easy since you'll just go to a generic action for that item) from creating. It's a much more complicated problem how to create a multi-link relationship (when you create the intermediary links, how do you set their other fields and permissions?) than it is how to perform a predefined action on one.

For Internet Explorer users: Click on the Tools menu, located at the top of your browser window. When the drop-down menu appears, select the option labeled Full Screen.

For Chrome users:Click on the Chrome "wrench" icon, located in the upper right hand corner of your browser window. When the drop-down menu appears, select the choice labeled Full Screen.

For Firefox user:Click on the View menu, located at the top of your browser window. When the drop-down menu appears, select the option labeled Full Screen.

For Safari users: Safari currently does not support the ability to go fullscreen.