Subreddit Rules: Update titles

This commit is contained in:
Matt Lee
2016-02-04 12:26:40 -05:00
parent f763eea5f6
commit daddd8bbf7
3 changed files with 9 additions and 3 deletions

View File

@@ -953,9 +953,14 @@ class FrontController(RedditController):
"link": _("Posts only"),
"comment": _("Comments only"),
}
content = Rules(kind_labels=kind_labels)
title_string = _("Rules for r/%(subreddit)s") % { "subreddit" : c.site.name }
content = Rules(
title=title_string,
kind_labels=kind_labels,
)
extra_js_config = {"kind_labels": kind_labels}
return ModToolsPage(
title=title_string,
content=content,
extra_js_config=extra_js_config,
).render()

View File

@@ -4013,7 +4013,8 @@ class ModToolsPage(Reddit):
class Rules(Templated):
"""Show subreddit rules for everyone and add edit controls for mods."""
def __init__(self, kind_labels):
def __init__(self, title, kind_labels):
self.title = title
self.can_edit = c.user_is_loggedin and (c.user_is_admin or
c.site.is_moderator_with_perms(c.user, 'config'))
self.rules = SubredditRules.get_rules(c.site)

View File

@@ -36,7 +36,7 @@
<div class="subreddit-rules-page ${'editable' if thing.can_edit else ''}">
<header class="md-container">
<div class="md">
<h2>Community Rules</h2>
<h2>${thing.title}</h2>
<p>
Rules that visitors must follow to participate. May be used as
reasons to report or ban.