Improve the default widget #3

Merged
merged 2 commits into from Nov 28, 2011
Commits on Nov 28, 2011
  1. Reworked the widget form, including the JavaScript

    Tim Heap committed Nov 28, 2011
    - Turned the JavaScript code in to a jQuery plugin, removed most of the
      initialization code from the individual widget templates to a external
      JavaScript file, and added a {% phileo_js %} tag to load this plugin.
    - Each like button gets a unique ID, so multiple like buttons can appear
      on a single page
    - Made the widget a plain old form. This way, it works without
      JavaScript. Additionally, the CSRF stuff is included in the form by
      default, so the ajax_csrf.js script is obsolete
  2. Add a default value for widget_id

    Tim Heap committed Nov 28, 2011
    The widget_id when rendering a like widget defaulted to None, which
    broke the widget when no id was supplied. This creates a default id for
    widgets, which should be unique for that model instance.
    
    Conflicts:
    
    	phileo/templatetags/phileo_tags.py