Changeset 324
- Timestamp:
- 01/12/06 11:54:14 (3 years ago)
- Files:
-
- authformplugin/0.9/authform/web_ui.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
authformplugin/0.9/authform/web_ui.py
r322 r324 23 23 from trac.core import * 24 24 from trac.web.api import IAuthenticator, IRequestHandler 25 from trac.web.chrome import INavigationContributor 26 from trac.util import escape, hex_entropy, TRUE 25 from trac.web.chrome import INavigationContributor, ITemplateProvider 26 from trac.util import escape, hex_entropy, TRUE, Markup 27 27 28 28 … … 44 44 """ 45 45 46 implements(IAuthenticator, INavigationContributor, IRequestHandler )46 implements(IAuthenticator, INavigationContributor, IRequestHandler, ITemplateProvider) 47 47 48 48 # IAuthenticator methods … … 70 70 if req.authname and req.authname != 'anonymous': 71 71 yield 'metanav', 'login', 'logged in as %s' % escape(req.authname) 72 yield 'metanav', 'logout', '<a href="%s">Logout</a>' \73 % escape(self.env.href.logout()) 72 yield 'metanav', 'logout', Markup('<a href="%s">Logout</a>' \ 73 % escape(self.env.href.logout())) 74 74 else: 75 yield 'metanav', 'login', '<a href="%s">Login</a>' \76 % escape(self.env.href.login()) 75 yield 'metanav', 'login', Markup('<a href="%s">Login</a>' \ 76 % escape(self.env.href.login())) 77 77 78 78 # IRequestHandler methods … … 88 88 self._do_logout(req) 89 89 self._redirect_back(req) 90 91 # ITemplateProvider methods 92 def get_templates_dirs(self): 93 """ 94 Return the absolute path of the directory containing the provided 95 ClearSilver templates. 96 """ 97 from pkg_resources import resource_filename 98 return [resource_filename(__name__, 'templates')] 99 100 def get_htdocs_dirs(self): 101 """ 102 Return a list of directories with static resources (such as style 103 sheets, images, etc.) 104 105 Each item in the list must be a `(prefix, abspath)` tuple. The 106 `prefix` part defines the path in the URL that requests to these 107 resources are prefixed with. 108 109 The `abspath` is the absolute path to the directory containing the 110 resources on the local file system. 111 """ 112 return [] 90 113 91 114 # Internal methods
