mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 06:48:01 -05:00
Expose 'archived' subreddit type to admins in the settings UI.
This commit is contained in:
committed by
Neil Williams
parent
fb79a8cbe5
commit
7c90a6ea51
@@ -1264,7 +1264,7 @@ class ApiController(RedditController):
|
||||
allow_top = VBoolean('allow_top'),
|
||||
show_media = VBoolean('show_media'),
|
||||
show_cname_sidebar = VBoolean('show_cname_sidebar'),
|
||||
type = VOneOf('type', ('public', 'private', 'restricted')),
|
||||
type = VOneOf('type', ('public', 'private', 'restricted', 'archived')),
|
||||
link_type = VOneOf('link_type', ('any', 'link', 'self')),
|
||||
ip = ValidIP(),
|
||||
sponsor_text =VLength('sponsorship-text', max_length = 500),
|
||||
@@ -1294,6 +1294,10 @@ class ApiController(RedditController):
|
||||
if cname_sr and (not sr or sr != cname_sr):
|
||||
c.errors.add(errors.USED_CNAME)
|
||||
|
||||
can_set_archived = c.user_is_admin or (sr and sr.type == 'archived')
|
||||
if type == 'archived' and not can_set_archived:
|
||||
form.set_error('type', errors.INVALID_OPTION)
|
||||
|
||||
if not sr and form.has_errors("ratelimit", errors.RATELIMIT):
|
||||
pass
|
||||
elif not sr and form.has_errors("name", errors.SUBREDDIT_EXISTS,
|
||||
|
||||
@@ -110,6 +110,13 @@
|
||||
${utils.radio_type('type', "private", _("private"),
|
||||
_("only approved members can view and submit"),
|
||||
(thing.site and thing.site.type=='private'))}
|
||||
|
||||
<% is_archived = thing.site and thing.site.type == 'archived' %>
|
||||
%if c.user_is_admin or is_archived:
|
||||
${utils.radio_type('type', "archived", _("archived"),
|
||||
_("anyone can view, but submissions are no longer accepted"),
|
||||
is_archived)}
|
||||
%endif
|
||||
</table>
|
||||
</div>
|
||||
</%utils:line_field>
|
||||
|
||||
Reference in New Issue
Block a user