REFACTORED THIS
- in theme init, you have self.page and self.page_name, but you almost always use self.page.page_name from the methods
- rename self.page_name to self.item_name
- use self.item_name everywhere instead of self.page.page_name
- do a clean changeset, make sure you change only this stuff, make sure you change all of it, review changeset, commit
- in theme init, you have self.request and self.cfg, but you almost always use self.request.cfg
- use self.cfg
- do a clean changeset, make sure you change only this stuff, make sure you change all of it, review changeset, commit
- in theme init, assign to self.user and use it instead of (self.)request.user
- do a clean changeset, make sure you change only this stuff, make sure you change all of it, review changeset, commit
merge moin/2.0-dev and use wikiutil.ParentPageName() to implement Theme.parent_page
<meta http-equiv="Content-Type" content="{{ theme.page.output_mimetype }};charset={{ theme.page.output_charset }}">
- don't use .page in the templates, assign the stuff you need in theme init and use it from there
- in theme init, use self.item_exists = Page(request, item_name).exists()
- use self.item_exists at all places where you check .exists() for the current item (e.g. for self.page)
- do a clean changeset, make sure you change only this stuff, make sure you change all of it, review changeset, commit
- in theme init, use self.item_readable = user.may.read(item_name), same for writable
- use self.item_readable at all places where you check readability for the current item, similar for self.item_writable
- do a clean changeset, make sure you change only this stuff, make sure you change all of it, review changeset, commit
- kill this:
# Enable delete cache only if page can use caching if action == 'refresh': if not page.canUseCache(): do = 'show' disabled = True
replace Page(request, pagename).exists() by request.storage.has_item(itemname)
- in theme init, assing self.storage = request.storage and then use self.storage in the rest of the code