Explorar el Código

Integrate search mode into the new comparison mode display.

pull/24/head
Ben Kurtovic hace 9 años
padre
commit
aec015e506
Se han modificado 2 ficheros con 32 adiciones y 46 borrados
  1. +9
    -13
      static/style.css
  2. +23
    -33
      templates/index.mako

+ 9
- 13
static/style.css Ver fichero

@@ -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;
}


+ 23
- 33
templates/index.mako Ver fichero

@@ -141,27 +141,25 @@
</table>
</form>
% if result:
% if query.action == "compare":
<div id="generation-time">Results generated in <span class="mono">${round(result.time, 3)}</span> seconds.</div>
% endif
<div id="generation-time">
% if result.cached:
Results <a id="cv-cached" href="#">cached<span>To 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.</span></a> from <abbr title="${result.cache_time}">${result.cache_age} ago</abbr>. Originally generated in <span class="mono">${round(result.time, 3)}</span> seconds using <span class="mono">${result.queries}</span> queries.
% elif result.action == "search":
Results generated in <span class="mono">${round(result.time, 3)}</span> seconds using <span class="mono">${result.queries}</span> queries.
% else:
Results generated in <span class="mono">${round(result.time, 3)}</span> seconds.
% endif
</div>
<div id="cv-result" class="${'red' if result.confidence >= T_SUSPECT else 'yellow' if result.confidence >= T_POSSIBLE else 'green'}-box">
% if query.action == "search":
% if query.action == "search" and not result.sources:
<h2 id="cv-result-header">
% if result.confidence >= T_POSSIBLE:
<a href="${query.page.url}">${query.page.title | h}</a>
% if query.oldid:
@<a href="//${query.site.domain | h}/w/index.php?oldid=${query.oldid | h}">${query.oldid | h}</a>
% endif
is a ${"suspected" if result.confidence >= T_SUSPECT else "possible"} violation of <a href="${result.url | h}">${result.url | urlstrip, h}</a>.
% if query.oldid:
No violations detected in <a href="${query.page.url}">${query.page.title | h}</a> @<a href="//${query.site.domain | h}/w/index.php?oldid=${query.oldid | h}">${query.oldid | h}</a>.
% else:
% if query.oldid:
No violations detected in <a href="${query.page.url}">${query.page.title | h}</a> @<a href="//${query.site.domain | h}/w/index.php?oldid=${query.oldid | h}">${query.oldid | h}</a>.
% else:
No violations detected in <a href="${query.page.url}">${query.page.title | h}</a>.
% endif
No violations detected in <a href="${query.page.url}">${query.page.title | h}</a>.
% endif
</h2>
% elif query.action == "compare":
% else:
<table id="cv-result-head-table">
<tr>
<td>
@@ -192,8 +190,8 @@
</table>
% endif
</div>
<% skips = False %>
% if query.action == "search":
<% skips = False %>
<div id="sources-container">
<div id="sources-title">Checked Sources</div>
% if result.sources:
@@ -225,29 +223,21 @@
% endfor
</table>
% else:
<div id="cv-no-sources">
<span class="source-footer-text">No sources checked.</span>
<div class="cv-source-footer">
No sources checked.
</div>
% endif
% if len(result.sources) > 10:
<div id="cv-additional">
<span class="source-footer-text">${len(result.sources) - 10} URL${"s" if len(result.sources) > 11 else ""} with lower confidence hidden.</span> <a id="show-additional-sources" href="#">Show them.</a>
<div id="cv-additional" class="cv-source-footer">
${len(result.sources) - 10} URL${"s" if len(result.sources) > 11 else ""} with lower confidence hidden. <a id="show-additional-sources" href="#">Show them.</a>
</div>
% endif
</div>
<ul id="cv-result-list">
% if query.redirected_from:
<li>Redirected from <a href="${query.redirected_from.url}">${query.redirected_from.title | h}</a>. <a href="${request.url | httpsfix, h}&amp;noredirect=1">Check the original page.</a></li>
% endif
% if skips:
<li>Since a suspected source was found with a high confidence value, some URLs were skipped. <a href="${request.url | httpsfix, h}&amp;noskip=1">Check all URLs.</a></li>
% endif
% if result.cached:
<li>Results are <a id="cv-cached" href="#">cached<span>To 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.</span></a> from <abbr title="${result.cache_time}">${result.cache_age} ago</abbr>. Originally generated in <span class="mono">${round(result.time, 3)}</span> seconds using <span class="mono">${result.queries}</span> queries. <a href="${request.url | httpsfix, h}&amp;nocache=1">Bypass the cache.</a></li>
% else:
<li>Results generated in <span class="mono">${round(result.time, 3)}</span> seconds using <span class="mono">${result.queries}</span> queries.</li>
<div class="cv-source-footer">
Since a suspected source was found with a high confidence value, some URLs were skipped. <a href="${request.url | httpsfix, h}&amp;noskip=1">Check all URLs.</a>
</div>
% endif
</ul>
</div>
% endif
<div id="cv-chain-container">
<table id="cv-chain-table">


Cargando…
Cancelar
Guardar