If pages are Locked or the Wiki is read-only, is there an existing way to view the markup for a page?
Perhaps a 'View' button for the markup could replace the 'Edit' button, for these cases. 'View' might be useful along side the 'Edit' button, to encourage learning from others (without fear of breaking something) and perhaps for optimizing server performance (not that its a problem).
This is a low priority enhancement, but perhaps its trivial to implement. – Randy
You can go to page's history, click on the last diff, then click on the revision number of the last revision. It will show you the last revision's source. I know it's a little roundabout way… – Radomir Dopieralski
See 'Hint:' at http://72.192.119.192:8090/wiki/Markup
Read-only page markup can be viewed by prefixing
+download/ to the path/page_name.
– Randy
Here is a small patch against hatta1.3.3 that shows the "View" link rather than the "Edit" link for pages that are locked or if the wiki is read-only (in the footer function):
1650,1652c1650 < # if locked or read-only, show "View source" link < yield html.a(html(_(u'View')),class_="edit", < href=self.get_url(self.title, self.wiki.download)) --- > pass
Of course, I should have checked the -devel version and of course that code has changed since then.
. However, my patch is still applicaple, it has just moved to function render_content() where the 'pass' needs to be changed to edit_url = self.get_url(self.title, self.wiki.download)) or something like that. The only disadvantage is that it will still say "Edit" but you will view the source when the wiki is read-only. But that is reasonable bahavior, I would say.
I have put above change into a cloned hatta-devel repository. It works fine here. If you like the change, please pull it from http://bitbucket.org/spaetz/hatta-viewsource/ This is the only changeset I added. Thanks. –Spaetz