This commit is contained in:
Ondřej 2023-08-16 21:09:18 +02:00
parent 165948da05
commit ac690f2fb2
2 changed files with 106 additions and 39 deletions

View file

@ -1,6 +1,12 @@
:root { :root {
--border-color: hsl(0 0% 90%); --border-color: hsl(0 0% 80%);
--accent-color: red; --accent-color: blue;
--color-muted: hsl(0 0% 50%);
--radius-m: 0.5em;
--font-size-m: 1rem;
--font-size-s: 0.85rem;
--font-size-xs: 0.75rem;
--font-size-l: 1.25rem;
} }
html { html {
@ -68,6 +74,10 @@ body {
padding: 0 2rem; padding: 0 2rem;
} }
ins {
background-color: green;
}
table, table,
th, th,
tr, tr,
@ -79,13 +89,71 @@ td {
list-style-type: none; list-style-type: none;
padding: 0; padding: 0;
display: flex; display: flex;
& .page-link {
display: block;
padding: 0.5em 1em;
}
& .page-item.active {
background-color: var(--accent-color);
}
} }
.page-link { .changeset {
display: block; padding: 1rem 1.5rem;
padding: 0.5em 1em; border: 1px solid var(--border-color);
border-radius: var(--radius-m);
margin-bottom: 1rem;
box-shadow: 0 2px 0 hsl(0 0% 50% / 20%);
} }
.page-item.active { .changeset-actions {
background-color: var(--accent-color); display: flex;
gap: 1rem;
margin-bottom: 0.75rem;
}
.changeset-feed-name,
.changeset-time,
.changeset-action {
font-weight: 500;
font-size: var(--font-size-s);
}
.changeset-feed-name,
.changeset-time {
/* color: var(--color-muted); */
}
.changeset-action {
display: inline-flex;
align-items: center;
gap: 0.5em;
font-weight: 500;
color: var(--color-muted);
text-decoration: none;
transition: color 200ms;
}
.changeset-action:first-of-type {
margin-left: 0.5em;
}
.changeset-action:hover {
color: var(--accent-color);
}
.changeset-title {
font-size: var(--font-size-l);
}
.changeset svg {
display: inline-block;
fill: currentColor;
width: 1.25em;
}
.changeset details[open] summary {
margin-bottom: 1rem;
} }

View file

@ -18,38 +18,37 @@
>Hledat</button> >Hledat</button>
</div> </div>
</form> </form>
<div class="table-responsive">
<table class="table table-hover"> {% for diff in diffs %}
<thead> <article class="changeset">
<tr> <p class="changeset-actions">
<th>Detection time</th> <span class="changeset-feed-name">{{ diff.feed_name }}</span>
<th>Source</th> <time class="changeset-time">{{ diff.diff_time }}</time>
<th>Diff</th> <a class="changeset-action" href="{{ diff.article_url }}">
<th>Original</th> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V11H19L18.9999 6.413L11.2071 14.2071L9.79289 12.7929L17.5849 5H13V3H21Z"></path></svg>
<th>Changed</th> Display article
</tr> </a>
</thead> <a class="changeset-action" href="/article/{{ diff.article_url }}">
<tbody> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM13 12H17V14H11V7H13V12Z"></path></svg>
{% for diff in diffs %} Show change history
<tr> </a>
<td>{{ diff.diff_time }}</td> </p>
<td> <details>
<a href="{{ diff.article_url }}" target="_blank" <summary class="changeset-title">
>{{ diff.feed_name }}</a {{ diff.diff_html|safe }}
> </summary>
</td> <p>
<td>{{ diff.diff_html|safe }}</td> <strong>Old</strong>:
<td class="expanded"> {{ diff.title_orig }}
<span class="long">{{ diff.title_orig }} </span> </p>
</td> <p>
<td class="expanded"> <strong>New</strong>:
<span class="long">{{ diff.title_new}} </span> {{ diff.title_new }}
</td> </p>
</tr> </details>
{% endfor %} </article>
</tbody> {% endfor %}
</table>
</div>
{{ pagination.links }} {{ pagination.links }}
{{ pagination.info }} {{ pagination.info }}
</div> </div>