This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use webut.skin to make ldaptor webui skinnable.
This allows embedding it seamlessly in a web site. git-svn-id: svn+ssh://open.inoi.fi/open-ldaptor/trunk@395 373aa48d-36e5-0310-bb30-ae74d9883905
- Loading branch information
tv
committed
Mar 5, 2006
1 parent
8f601f7
commit c687e95
Showing
29 changed files
with
265 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import os | ||
from zope.interface import implements | ||
from webut.skin import iskin | ||
from nevow import rend, loaders, tags, util, inevow, static | ||
from formless import webform | ||
|
||
class DefaultSkin(rend.Page): | ||
implements(iskin.ISkin) | ||
|
||
docFactory = loaders.xmlfile( | ||
util.resource_filename('ldaptor.apps.webui', 'skin-default.html')) | ||
|
||
stylesheets = [ | ||
'form.css', | ||
'ldaptor.css', | ||
] | ||
|
||
def locateChild(self, ctx, segments): | ||
if segments[0] == 'form.css': | ||
return webform.defaultCSS, segments[1:] | ||
if segments[0] == 'ldaptor.css': | ||
dirname = os.path.abspath(os.path.dirname(__file__)) | ||
return (static.File(os.path.join(dirname, 'ldaptor.css')), | ||
segments[1:]) | ||
else: | ||
return None, () | ||
|
||
def render_title(self, ctx, data): | ||
return ctx.tag.clear()[self.original.resource.title] | ||
|
||
def render_head(self, ctx, data): | ||
def links(l, path=None): | ||
for filename in l: | ||
href = filename | ||
if path is not None: | ||
href = path.child(href) | ||
yield tags.link(rel="stylesheet", | ||
type="text/css", | ||
href=href) | ||
ctx.tag.clear() | ||
stylesheets = getattr(self, 'stylesheets', None) | ||
if stylesheets is not None: | ||
ctx.tag[links(stylesheets, path=self.original.pathToFiles)] | ||
stylesheets = getattr(self.original.resource, 'stylesheets', None) | ||
if stylesheets is not None: | ||
ctx.tag[links(stylesheets)] | ||
return ctx.tag | ||
|
||
def render_content(self, ctx, data): | ||
return self.original.content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.