diff --git a/r2/r2/controllers/validator/wiki.py b/r2/r2/controllers/validator/wiki.py index 3fd62de5f..65b340860 100644 --- a/r2/r2/controllers/validator/wiki.py +++ b/r2/r2/controllers/validator/wiki.py @@ -202,7 +202,7 @@ class VWikiPage(Validator): page = normalize_page(page) - c.page = page + c.wiki_page = page if (not c.is_wiki_mod) and self.modonly: return self.set_error('MOD_REQUIRED', code=403) @@ -212,7 +212,7 @@ class VWikiPage(Validator): return # TODO: MAKE NOT REQUIRED - c.page_obj = wp + c.wiki_page_obj = wp return wp diff --git a/r2/r2/controllers/wiki.py b/r2/r2/controllers/wiki.py index 4d54c4a5d..3603336c1 100644 --- a/r2/r2/controllers/wiki.py +++ b/r2/r2/controllers/wiki.py @@ -80,7 +80,7 @@ class WikiController(RedditController): message = None if not page: - return self.redirect(join_urls(c.wiki_base_url, '/notfound/', c.page)) + return self.redirect(join_urls(c.wiki_base_url, '/notfound/', c.wiki_page)) if version: edit_by = version.author_name() @@ -216,7 +216,7 @@ class WikiController(RedditController): c.wiki_base_url = '%s/wiki' % base c.wiki_api_url = '%s/api/wiki' % base c.wiki_id = g.default_sr if frontpage else c.site.name - c.page = None + c.wiki_page = None c.show_wiki_actions = True self.editconflict = False c.is_wiki_mod = (c.user_is_admin or c.site.is_moderator(c.user)) if c.user_is_loggedin else False diff --git a/r2/r2/lib/pages/wiki.py b/r2/r2/lib/pages/wiki.py index 8d6428926..6af541e05 100644 --- a/r2/r2/lib/pages/wiki.py +++ b/r2/r2/lib/pages/wiki.py @@ -14,7 +14,7 @@ class WikiView(Templated): self.edit_by = edit_by self.edit_date = edit_date self.base_url = c.wiki_base_url - self.may_revise = this_may_revise(c.page_obj) + self.may_revise = this_may_revise(c.wiki_page_obj) Templated.__init__(self) class WikiPageListing(Templated): @@ -68,16 +68,16 @@ class WikiBase(Reddit): def __init__(self, content, actionless=False, alert=None, **context): pageactions = [] - if not actionless and c.page: - pageactions += [(c.page, _("view"), False)] - if this_may_revise(c.page_obj): + if not actionless and c.wiki_page: + pageactions += [(c.wiki_page, _("view"), False)] + if this_may_revise(c.wiki_page_obj): pageactions += [('edit', _("edit"), True)] - pageactions += [('revisions/%s' % c.page, _("history"), False)] + pageactions += [('revisions/%s' % c.wiki_page, _("history"), False)] pageactions += [('discussions', _("talk"), True)] if c.is_wiki_mod: pageactions += [('settings', _("settings"), True)] - action = context.get('wikiaction', (c.page, 'wiki')) + action = context.get('wikiaction', (c.wiki_page, 'wiki')) context['title'] = c.site.name if alert: @@ -90,7 +90,7 @@ class WikiBase(Reddit): class WikiPageView(WikiBase): def __init__(self, content, diff=None, **context): if not content and not context.get('alert'): - if this_may_revise(c.page_obj): + if this_may_revise(c.wiki_page_obj): context['alert'] = _("this page is empty, edit it to add some content.") content = WikiView(content, context.get('edit_by'), context.get('edit_date'), diff=diff) WikiBase.__init__(self, content, **context) @@ -117,7 +117,7 @@ class WikiSettings(WikiBase): class WikiRevisions(WikiBase): def __init__(self, revisions, **context): content = WikiPageRevisions(revisions) - context['wikiaction'] = ('revisions/%s' % c.page, _("revisions")) + context['wikiaction'] = ('revisions/%s' % c.wiki_page, _("revisions")) WikiBase.__init__(self, content, **context) class WikiRecent(WikiBase): diff --git a/r2/r2/lib/template_helpers.py b/r2/r2/lib/template_helpers.py index 268c0dc3e..658969f80 100755 --- a/r2/r2/lib/template_helpers.py +++ b/r2/r2/lib/template_helpers.py @@ -151,8 +151,8 @@ def js_config(): "static_root": static(''), } - if c.page: - config["wiki_page"] = c.page + if c.wiki_page: + config["wiki_page"] = c.wiki_page return config diff --git a/r2/r2/templates/wikibasepage.html b/r2/r2/templates/wikibasepage.html index 700d41923..0f7461e8d 100644 --- a/r2/r2/templates/wikibasepage.html +++ b/r2/r2/templates/wikibasepage.html @@ -28,7 +28,7 @@ %endif " %if action[2]: - href="${thing.base_url}/${action[0]}/${c.page}" + href="${thing.base_url}/${action[0]}/${c.wiki_page}" %else: href="${thing.base_url}/${action[0]}" %endif @@ -41,8 +41,8 @@ %if thing.title: ${thing.title} %endif - %if c.page: - ${c.page} + %if c.wiki_page: + ${c.wiki_page} %endif diff --git a/r2/r2/templates/wikieditpage.html b/r2/r2/templates/wikieditpage.html index 4c54e263e..6bc6ab147 100644 --- a/r2/r2/templates/wikieditpage.html +++ b/r2/r2/templates/wikieditpage.html @@ -48,5 +48,5 @@

