}
</script>"""
-def send_title(name, text="Limbo", msg_text=None, msg_type='error'):
+def send_title(name, text="Limbo", msg_text=None, msg_type='error', writable=False):
global title_done
if title_done: return
if icon_url:
print ' <link rel="icon" href="%s" />' % relative_url(icon_url)
- if privileged_url is not None:
+ if name and writable and privileged_url is not None:
print ' <link rel="alternate" type="application/x-wiki" title="Edit this page" href="%s" \>' \
% (privileged_path() + '?edit=' + name)
print '</head>'
# Body
- if name and privileged_url is not None:
+ if name and writable and privileged_url is not None:
print '<body ondblclick="location.href=\'' + privileged_path() + '?edit=' + name + '\'">'
else:
print '<body>'
print ' <b>' + link_tag('?fullsearch=' + name, text, 'navlink') + '</b> '
else:
print ' <b>' + text + '</b> '
- print ' | ' + link_tag('FrontPage', 'Front Page', 'navlink')
+ print ' | ' + link_tag('FrontPage', 'Home', 'navlink')
print ' | ' + link_tag('FindPage', 'Find Page', 'navlink')
if 'history_url' in globals():
print ' | <a href="' + history_url + '" class="navlink">Recent Changes</a>'
if name:
print ' | ' + link_tag('?raw=' + name, 'Raw Text', 'navlink')
if privileged_url is not None:
- print ' | ' + link_tag('?edit=' + name, 'Edit Page', 'navlink', privileged=True)
+ if writable:
+ print ' | ' + link_tag('?edit=' + name, 'Edit', 'navlink', privileged=True)
+ else:
+ print ' | ' + link_tag(name, 'Login', 'navlink', privileged=True)
+
else:
print ' | <i>Immutable Page</i>'
send_guru("Read access denied by ACLs", "notice")
def format(self):
- page_name = None
- if self.can_write():
- page_name = self.page_name
-
#css foo.css bar.css
global css_url
css_url = self.get_attr("css", "").split() + css_url
- send_title(page_name, self.split_title(), msg_text=self.msg_text, msg_type=self.msg_type)
+ send_title(self.page_name, self.split_title(),
+ msg_text=self.msg_text, msg_type=self.msg_type, writable=self.can_write())
self.send_naked()
- send_footer(page_name, self._last_modified())
+ send_footer(self.page_name, self._last_modified())
def _last_modified(self):
try: