From aec015e50685a5e31baa596f794c605b225626ca Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Mon, 8 Sep 2014 01:24:18 -0500 Subject: [PATCH] Integrate search mode into the new comparison mode display. --- static/style.css | 22 +++++++++------------ templates/index.mako | 56 +++++++++++++++++++++------------------------------- 2 files changed, 32 insertions(+), 46 deletions(-) diff --git a/static/style.css b/static/style.css index bc175eb..58f2724 100644 --- a/static/style.css +++ b/static/style.css @@ -67,12 +67,7 @@ div#sources-title { font-weight: bold; } -div#cv-no-sources { - padding-bottom: 5px; -} - div#cv-additional { - padding-bottom: 5px; display: none; } @@ -192,10 +187,6 @@ h2#cv-result-header { margin: 0; } -ul#cv-result-list { - margin: 0.5em 0; -} - span#redirected-from { font-size: 0.75em; font-weight: normal; @@ -242,6 +233,15 @@ div.indentable { white-space: pre-wrap; } +div.cv-source-footer { + padding-bottom: 5px; + font-style: italic; +} + +div.cv-source-footer a { + font-style: normal; +} + div.cv-chain-detail { padding: 0 10px 0 10px; background-color: #FFF; @@ -275,10 +275,6 @@ input#cv-cb-links { margin-right: 5px; } -span.source-footer-text { - font-style: italic; -} - span.cv-hl { background: #FAA; } diff --git a/templates/index.mako b/templates/index.mako index b9a6861..9cf26a5 100644 --- a/templates/index.mako +++ b/templates/index.mako @@ -141,27 +141,25 @@ % if result: - % if query.action == "compare": -
Results generated in ${round(result.time, 3)} seconds.
- % endif +
+ % if result.cached: + Results cachedTo save time (and money), this tool will retain the results of checks for up to 72 hours. This includes the URLs of the checked sources, but neither their content nor the content of the article. Future checks on the same page (assuming it remains unchanged) will not involve additional search queries, but a fresh comparison against the source URL will be made. If the page is modified, a new check will be run. from ${result.cache_age} ago. Originally generated in ${round(result.time, 3)} seconds using ${result.queries} queries. + % elif result.action == "search": + Results generated in ${round(result.time, 3)} seconds using ${result.queries} queries. + % else: + Results generated in ${round(result.time, 3)} seconds. + % endif +
- % if query.action == "search": + % if query.action == "search" and not result.sources:

- % if result.confidence >= T_POSSIBLE: - ${query.page.title | h} - % if query.oldid: - @${query.oldid | h} - % endif - is a ${"suspected" if result.confidence >= T_SUSPECT else "possible"} violation of ${result.url | urlstrip, h}. + % if query.oldid: + No violations detected in ${query.page.title | h} @${query.oldid | h}. % else: - % if query.oldid: - No violations detected in ${query.page.title | h} @${query.oldid | h}. - % else: - No violations detected in ${query.page.title | h}. - % endif + No violations detected in ${query.page.title | h}. % endif

- % elif query.action == "compare": + % else:
@@ -192,8 +190,8 @@
% endif
- <% skips = False %> % if query.action == "search": + <% skips = False %>
Checked Sources
% if result.sources: @@ -225,29 +223,21 @@ % endfor % else: -
- No sources checked. + % endif % if len(result.sources) > 10: -
- ${len(result.sources) - 10} URL${"s" if len(result.sources) > 11 else ""} with lower confidence hidden. Show them. + % endif -
- +
% endif