## 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 %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 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 ${error_field("CONFLICT", "public_description")} <%utils:line_field title="${_('sidebar')}" css_class="usertext" description="${_('shown in the sidebar of your subreddit. 5120 characters max.')}"> %if thing.site and thing.site.description: ${UserText(None, text=thing.site.description or "", editable=True, creating=True, name="description", have_form=False)} %else: ${UserText(None, text="", creating=True, name="description", have_form=False)} %endif ${error_field("CONFLICT", "description")} %if thing.site: %endif <%utils:line_field title="${_('language')}">
<% default_lang = thing.site and thing.site.lang or c.lang or '' default_lang = default_lang.split('-')[0] default_lang = g.lang if len(default_lang) != 2 else default_lang %> ${language_tool(all_langs = True, default_lang = default_lang)}
<%utils:line_field title="${_('type')}">
${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
${error_field("INVALID_OPTION", "type")}
<%utils:line_field title="${_('content options')}">
${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'))}
${error_field("INVALID_OPTION", "link_type")}
<%utils:line_field title="${_('wiki')}">
${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'))}
${error_field("INVALID_OPTION", "wikimode")}
%if thing.site: %else: %endif
%if thing.site: %else: %endif
<%utils:line_field title="${_('other options')}">
% if thing.site and thing.site.domain != thing.site._defaults['domain']: <%utils:line_field title="${_('domain')}" css_class="usertext">
%if thing.site and c.site.domain:
%endif
%if thing.site: %else: %endif
${toggle_button("help-toggle", _("what's this?"), _("hide help"), "helpon", "helpoff")}
% endif %if thing.site: <%utils:line_field title="${_('look and feel')}"> %if c.user_is_admin: <%utils:line_field title="${_('sponsorship')}"> %endif %endif
<% if thing.site: name = "edit" text = _("save options") else: name = "create" text = _("create") %> ${error_field("RATELIMIT", "ratelimit")}