Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Each of the views in django_comment_client.forum.views and some of the views in django_comment_client.base.views return a dictionary that maps content ids to supplementary information about that item (whether the user has voted on or subscribed to it and what abilities the user has with regard to it). In the front end, that mapping is then loaded into a global variable for reference when rendering. Instead, that kind of information should simply be included directly in the content.

...

prepare_content

This function in django_comment_client.utils was formerly called safe_content. It was originally responsible for sanitizing data but now also does some augmentation as well. Ultimately, it should handle all augmentation and sanitization, and its helpers should be renamed to be module private. It should also be renamed to better indicate its expanded role.

forum.views

We should use separate endpoints for HTML and AJAX requests rather than delivering radically different payloads depending on a header. Ideally, there would be a single view for loading the discussion app, a Backbone router in the front end would load the appropriate view within that based on the URL, and data would be sent to the client via AJAX.

...