wiki: Remove c.show_wiki_actions.

This commit is contained in:
Andre D
2012-10-01 11:50:11 -05:00
committed by Neil Williams
parent 750bc4cbd5
commit b4feef712b
5 changed files with 7 additions and 10 deletions

View File

@@ -596,10 +596,8 @@ class FrontController(RedditController, OAuth2ResourceController):
elif is_moderator and location == 'banned':
pane = BannedList(editable = is_moderator)
elif is_moderator and location == 'wikibanned':
c.show_wiki_actions = True
pane = WikiBannedList(editable = is_moderator)
elif is_moderator and location == 'wikicontributors':
c.show_wiki_actions = True
pane = WikiMayContributeList(editable = is_moderator)
elif (location == 'contributors' and
# On public reddits, only moderators can see the whitelist.
@@ -645,6 +643,7 @@ class FrontController(RedditController, OAuth2ResourceController):
return self.abort404()
return EditReddit(content=pane,
show_wiki_actions='wiki' in location,
location=location,
extension_handling=extension_handling).render()

View File

@@ -625,9 +625,7 @@ class MinimalController(BaseController):
ratelimit_agents()
c.allow_loggedin_cache = False
c.show_wiki_actions = False
# the domain has to be set before Cookies get initialized
set_subreddit()
c.errors = ErrorSet()

View File

@@ -222,7 +222,6 @@ class WikiController(RedditController):
c.wiki_base_url = join_urls(c.site.path, 'wiki')
c.wiki_api_url = join_urls(c.site.path, '/api/wiki')
c.wiki_id = g.default_sr if frontpage else c.site.name
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
c.wikidisabled = False

View File

@@ -137,12 +137,13 @@ class Reddit(Templated):
def __init__(self, space_compress = True, nav_menus = None, loginbox = True,
infotext = '', content = None, short_description='', title = '', robots = None,
show_sidebar = True, footer = True, srbar = True, page_classes = None,
**context):
show_wiki_actions = False, **context):
Templated.__init__(self, **context)
self.title = title
self.short_description = short_description
self.robots = robots
self.infotext = infotext
self.show_wiki_actions = show_wiki_actions
self.loginbox = True
self.show_sidebar = show_sidebar
self.space_compress = space_compress and not g.template_debug
@@ -323,14 +324,14 @@ class Reddit(Templated):
ps.append(SubredditInfoBar())
moderator = c.user_is_loggedin and (c.user_is_admin or
c.site.is_moderator(c.user))
if c.show_wiki_actions:
if self.show_wiki_actions:
ps.append(self.wiki_actions_menu(moderator=moderator))
if moderator:
ps.append(self.sr_admin_menu())
if show_adbox:
ps.append(Ads())
no_ads_yet = False
elif c.show_wiki_actions:
elif self.show_wiki_actions:
ps.append(self.wiki_actions_menu())
user_banned = c.user_is_loggedin and c.site.is_banned(c.user)

View File

@@ -93,7 +93,7 @@ class WikiBase(Reddit):
elif c.wikidisabled:
context['infotext'] = _("this wiki is currently disabled, only mods may interact with this wiki")
context['content'] = WikiBasePage(content, action, pageactions, page=page, **context)
Reddit.__init__(self, **context)
Reddit.__init__(self, show_wiki_actions=True, **context)
class WikiPageView(WikiBase):
def __init__(self, content, page, diff=None, **context):