Show More
@@ -21,8 +21,8 b' class hgwebdir(object):' | |||||
21 | return [(name.strip(os.sep), path) for name, path in items] |
|
21 | return [(name.strip(os.sep), path) for name, path in items] | |
22 |
|
22 | |||
23 | self.parentui = parentui |
|
23 | self.parentui = parentui | |
24 |
self.motd = |
|
24 | self.motd = None | |
25 |
self.style = |
|
25 | self.style = None | |
26 | self.repos_sorted = ('name', False) |
|
26 | self.repos_sorted = ('name', False) | |
27 | if isinstance(config, (list, tuple)): |
|
27 | if isinstance(config, (list, tuple)): | |
28 | self.repos = cleannames(config) |
|
28 | self.repos = cleannames(config) | |
@@ -72,15 +72,23 b' class hgwebdir(object):' | |||||
72 | yield tmpl("footer", **map) |
|
72 | yield tmpl("footer", **map) | |
73 |
|
73 | |||
74 | def motd(**map): |
|
74 | def motd(**map): | |
75 |
|
|
75 | if self.motd is not None: | |
|
76 | yield self.motd | |||
|
77 | else: | |||
|
78 | yield config('web', 'motd', '') | |||
76 |
|
79 | |||
77 | parentui = self.parentui or ui.ui(report_untrusted=False) |
|
80 | parentui = self.parentui or ui.ui(report_untrusted=False) | |
78 |
|
81 | |||
|
82 | def config(section, name, default=None, untrusted=True): | |||
|
83 | return parentui.config(section, name, default, untrusted) | |||
|
84 | ||||
79 | url = req.env['REQUEST_URI'].split('?')[0] |
|
85 | url = req.env['REQUEST_URI'].split('?')[0] | |
80 | if not url.endswith('/'): |
|
86 | if not url.endswith('/'): | |
81 | url += '/' |
|
87 | url += '/' | |
82 |
|
88 | |||
83 | style = self.style |
|
89 | style = self.style | |
|
90 | if style is None: | |||
|
91 | style = config('web', 'style', '') | |||
84 | if req.form.has_key('style'): |
|
92 | if req.form.has_key('style'): | |
85 | style = req.form['style'][0] |
|
93 | style = req.form['style'][0] | |
86 | mapfile = style_map(templater.templatepath(), style) |
|
94 | mapfile = style_map(templater.templatepath(), style) |
General Comments 0
You need to be logged in to leave comments.
Login now