From 31028b08f39ca3ee7066ba5975225650e89f7bf0 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sat, 6 Sep 2014 20:46:07 -0500 Subject: [PATCH] Clean up error printing. --- templates/index.mako | 48 ++++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/templates/index.mako b/templates/index.mako index 3b47f81..9f07314 100644 --- a/templates/index.mako +++ b/templates/index.mako @@ -6,34 +6,26 @@ <%namespace module="copyvios.highlighter" import="highlight_delta"/>\ <%namespace module="copyvios.misc" import="httpsfix, urlstrip"/>\ % if query.submitted: - % if query.error == "bad action": -
-

Unknown action: ${query.action | h}.

-
- % elif query.error == "no search method": -
-

No copyvio search methods were selected. A check can only be made using a search engine, links present in the page, or both.

-
- % elif query.error == "no URL": -
-

URL comparison mode requires a URL to be entered. Enter one in the text box below, or choose copyvio search mode to look for content similar to the article elsewhere on the web.

-
- % elif query.error == "bad URI": -
-

Unsupported URI scheme: ${query.url | h}.

-
- % elif query.error == "no data": -
-

Couldn't find any text in ${query.url | h}. Note: only HTML and plain text pages are supported, and content generated by JavaScript or found inside iframes is ignored.

-
- % elif query.error == "timeout": -
-

The URL ${query.url | h} timed out before any data could be retrieved.

-
- % elif query.error == "search error": -
-

An error occurred while using the search engine (${query.exception}). Try reloading the page. If the error persists, repeat the check without using the search engine.

-
+ % if query.error: +

+ % if query.error == "bad action": + Unknown action: ${query.action | h}. + % elif query.error == "no search method": + No copyvio search methods were selected. A check can only be made using a search engine, links present in the page, or both. + % elif query.error == "no URL": + URL comparison mode requires a URL to be entered. Enter one in the text box below, or choose copyvio search mode to look for content similar to the article elsewhere on the web. + % elif query.error == "bad URI": + Unsupported URI scheme: ${query.url | h}. + % elif query.error == "no data": + Couldn't find any text in ${query.url | h}. Note: only HTML and plain text pages are supported, and content generated by JavaScript or found inside iframes is ignored. + % elif query.error == "timeout": + The URL ${query.url | h} timed out before any data could be retrieved. + % elif query.error == "search error": + An error occurred while using the search engine (${query.exception}). Try reloading the page. If the error persists, repeat the check without using the search engine. + % else: + An unknown error occurred. + % endif +

% elif not query.site:

The given site (project=${query.project | h}, language=${query.lang | h}) doesn't seem to exist. It may also be closed or private. Confirm its URL.