Mercurial > moin > 1.9
changeset 286:08cd0e9b9369
do not show gui editor for non-wiki format pages
imported from: moin--main--1.5--patch-290
author | Thomas Waldmann <tw@waldmann-edv.de> |
---|---|
date | Sun, 04 Dec 2005 17:37:56 +0000 |
parents | 2323fc2eab55 |
children | 3958ec0fec55 |
files | MoinMoin/Page.py MoinMoin/theme/__init__.py docs/CHANGES |
diffstat | 3 files changed, 22 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/Page.py Sun Dec 04 16:06:53 2005 +0000 +++ b/MoinMoin/Page.py Sun Dec 04 17:37:56 2005 +0000 @@ -57,6 +57,7 @@ self._raw_body_modified = 0 self.hilite_re = None self.language = None + self.pi_format = None self.reset()
--- a/MoinMoin/theme/__init__.py Sun Dec 04 16:06:53 2005 +0000 +++ b/MoinMoin/theme/__init__.py Sun Dec 04 17:37:56 2005 +0000 @@ -1042,6 +1042,13 @@ self.attachmentsLink(page), self.actionsMenu(page),] + def guiworks(self, page): + """ Return whether the gui editor / converter can work for that page. + + The GUI editor currently only works for wiki format. + """ + return page.pi_format == 'wiki' + def editorLink(self, page): """ Return a link to the editor @@ -1057,16 +1064,21 @@ _ = self.request.getText params = (wikiutil.quoteWikinameURL(page.page_name) + '?action=edit&editor=') - - if self.showBothEditLinks(): + + guiworks = self.guiworks(page) + if self.showBothEditLinks() and guiworks: text = _('Edit (Text)', formatted=False) params = params + 'text' attrs = 'name="texteditlink"' else: text = _('Edit', formatted=False) - # 'textonly' will be upgraded dynamically to 'guipossible' by JS - params = params + 'textonly' - attrs='name="editlink"' + if guiworks: + # 'textonly' will be upgraded dynamically to 'guipossible' by JS + params = params + 'textonly' + attrs = 'name="editlink"' + else: + params = params + 'text' + attrs = 'name="texteditlink"' return wikiutil.link_tag(self.request, params, text, attrs=attrs) @@ -1086,7 +1098,8 @@ page = d['page'] if not (page.isWritable() and self.request.user.may.write(page.page_name) and - self.showBothEditLinks()): + self.showBothEditLinks() and + self.guiworks(page)): return '' _ = self.request.getText
--- a/docs/CHANGES Sun Dec 04 16:06:53 2005 +0000 +++ b/docs/CHANGES Sun Dec 04 17:37:56 2005 +0000 @@ -23,6 +23,8 @@ e.g. a.http.before. See theme's common.css. * Hopefully fixed some issue with non-ASCII attachment filenames. * Workaround for Opera 8.5 making silly "No addition" categories. + * Do not show GUI editor for non-wiki format pages, because we only have a + converter from html to wiki right now. Other changes: * Added irc:// to the builtin supported link schemas. You can remove it