diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 4a30d5e4e..6ef266842 100644 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -125,7 +125,7 @@ class ApiController(RedditController): else: emailer.ad_inq_email(email, message, name = name or '', reply_to = replyto or '') - form.set_html(".success", _("thanks for your message! " + form.set_html(".status", _("thanks for your message! " "you should hear back from us shortly.")) form.set_inputs(personal = "", captcha = "") @@ -946,7 +946,10 @@ class ApiController(RedditController): c.errors.add(errors.USED_CNAME) if not sr and form.has_errors(None, errors.RATELIMIT): - pass + # this form is a little odd in that the error field + # doesn't occur within the form, so we need to manually + # set this text + form.parent().find('.RATELIMIT').html(c.errors[errors.RATELIMIT].message).show() elif not sr and form.has_errors("name", errors.SUBREDDIT_EXISTS, errors.BAD_SR_NAME): form.find('#example_name').hide() @@ -968,7 +971,7 @@ class ApiController(RedditController): sr._incr('_ups', 1) sr.add_moderator(c.user) sr.add_contributor(c.user) - redir = sr.path + "about/edit/" + redir = sr.path + "about/edit/?created=true" if not c.user_is_admin: VRatelimit.ratelimit(rate_user=True, rate_ip = True, diff --git a/r2/r2/controllers/error.py b/r2/r2/controllers/error.py index 4c4bdf5a3..c2c4c14f7 100644 --- a/r2/r2/controllers/error.py +++ b/r2/r2/controllers/error.py @@ -26,6 +26,7 @@ from pylons.middleware import error_document_template, media_path from pylons import c, request, g from pylons.i18n import _ import random as rand +from r2.lib.filters import safemarkdown, unsafe try: # place all r2 specific imports in here. If there is a code error, it'll get caught and @@ -33,7 +34,7 @@ try: from reddit_base import RedditController from r2.models.subreddit import Default, Subreddit from r2.lib import pages - from r2.lib.strings import rand_strings + from r2.lib.strings import strings, rand_strings except Exception, e: if g.debug: # if debug mode, let the error filter up to pylons to be handled @@ -113,7 +114,10 @@ class ErrorController(RedditController): def send404(self): c.response.status_code = 404 if c.site._spam and not c.user_is_admin: - res = pages.RedditError(_("this reddit has been banned.")) + message = (strings.banned_subreddit % dict(link = '/feedback')) + + res = pages.RedditError(_('this reddit has been banned'), + unsafe(safemarkdown(message))) return res.render() else: return pages.Reddit404().render() diff --git a/r2/r2/controllers/front.py b/r2/r2/controllers/front.py index ca975ae00..ab12ef09e 100644 --- a/r2/r2/controllers/front.py +++ b/r2/r2/controllers/front.py @@ -227,8 +227,10 @@ class FrontController(RedditController): return self.abort404() @base_listing - @validate(location = nop('location')) - def GET_editreddit(self, location, num, after, reverse, count): + @validate(location = nop('location'), + created = VOneOf('created', ('true','false'), + default = 'false')) + def GET_editreddit(self, location, num, after, reverse, count, created): """Edit reddit form.""" if isinstance(c.site, FakeSubreddit): return self.abort404() @@ -237,7 +239,10 @@ class FrontController(RedditController): is_moderator = c.user_is_loggedin and c.site.is_moderator(c.user) or c.user_is_admin if is_moderator and location == 'edit': - pane = CreateSubreddit(site = c.site) + pane = PaneStack() + if created == 'true': + pane.append(InfoBar(message = _('your reddit has been created'))) + pane.append(CreateSubreddit(site = c.site)) elif location == 'moderators': pane = ModList(editable = is_moderator) elif is_moderator and location == 'banned': diff --git a/r2/r2/lib/pages/pages.py b/r2/r2/lib/pages/pages.py index 9b4cedc0a..574a5c250 100644 --- a/r2/r2/lib/pages/pages.py +++ b/r2/r2/lib/pages/pages.py @@ -624,10 +624,12 @@ class InfoBar(Wrapped): class RedditError(BoringPage): site_tracking = False - def __init__(self, msg): - BoringPage.__init__(self, msg, loginbox=False, + def __init__(self, title, message = None): + if not message: + message = title + BoringPage.__init__(self, title, loginbox=False, show_sidebar = False, - content=ErrorPage(msg)) + content=ErrorPage(message)) class Reddit404(BoringPage): site_tracking = False @@ -1192,4 +1194,3 @@ class PromoteLinkForm(Wrapped): timedeltatext = timedeltatext, listing = listing, *a, **kw) - diff --git a/r2/r2/lib/strings.py b/r2/r2/lib/strings.py index 512bc4691..31d80f1a9 100644 --- a/r2/r2/lib/strings.py +++ b/r2/r2/lib/strings.py @@ -89,7 +89,7 @@ string_dict = dict( moderator = _('below are the reddits that you have moderator access to.') ), - sr_subscribe = _('click the  or  buttons to choose which reddits appear on your front page.'), + sr_subscribe = _('click the `add` or `remove` buttons to choose which reddits appear on your front page.'), searching_a_reddit = _('you\'re searching within the [%(reddit_name)s](%(reddit_link)s) reddit. '+ 'you can also search within [all reddits](%(all_reddits_link)s)'), @@ -107,6 +107,11 @@ string_dict = dict( submit_box_text = _('to anything interesting: news article, blog entry, video, picture...'), permalink_title = _("%(author)s comments on %(title)s"), link_info_title = _("%(title)s : %(site)s"), + banned_subreddit = _("""this reddit has been banned. please inform [feedback](%(link)s) + if you feel that this is in error, or that you are the target + of a well-coordinated international conspiracy to silence you + and your kind. but if it's the latter, it's probably already + too late. who can you trust?"""), ) class StringHandler(object): diff --git a/r2/r2/templates/feedback.html b/r2/r2/templates/feedback.html index 82a864896..dc6cdf64b 100644 --- a/r2/r2/templates/feedback.html +++ b/r2/r2/templates/feedback.html @@ -22,9 +22,6 @@ <%namespace file="utils.html" import="error_field"/> -
${thing.success or ''} -
- %if thing.title:${thing.success or ''} +
+ %if c.user_is_loggedin: - + %endif