Show message when user has no permissions

Shows a warning messages to users who try to access
restricted page.

This bug can be simply fixed in middleware.py:

    if isinstance(exception, (exceptions.NotAuthorized,
                              exceptions.NotAuthenticated)):
        if request.user.is_authenticated() and 'next' in request.GET:
            # a logged-in users gets NotAuthorized exception,
            # then just redirect to user_home instead of '?next='

But in the case when an user uses different logins(e.g for
different projects), and wants to switch fast between them,
trying to load an admin-only(or other restricted) page,
then Dashboard will redirect them to their home page,
and the user will have to sign-out first, then login again
and load the desired page.

With this fix however, the user will see a message, giving them a choice
to login as different user, or to go to their 'home page' if
they landed on the restricted page by error, allowing fast-switching
between multiple accounts.
Also, this will work fine with bookmarked pages.

P.S. The html repr of the error message will
probably need some improvements...

Fixes bug 1053698

Change-Id: Id458af6c7bd90081fc95d339b32a3654878a927d
Fixes JavaScript count bug in tables.

When showing tables, and you had the summary, "No items to display",
the counter at table footer says "Displaying 1 items". This commit fixes
the inclusion of the empty line into line count.
Affected sub-pages: Instances, Volumes, Images & Snapshots, etc.

Change-Id: I24da50d506be477dffdbb0f497d88b1bd3ceacdc
Update common.

policy.py is not updated as it causes test failures. I will investigate
that separately.

Change-Id: I0970cbc67835a18c0114457c1bb07c700e0dfe88
Add OpenStack trove classifier for PyPI

Add trove classifier to have horizon listed among the
other OpenStack-related projets on PyPI.

Change-Id: I70a2b3dedf437fbfd03d4c2d605af6d6c2ef98c6
Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
Merge "Fixes JavaScript count bug in tables."
Fixed url pattern for project:instances:detail page

Removed obsolete :nova: namespace

Fixes bug 1070230

Change-Id: Ia56ef9ebf1a9bfe90b02491125821742ee840baa
Enable quota data from multiple sources.

Now that there are multiple projects with quota data (cinder, quantum)
we need to accommodate that data being aggregated in a centralized
fashion. This commit takes care of that for nova + cinder, and paves
the way for quantum later.

Fixes bug 1070022.

Change-Id: Ifc68c2dc681b2a7b4e7787e0b1a7dca1a970fc36
Merge "Show message when user has no permissions"
Merge "Fixed url pattern for project:instances:detail page"
Merge "Update common."
Use UUIDs for flavor create/edit.

Now that Nova accepts strings as flavor IDs we can just use UUIDs
on our end and get rid of the horrors of trying to guess the next
integer ID. This fixes all the instability in flavor editing.

Fixes bug 1057799.

Change-Id: I55eb1d7408655fd27e81cc1196f15ceb3659a7b4
Merge "Enable quota data from multiple sources."
Merge "Use UUIDs for flavor create/edit."
Added support for volume types

As cinder already supports volume types, it's time
to be added in Horizon. The types are added in admin panel.
A volume can either have a *valid* type, or None.

There are two minor issues:
1. When a type is deleted, if there is a volume with
   this type, the type is returned as the id,
   instead of the name. Which is good as consistency,
   but maybe a type should not be deleted if used by a volume?
2. If no vol type is passed(None) value, the type is being
   assigned as 'None', and returned as a string('None')
3. In the create volume type form, the 'Description' is
   empty at the moment, I couldn't find any help info
   to add for volume types...

Implements blueprint volume-types

Tested with n-cinder and n-vol services. Since Folsom both
support volume-types. I'm not sure if it is possible a grizzly
Dashboard to work with essex nova, which could be a problem.
Dashboard doesn't seem to provide permissions based on tables,
so if it needs to check if a service is available to show/hide
volume types, this will need some more effors to implement
permissions on table/action level. Or maybe this needs to be
added as a standalone panel?

Patch set 2: implemented suggestions, added one more thing:
When creating a volume from a snapshot, set the volume type
initial as the type of the original volume from which
the snapshot is being created.

Patch Set 3: Updated the description of volume types,
based on the notes from:
https://etherpad.openstack.org/grizzly-cinder-volumetypes
https://etherpad.openstack.org/cinder-usecases
Any feedback on the description is welcome.

Change-Id: Ib0c136c5c8cd9fbd34ce1dd346260f404c96f667
Adding volume host to admin table.

Change-Id: Id01a7e884113f67839ba3e8086df55dc8b1c5df3
Report correct return value from pep8 check

Remove the '|| true' appended to the pep8 command to allow
the non-zero status to be returned properly.

Fix bug 1073380.

Change-Id: I1e212a9d596eb448ee7f6ac40106a05650b70473
Adding volume owner (project) to admin table.

Change-Id: I40174eefa191312e77da41d6f55fffec7a1d6d90
Add newline between rows of Admin usage.csv

For some reason, we must also specify precision for vcpu hours
in this change. Adding the newline caused the default behavior
to change.

Fix bug 1073677

Change-Id: Id9a90e787de50f775ed17b15f185273cebba64e8
Update all usage.csv templates to use 2 decimal places

Change-Id: I54694beb39fdee39d59e9032e72201a520a9fcd1
Remove unused usage.csv template

Change-Id: I08f3c16e2da60bdaa8e04c60ed4a4d867c0947f4