Formalize Admin widgets a bit more, and make them class-based.

Review Request #2655 — Created Oct. 11, 2011 and submitted

Information

Review Board

Reviewers

Formalize Admin widgets a bit more, and make them class-based.

Admin widgets were just functions that had to return certain data in a
dictionary, handle their own caching, and were a bit hard-coded in their
use.

Now we have a Widget class, which has some standard attributes and
functions. The widgets subclass this and fill in the details they need.
These are then rendered by the dashboard template and template tag,
which get to be a bit more dumb now.

Widgets are registered as either primary or secondary widgets.
Extensions will be able to register their own, and they'll show up in
the dashboard.

Widget actions are a little more fleshed out as well. Instead of being
tuples, they're dictionaries, making it a bit easier to maintain and
look up. They can now have a 'rel' attribute, which works in some cases
better than an 'id' (particularly the Activity graph).

The next steps from here are to further reduce hard-coded IDs, and make
it easier to re-query a widget's data, for the purpose of AJAX-based
reloading.

 
Description From Last Updated

Docutils no longer fails with an empty first line if you have """ The base class So I think we …

daviddavid
david
  1. Most of this looks pretty great.
  2. reviewboard/admin/widgets.py (Diff revision 1)
     
     
    Show all issues
    Docutils no longer fails with an empty first line if you have
    
    """
    The base class
    
    
    So I think we can make these prettier.
    1. I don't know that it ever actually *failed* per se, but last I looked, it wouldn't take the first line as a summary still in generated API docs.
    2. Okay, fair enough.
  3. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (ee70027)