## The contents of this file are subject to the Common Public Attribution
## License Version 1.0. (the "License"); you may not use this file except in
## compliance with the License. You may obtain a copy of the License at
## http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
## License Version 1.1, but Sections 14 and 15 have been added to cover use of
## software over a computer network and provide for limited attribution for the
## Original Developer. In addition, Exhibit A has been modified to be
## consistent with Exhibit B.
##
## Software distributed under the License is distributed on an "AS IS" basis,
## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
## the specific language governing rights and limitations under the License.
##
## The Original Code is reddit.
##
## The Original Developer is the Initial Developer. The Initial Developer of
## the Original Code is reddit Inc.
##
## All portions of the code written by reddit are Copyright (c) 2006-2012
## reddit Inc. All Rights Reserved.
###############################################################################
<%!
from r2.lib.filters import keep_space
from r2.lib.pages import UserText
%>
<%namespace file="utils.html" import="error_field, language_tool, plain_link"/>
<%namespace file="utils.html" import="image_upload"/>
<%namespace file="printablebuttons.html" import="toggle_button, simple_button" />
<%namespace name="utils" file="utils.html"/>
%if not thing.site:
<%utils:line_field title="${_('name')}"
description='${_("no spaces, e.g., slashdot")}'>
%if not thing.site:
${error_field("SUBREDDIT_EXISTS", "name")}
${error_field("BAD_SR_NAME", "name")}
%endif
%utils:line_field>
%else:
%endif
<%utils:line_field title="${_('title')}"
description='${_("e.g., slashdot: news for nerds, stuff that matters")}'>
%if thing.site:
%else:
%endif
${error_field("NO_TEXT", "title")}
${error_field("TOO_LONG", "title")}
%utils:line_field>
<%utils:line_field title="${_('description')}" css_class="usertext"
description="${_('publicly describe your subreddit for all to see. 500 characters max.')}">
%if thing.site and thing.site.public_description:
${UserText(None, text=thing.site.public_description or "", editable=True, creating=True, name="public_description", have_form=False)}
%else:
${UserText(None, text="", creating=True, name="public_description", have_form=False)}
%endif
${utils.radio_type('type', "public", _("public"),
_("anyone can view and submit"),
(not thing.site or thing.site.type=='public'))}
${utils.radio_type('type', "restricted", _("restricted"),
_("anyone can view, but only some are approved to submit links"),
(thing.site and thing.site.type=='restricted'))}
${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
${utils.radio_type('link_type', "any", _("any"),
_("any link type is allowed"),
(not thing.site or thing.site.link_type=='any'))}
${utils.radio_type('link_type', "link", _("links only"),
_("only links to external sites are allowed"),
(thing.site and thing.site.link_type=='link'))}
${utils.radio_type('link_type', "self", _("text posts only"),
_("only text/self posts are allowed"),
(thing.site and thing.site.link_type=='self'))}
${utils.radio_type('wikimode', "disabled", _("disabled"),
_("Wiki is disabled for all users except mods"),
(not thing.site or thing.site.wikimode == 'disabled'))}
${utils.radio_type('wikimode', "modonly", _("mod editing"),
_("Only mods or those on a pages edit list may edit"),
(thing.site and thing.site.wikimode == 'modonly'))}
${utils.radio_type('wikimode', "anyone", _("anyone"),
_("Anyone who can submit to the subreddit may edit"),
(thing.site and thing.site.wikimode == 'anyone'))}
${_("Own a domain? Enter it here and then go to your DNS provider and add a CNAME record aliasing your domain to rhs.reddit.com. You will be able to access your reddit through your domain.")}
%utils:line_field>
% endif
%if thing.site:
<%utils:line_field title="${_('look and feel')}">
${plain_link(_("edit the stylesheet"),
"/about/stylesheet",
_sr_path = True)}
(${_("leaves this page")})