Add pointer to /help/search if search query was mangled

This commit is contained in:
Keith Mitchell
2012-04-09 20:50:46 -07:00
committed by Logan Hanks
parent 24854c9c31
commit 3d87a7956a
2 changed files with 7 additions and 1 deletions

View File

@@ -694,6 +694,7 @@ class FrontController(RedditController):
simple=True).render()
return res
search_help_page = "/help/search"
verify_langs_regex = re.compile(r"\A[a-z][a-z](,[a-z][a-z])*\Z")
@base_listing
@validate(query = VLength('q', max_length=512),
@@ -734,7 +735,11 @@ class FrontController(RedditController):
cleanup_message = strings.invalid_search_query % {
"clean_query": cleaned
}
cleanup_message += " "
cleanup_message += strings.search_help % {"search_help":
self.search_help_page
}
res = SearchPage(_('search results'), query, t, num, content=spane,
nav_menus = [SearchSortMenu(default=sort)],
search_params = dict(sort = sort),

View File

@@ -141,6 +141,7 @@ string_dict = dict(
search_failed = _("Our search machines are under too much load to handle your request right now. :( Sorry for the inconvenience. Try again in a little bit -- but please don't mash reload; that only makes the problem worse."),
invalid_search_query = _("I couldn't understand your query, so I simplified it and searched for \"%(clean_query)s\" instead."),
completely_invalid_search_query = _("I couldn't understand your search query. Please try again."),
search_help = _("You may also want to check the [search help page](%(search_help)s) for more information."),
generic_quota_msg = _("You've submitted too many links recently. Please try again in an hour."),
verified_quota_msg = _("Looks like you're either a brand new user or your posts have not been doing well recently. You may have to wait a bit to post again. In the meantime feel free to [check out the reddiquette](%(reddiquette)s) or join the conversation in a different thread."),
unverified_quota_msg = _("Looks like you're either a brand new user or your posts have not been doing well recently. You may have to wait a bit to post again. In the meantime feel free to [check out the reddiquette](%(reddiquette)s), join the conversation in a different thread, or [verify your email address](%(verify)s)."),