mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 08:17:58 -05:00
wiki: Remove c.show_wiki_actions.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user