mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 00:07:57 -05:00
Add option to make subreddit traffic stats page public
This commit is contained in:
@@ -1736,6 +1736,7 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
over_18 = VBoolean('over_18'),
|
||||
allow_top = VBoolean('allow_top'),
|
||||
show_media = VBoolean('show_media'),
|
||||
public_traffic = VBoolean('public_traffic'),
|
||||
exclude_banned_modqueue = VBoolean('exclude_banned_modqueue'),
|
||||
show_cname_sidebar = VBoolean('show_cname_sidebar'),
|
||||
type = VOneOf('type', ('public', 'private', 'restricted', 'gold_restricted', 'archived')),
|
||||
@@ -1785,7 +1786,7 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
kw = dict((k, v) for k, v in kw.iteritems()
|
||||
if k in ('name', 'title', 'domain', 'description',
|
||||
'show_media', 'exclude_banned_modqueue',
|
||||
'show_cname_sidebar', 'type',
|
||||
'show_cname_sidebar', 'type', 'public_traffic',
|
||||
'link_type', 'submit_link_label', 'comment_score_hide_mins',
|
||||
'submit_text_label', 'lang', 'css_on_cname',
|
||||
'header_title', 'over_18', 'wikimode', 'wiki_edit_karma',
|
||||
|
||||
@@ -638,7 +638,8 @@ class FrontController(RedditController, OAuth2ResourceController):
|
||||
stylesheet = (c.site.stylesheet_contents_user or
|
||||
c.site.stylesheet_contents)
|
||||
pane = SubredditStylesheetSource(stylesheet_contents=stylesheet)
|
||||
elif (is_moderator or c.user_is_sponsor) and location == 'traffic':
|
||||
elif location == 'traffic' and (c.site.public_traffic or
|
||||
(is_moderator or c.user_is_sponsor)):
|
||||
pane = trafficpages.SubredditTraffic()
|
||||
elif (location == "about") and is_api():
|
||||
return self.redirect(add_sr('about.json'), code=301)
|
||||
|
||||
@@ -135,6 +135,7 @@ class ModAction(tdb_cassandra.UuidThing, Printable):
|
||||
'over_18': _('toggle viewers must be over 18'),
|
||||
'allow_top': _('toggle allow in default set'),
|
||||
'show_media': _('toggle show thumbnail images of content'),
|
||||
'public_traffic': _('toggle public traffic stats page'),
|
||||
'exclude_banned_modqueue': _('toggle exclude banned users\' posts from modqueue'),
|
||||
'domain': _('domain'),
|
||||
'show_cname_sidebar': _('toggle show sidebar from cname'),
|
||||
|
||||
@@ -104,6 +104,7 @@ class Subreddit(Thing, Printable):
|
||||
prev_public_description_id = "",
|
||||
allow_comment_gilding=True,
|
||||
hide_subscribers=False,
|
||||
public_traffic=False,
|
||||
)
|
||||
_essentials = ('type', 'name', 'lang')
|
||||
_data_int_props = Thing._data_int_props + ('mod_actions', 'reported',
|
||||
|
||||
@@ -264,6 +264,14 @@
|
||||
${_("exclude posts by site-wide banned users from modqueue")}
|
||||
</label>
|
||||
</li>
|
||||
<li>
|
||||
<input class="nomargin" type="checkbox"
|
||||
name="public_traffic" id="public_traffic"
|
||||
${thing.site and thing.site.public_traffic and "checked='checked'" or ""}>
|
||||
<label for="public_traffic">
|
||||
${_("make the traffic stats page available to everyone")}
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="usertext-edit">
|
||||
|
||||
Reference in New Issue
Block a user