- + diff --git a/r2/r2/templates/wikipagediscussions.html b/r2/r2/templates/wikipagediscussions.html index 02fbfb0d9..e92cce607 100644 --- a/r2/r2/templates/wikipagediscussions.html +++ b/r2/r2/templates/wikipagediscussions.html @@ -27,7 +27,7 @@ ${thing.listing} diff --git a/r2/r2/templates/wikipagerevisions.html b/r2/r2/templates/wikipagerevisions.html index efbb6e5a1..73e4bfa34 100644 --- a/r2/r2/templates/wikipagerevisions.html +++ b/r2/r2/templates/wikipagerevisions.html @@ -21,7 +21,7 @@ ############################################################################### ${thing.revisions} -%if c.page and thing.revisions.things: +%if c.wiki_page and thing.revisions.things: %endif
diff --git a/r2/r2/templates/wikipagesettings.html b/r2/r2/templates/wikipagesettings.html index 9c61205fc..11efb260a 100644 --- a/r2/r2/templates/wikipagesettings.html +++ b/r2/r2/templates/wikipagesettings.html @@ -63,7 +63,7 @@
  • ${user} —  - ${ynbutton(_("delete"), _("done"), quote("..%s/alloweditor/del" % (c.wiki_api_url)), hidden_data=dict(username=user, page=c.page), post_callback="$.refresh")} + ${ynbutton(_("delete"), _("done"), quote("..%s/alloweditor/del" % (c.wiki_api_url)), hidden_data=dict(username=user, page=c.wiki_page), post_callback="$.refresh")}
  • %endfor diff --git a/r2/r2/templates/wikirevision.html b/r2/r2/templates/wikirevision.html index b6e9e4ced..3a95b2590 100644 --- a/r2/r2/templates/wikirevision.html +++ b/r2/r2/templates/wikirevision.html @@ -33,7 +33,7 @@ %endif "> - %if c.page: + %if c.wiki_page: @@ -44,7 +44,7 @@ ${timestamp(thing.date)} ago - %if not c.page: + %if not c.wiki_page: ${thing.page} @@ -62,7 +62,7 @@ ${thing._get('reason')} - %if c.page and c.is_wiki_mod: + %if c.wiki_page and c.is_wiki_mod: hide