## 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.strings import strings from r2.lib.pages import UserText from r2.lib.template_helpers import add_sr %> <%namespace file="utils.html" import="error_field, submit_form, _a_buffered, reddit_selector"/> <%namespace name="utils" file="utils.html"/> <% if thing.default_sr: sr = " " + _a_buffered(thing.default_sr.name, href=thing.default_sr.path) else: sr = _("reddit") %>

${unsafe(_("submit to %(sr)s") % dict(sr=sr))}

<%utils:submit_form onsubmit="return post_form(this, 'submit', linkstatus, null, true)" action=${add_sr("/submit")}, _class="submit content", _id="newlink"> %if thing.show_link and thing.show_self: ${thing.formtabs_menu} %endif
%if thing.show_link: %endif %if thing.show_self:
${strings.submit_text}
%endif
<%utils:round_field title="${_('title')}" id="title-field"> ${error_field("NO_TEXT", "title", "div")} ${error_field("TOO_LONG", "title", "div")}
%if thing.show_link:
<%utils:round_field title="${_('url')}" id="url-field"> ${error_field("NO_URL", "url", "div")} ${error_field("BAD_URL", "url", "div")} ${error_field("DOMAIN_BANNED", "url", "div")} ${error_field("ALREADY_SUB", "url", "div")} ${error_field("NO_LINKS", "sr")} ${error_field("NO_SELFS", "sr")}
%endif %if thing.show_self:
<%utils:round_field title="${_('text')}", description="${_('(optional)')}" id="text-field"> ${UserText(None, text = thing.text, have_form = False, creating = True)} ${error_field("NO_SELFS", "sr")}
%endif
<%utils:round_field title="${_('choose a subreddit')}" id="reddit-field"> ${reddit_selector(thing.default_sr.name if thing.default_sr else None, thing.sr_searches, thing.subreddits)}
${thing.captcha}
${error_field("RATELIMIT", "ratelimit")} ${error_field("INVALID_OPTION", "sr")}
%if thing.show_self and thing.show_link: %endif