Make it easy to get to an extension instance from a class.

It's pretty common for extension code to try to get the instance of the
extension from places where the instance isn't passed. The common
pattern is to import the extension class, the extension manager, and to
do a fetch. While that works, it's annoying.

Since an extension can only be instantiated once, it's pretty safe to
store a handle to the instance on the class. Now,
ExtensionSubclass.instance will point to the instance when the extension
is enabled.

Extensions may still need to deal with circular imports to get the class
(depending on where it's calling this from), but that's not any
different from before, and it's much nicer than dealing with the
extension manager.
Add a `settings` attribute in SettingsForm.

SettingsForm is a specialization of SiteSettingsForm, which provides
a `siteconfig` attribute. This is kind of misleading to use, though, so
instead, we'll provide `settings`, which is the same thing but with a
better, more accurate name.
Fix the display of microseconds from log_timed.

log_timed was formatting microseconds incorrectly, making it appear as
if operations were taking longer than they actually were. This was
because the microseconds weren't appearing zero-padded in the string.

This adds the zero-padding, giving us accurate logging information.
Reduce the number of queries needed when loading extensions.

Extension loading would, at the worst case, attempt a fetch + create for
every extension. That create was only necessary the first time an
extension was loaded, and the rest of the time we'd just be doing a
fetch.

Doing one fetch per extension is a waste of time. Instead, we want to
fetch them all up-front, ideally.

This new code keeps track of what we need to fetch and what we need to
create. It then fetches all in one go, and then individually creates any
remaining registere extension entries we may need.
Bump to Djblets 0.8 beta 3 dev.
Add CSRF protection to all POSTable views in Djblets.

All views in Djblets that handle HTTP POST requests are now decorated
with a @csrf_protect decorator, and have matching {% csrf_token %} tags
in the templates. This adds a layer of protection we didn't have before.

The API is unaffected, as adding CSRF protection to APIs sort of defeats
the purpose of APIs. There are other protections we may want to make
here, but that's a separate task.
Allow providing extra context to TemplateHook.

Previously, if one wanted to provide additional context to TemplateHook,
it would have to subclass and override render_to_string(). Now, extra
context can be provided to the constructor, and subclasses can
dynamically provide additional context by overriding
get_extra_context().
Release Djblets 0.8 beta 3.
Bump to 0.8 beta 4 dev.
Add an app for managing multi-"page" config forms.

This makes it easy for a view to provide collections of configuration
pages with a sidebar used for navigation. Each page can have one or more
forms, each of which can be submitted individually.

This is a generalization of the My Account page from Review Board 2.0,
and the Team Admin page from RBCommons. All the JavaScript and CSS were
directly copied from Review Board (with the addition of the two macros
the .less file needs).
Improve serialization and parent URL computation for webapi.

It was difficult in the past to override serialization of objects in
payloads, but there are times when you really want this.

Now, instead of directly looking up a serializer from the global
registry for a given object, we go through a function on the resource
itself. This defaults to looking up in the registry, but the resource
can override this in order to override any object it chooses that would
be represented in its payload.

Likewise, sometimes a resource needs to override the parent URL
computation for an object. It could already do this before, but it
didn't have access to all the variables that made up the URL. We now
pass **kwargs, like we do with most other similar functions.
Improve creation of custom JS views and models for config pages.

ConfigPagesView now allows for creating a custom models and views for
the configuration page, along with custom options/attributes. These will
be outputted in the template when setting up the page.

A new template tag, json_dumps_items, helps to output data without
messing around with more expensive and messy template-based loops.
Add support for spinners for list items in configforms.

This brings over RBCommons's list item spinners, but makes their
presence dynamic. A ListItemView subclass can now call showSpinner() to
cause a spinner element to fade in, and hideSpinner() to fade it out and
remove it.
Provide the ConfigPagesView in the ConfigPage constructor.

It's useful for ConfigPage subclasses or their forms to have access to
central state computed for a ConfigPagesView. Now, ConfigPages are
provided with the view when being constructed. ConfigPages already pass
themselves to ConfigPageForms.
Add a base class for a collection of ListItems.

This adds ListItemsCollection, which subclasses Backbone.Collection to
provide an event when fetching and to make constructor options available
as a variable on the collection.

Views can use the new "fetching" signal to show a loading indicator when
fetching a collection from the server.
Add a .jshintrc for the JavaScript code.

This matches the rules used in Review Board to ensure we're catching the
things we want to catch.
Separate state handling from datagrid columns.

DataGrid column instances are shared across multiple instances of a
DataGrid. This would be fine, except we were storing important state on
the column instances, which preventing DataGrids from being reliable in
a multi-threaded configuration (such as Apache's mod_worker or mod_wsgi
daemon mode).

DataGrid now creates wrappers around a Column, using the new
StatefulColumn class. These exist for the lifetime of a DataGrid
instance, and stores state about the associated column. It also wraps
all attribute and function access for the column, forwarding all
requests for attributes not otherwise stored on StatefulColumn.

Column functions now all take a 'state' parameter, which StatefulColumn
will automatically pass when wrapping a function. This parameter is used
for any state-related access.

A couple things were also cleaned up to help with this. Some work that
the Columns were doing (such as constructing Template objects on a
DataGrid) have been moved to the DataGrid.
Allow datagrid columns to provide a custom sort field.

Datagrid column sorting relied on the db_field attribute of a Column,
but if a column needed to dynamically compute which field to use, it was
pretty much out of luck without resorting to hacks.

Instead, we now use get_sort_field(), which returns the field used for
sorting. This defaults to db_field, but can be overridden by subclasses.
Fix static media building issues with the config forms.

The config forms were referencing admin media and other Review Board
assets, which worked when in the Review Board tree, but didn't work in
Djblets.

For now, we're just going to bundle the icons we need. We'll want to
revisit this at some point to use spritesheets and retina images.
Fix building extensions without a static/ directory.

Extensions that used the packaging wrappers but didn't have a static/
directory would break. We want to be consistent, so we should allow
this. We now check for the existence before we try to operate on it.