Procházet zdrojové kódy

Fix source table when no sources were checked.

pull/24/head
Ben Kurtovic před 9 roky
rodič
revize
ba948123d0
2 změnil soubory, kde provedl 42 přidání a 32 odebrání
  1. +9
    -5
      static/style.css
  2. +33
    -27
      templates/index.mako

+ 9
- 5
static/style.css Zobrazit soubor

@@ -67,6 +67,10 @@ div#sources-title {
font-weight: bold;
}

div#cv-no-sources {
padding-bottom: 5px;
}

div#cv-additional {
padding-bottom: 5px;
display: none;
@@ -109,7 +113,7 @@ table#cv-chain-table {
}

tr#source-row-selected {
background-color: #CFCFCF;
background-color: #CFCFCF !important;
}

td#head-settings {
@@ -153,10 +157,6 @@ ul#cv-result-list {
margin: 0.5em 0;
}

span#cv-additional-text {
font-style: italic;
}

a#source-selected {
font-weight: bold;
}
@@ -222,6 +222,10 @@ input#cv-cb-links {
margin-right: 5px;
}

span.source-footer-text {
font-style: italic;
}

span.cv-hl {
background: #FAA;
}


+ 33
- 27
templates/index.mako Zobrazit soubor

@@ -166,36 +166,42 @@
% if query.action == "search":
<div id="sources-container">
<div id="sources-title">Checked Sources</div>
<table id="cv-result-sources">
<tr>
<th>URL</th>
<th>Confidence</th>
<th>Compare</th>
</tr>
% for i, source in enumerate(result.sources):
<tr ${'class="source-default-hidden"' if i >= 10 else 'id="source-row-selected"' if i == 0 else ""}>
<td><a ${'id="source-selected"' if i == 0 else ""} href="${source.url | h}">${source.url | h}</a></td>
<td>
% if source.skipped:
<% skips = True %>
<span class="source-skipped">Skipped</span>
% else:
<span class="source-confidence ${"source-suspect" if source.confidence >= T_SUSPECT else "source-possible" if source.confidence >= T_POSSIBLE else "source-novio"}">${round(source.confidence * 100, 1)}%</span>
% endif
</td>
<td>
% if i == 0:
<a href="#cv-chain-table">Compare</a>
% else:
<a href="${request.url | httpsfix, h}&amp;action=compare&amp;url=${source.url | u}">Compare</a>
% endif
</td>
% if result.sources:
<table id="cv-result-sources">
<tr>
<th>URL</th>
<th>Confidence</th>
<th>Compare</th>
</tr>
% endfor
</table>
% for i, source in enumerate(result.sources):
<tr ${'class="source-default-hidden"' if i >= 10 else 'id="source-row-selected"' if i == 0 else ""}>
<td><a ${'id="source-selected"' if i == 0 else ""} href="${source.url | h}">${source.url | h}</a></td>
<td>
% if source.skipped:
<% skips = True %>
<span class="source-skipped">Skipped</span>
% else:
<span class="source-confidence ${"source-suspect" if source.confidence >= T_SUSPECT else "source-possible" if source.confidence >= T_POSSIBLE else "source-novio"}">${round(source.confidence * 100, 1)}%</span>
% endif
</td>
<td>
% if i == 0:
<a href="#cv-chain-table">Compare</a>
% else:
<a href="${request.url | httpsfix, h}&amp;action=compare&amp;url=${source.url | u}">Compare</a>
% endif
</td>
</tr>
% endfor
</table>
% else:
<div id="cv-no-sources">
<span class="source-footer-text">No sources checked.</span>
</div>
% endif
% if len(result.sources) > 10:
<div id="cv-additional">
<span id="cv-additional-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>
<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>
% endif
</div>


Načítá se…
Zrušit
Uložit