projects
/
geekigeeki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a8cdeee
)
Distinguish between immutable and protected pages
author
Bernie Innocenti
<bernie@codewiz.org>
Fri, 8 Aug 2008 12:59:26 +0000
(18:44 +0545)
committer
Bernie Innocenti
<bernie@codewiz.org>
Fri, 8 Aug 2008 12:59:26 +0000
(18:44 +0545)
geekigeeki.py
patch
|
blob
|
history
diff --git
a/geekigeeki.py
b/geekigeeki.py
index 44be2a46bcc3163307d0f65d62b7421b73c130f8..341bbad351166596fcad2701f2e2138f869232bc 100755
(executable)
--- a/
geekigeeki.py
+++ b/
geekigeeki.py
@@
-110,7
+110,7
@@
def send_guru(msg_text, msg_type):
}
</script>"""
}
</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
global title_done
if title_done: return
@@
-130,7
+130,7
@@
def send_title(name, text="Limbo", msg_text=None, msg_type='error'):
if icon_url:
print ' <link rel="icon" href="%s" />' % relative_url(icon_url)
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 ' <link rel="alternate" type="application/x-wiki" title="Edit this page" href="%s" \>' \
% (privileged_path() + '?edit=' + name)
@@
-141,7
+141,7
@@
def send_title(name, text="Limbo", msg_text=None, msg_type='error'):
print '</head>'
# Body
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 '<body ondblclick="location.href=\'' + privileged_path() + '?edit=' + name + '\'">'
else:
print '<body>'
@@
-155,7
+155,7
@@
def send_title(name, text="Limbo", msg_text=None, msg_type='error'):
print ' <b>' + link_tag('?fullsearch=' + name, text, 'navlink') + '</b> '
else:
print ' <b>' + text + '</b> '
print ' <b>' + link_tag('?fullsearch=' + name, text, 'navlink') + '</b> '
else:
print ' <b>' + text + '</b> '
- print ' | ' + link_tag('FrontPage', '
Front Pag
e', 'navlink')
+ print ' | ' + link_tag('FrontPage', '
Hom
e', 'navlink')
print ' | ' + link_tag('FindPage', 'Find Page', 'navlink')
if 'history_url' in globals():
print ' | <a href="' + history_url + '" class="navlink">Recent Changes</a>'
print ' | ' + link_tag('FindPage', 'Find Page', 'navlink')
if 'history_url' in globals():
print ' | <a href="' + history_url + '" class="navlink">Recent Changes</a>'
@@
-165,7
+165,11
@@
def send_title(name, text="Limbo", msg_text=None, msg_type='error'):
if name:
print ' | ' + link_tag('?raw=' + name, 'Raw Text', 'navlink')
if privileged_url is not None:
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>'
else:
print ' | <i>Immutable Page</i>'
@@
-653,17
+657,14
@@
class Page:
send_guru("Read access denied by ACLs", "notice")
def format(self):
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
#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()
self.send_naked()
- send_footer(page_name, self._last_modified())
+ send_footer(
self.
page_name, self._last_modified())
def _last_modified(self):
try:
def _last_modified(self):
try: