diff options
author | Simo Sorce <simo@redhat.com> | 2014-03-27 12:56:28 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2014-03-28 17:10:32 -0400 |
commit | 7b56b1311ba0c730fa884c75ccf15dfbf996ebd8 (patch) | |
tree | 6a7385d9d3f74e06a28468e5faa15417fe60bd1f | |
parent | 0338db2eb3197ce0024d0192bd981120a58de573 (diff) | |
download | ipsilon.git-7b56b1311ba0c730fa884c75ccf15dfbf996ebd8.tar.gz ipsilon.git-7b56b1311ba0c730fa884c75ccf15dfbf996ebd8.tar.xz ipsilon.git-7b56b1311ba0c730fa884c75ccf15dfbf996ebd8.zip |
Add generic support for IdP plugin admin pages
Signed-off-by: Simo Sorce <simo@redhat.com>
-rwxr-xr-x | ipsilon/admin/providers.py | 5 | ||||
-rwxr-xr-x | ipsilon/providers/common.py | 1 | ||||
-rw-r--r-- | templates/admin/providers.html | 3 |
3 files changed, 8 insertions, 1 deletions
diff --git a/ipsilon/admin/providers.py b/ipsilon/admin/providers.py index 26e96a7..1a2df7c 100755 --- a/ipsilon/admin/providers.py +++ b/ipsilon/admin/providers.py @@ -36,7 +36,10 @@ class ProviderPlugins(Page): for plugin in self._site[FACILITY]['available']: cherrypy.log.error('Admin provider plugin: %s' % plugin) obj = self._site[FACILITY]['available'][plugin] - self.__dict__[plugin] = AdminPluginPage(obj, self) + page = AdminPluginPage(obj, self._site, self) + if hasattr(obj, 'admin'): + obj.admin.mount(page) + self.add_subtree(plugin, page) def root_with_msg(self, message=None, message_type=None): plugins = self._site[FACILITY] diff --git a/ipsilon/providers/common.py b/ipsilon/providers/common.py index 8e62cbe..f9c1311 100755 --- a/ipsilon/providers/common.py +++ b/ipsilon/providers/common.py @@ -43,6 +43,7 @@ class ProviderBase(PluginObject): super(ProviderBase, self).__init__() self.name = name self.path = path + self.admin = None def _debug(self, fact): if cherrypy.config.get('debug', False): diff --git a/templates/admin/providers.html b/templates/admin/providers.html index 18445b6..fbeb54d 100644 --- a/templates/admin/providers.html +++ b/templates/admin/providers.html @@ -10,6 +10,9 @@ {% if available[p] in enabled %} <a class="btn btn-default" href="{{ baseurl }}/disable/{{ p }}">Disable</a> <a class="btn btn-default" href="{{ baseurl }}/{{ p }}">Configure</a> + {% if available[p].admin %} + <a class="btn btn-default" href="{{ baseurl }}/{{ p }}/admin">Administer</a> + {% endif %} {% else %} <a class="btn btn-default" href="{{ baseurl }}/enable/{{ p }}">Enable</a> {% endif %} |