diff --git a/doc/source/glossary.rst b/doc/source/glossary.rst index 36bf635ea..7cabc2f43 100644 --- a/doc/source/glossary.rst +++ b/doc/source/glossary.rst @@ -9,7 +9,7 @@ Horizon Dashboard - A Python class representing a top-level navigation item (e.g. "syspanel") + A Python class representing a top-level navigation item (e.g. "project") which provides a consistent API for Horizon-compatible applications. Panel diff --git a/doc/source/quickstart.rst b/doc/source/quickstart.rst index 485328bcc..8aea83368 100644 --- a/doc/source/quickstart.rst +++ b/doc/source/quickstart.rst @@ -92,11 +92,13 @@ At the project level you add Horizon and any desired dashboards to your ``settings.INSTALLED_APPS``:: INSTALLED_APPS = ( - 'django', + 'openstack_dashboard', ... 'horizon', - 'horizon.dash', - 'horizon.syspanel', + 'openstack_dashboard.dashboards.project', + 'openstack_dashboard.dashboards.admin', + 'openstack_dashboard.dashboards.settings', + ... ) URLs @@ -141,22 +143,19 @@ Structure An application would have the following structure (we'll use syspanel as an example):: - syspanel/ + project/ |---__init__.py |---dashboard.py <-----Registers the app with Horizon and sets dashboard properties - |---templates/ - |---templatetags/ |---overview/ - |---services/ - |---images/ - |---__init__.py + |---images_and_snapshots/ + |-- images + |-- __init__.py |---panel.py <-----Registers the panel in the app and defines panel properties - |---urls.py - |---views.py - |---forms.py - |---tests.py - |---api.py <-------Optional additional API methods for non-core services - |---templates/ + |-- snapshots/ + |-- templates/ + |-- tests.py + |-- urls.py + |-- views.py ... ... @@ -168,18 +167,26 @@ process:: import horizon + .... + # ObjectStorePanels is an example for a PanelGroup + # for panel classes in general, see below + class ObjectStorePanels(horizon.PanelGroup): + slug = "object_store" + name = _("Object Store") + panels = ('containers',) - class Syspanel(horizon.Dashboard): - name = "Syspanel" # Appears in navigation - slug = 'syspanel' # Appears in url - panels = ('overview', 'services', 'instances', 'flavors', 'images', - 'tenants', 'users', 'quotas',) + + class Project(horizon.Dashboard): + name = _("Project") # Appears in navigation + slug = "project" # Appears in URL + # panels may be strings or refer to classes, such as + # ObjectStorePanels + panels = (BasePanels, NetworkPanels, ObjectStorePanels) default_panel = 'overview' - permissions = ('openstack.roles.admin',) + supports_tenants = True ... - - horizon.register(Syspanel) + horizon.register(Project) Panel Classes ------------- @@ -189,7 +196,7 @@ you register it in a ``panels.py`` file like so:: import horizon - from horizon.dashboard.syspanel import dashboard + from openstack_dashboard.dashboards.project import dashboard class Images(horizon.Panel): @@ -199,7 +206,7 @@ you register it in a ``panels.py`` file like so:: # You could also register your panel with another application's dashboard - dashboard.Syspanel.register(Images) + dashboard.Project.register(Images) By default a :class:`~horizon.Panel` class looks for a ``urls.py`` file in the same directory as ``panel.py`` to include in the rollup of url patterns from diff --git a/doc/source/topics/tutorial.rst b/doc/source/topics/tutorial.rst index 056eaa3e3..49083fcac 100644 --- a/doc/source/topics/tutorial.rst +++ b/doc/source/topics/tutorial.rst @@ -404,7 +404,7 @@ We need three templates here: one for the view, and one for each of our two tabs. The view template (in this case) can inherit from one of the other dashboards:: - {% extends 'syspanel/base.html' %} + {% extends 'base.html' %} {% load i18n %} {% block title %}{% trans "Flocking" %}{% endblock %} @@ -412,7 +412,7 @@ dashboards:: {% include "horizon/common/_page_header.html" with title=_("Flocking") %} {% endblock page_header %} - {% block syspanel_main %} + {% block main %}
{{ tab_group.render }} @@ -475,9 +475,20 @@ The most basic thing to do is to add your own custom dashboard using the ``HORIZON_CONFIG`` dictionary in the settings file:: HORIZON_CONFIG = { - 'dashboards': ('nova', 'syspanel', 'visualizations', 'settings',), + 'dashboards': ('project', 'admin', 'settings',), } +Please note, the dashboards also must be added to settings.py:: + INSTALLED_APPS = ( + 'openstack_dashboard', + ... + 'horizon', + 'openstack_dashboard.dashboards.project', + 'openstack_dashboard.dashboards.admin', + 'openstack_dashboard.dashboards.settings', + ... + ) + In this case, we've taken the default Horizon ``'dashboards'`` config and added our ``visualizations`` dashboard to it. Note that the name here is the name of the dashboard's module on the python path. It will find our