Skip to content

Commit c01d242

Browse files
authored
Merge pull request #1266 from twm/list-article-cols
Tabularize the article list
2 parents 16a6adc + 68a9ad0 commit c01d242

File tree

3 files changed

+107
-105
lines changed

3 files changed

+107
-105
lines changed

css/ListArticle.css

-87
This file was deleted.

css/main.css

-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ textarea[readonly] {
284284
@import "./Article.css";
285285
@import "./GlobalBar.css";
286286
@import "./icons.css";
287-
@import "./ListArticle.css";
288287
@import "./StateToggle.css";
289288
@import "./Tabs.css";
290289
@import "./FeedView.css";

yarrharr/templates/article_list.html

+107-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,114 @@
1+
<style nonce="{{ csp_nonce }}">
2+
3+
.list-article {
4+
display: flex; {# Flexbox rather than grid so we can omit columns without altering the styles. #}
5+
flex-flow: row nowrap;
6+
align-items: center;
7+
8+
margin: 0.75rem 0;
9+
10+
white-space: nowrap;
11+
12+
--focus-offset: var(--focus-offset-in); /* Don't clip focus ring. */
13+
14+
.meta1 {
15+
display: contents;
16+
17+
.feed-title, .date, .author {
18+
overflow: hidden;
19+
text-overflow: ellipsis;
20+
margin-right: 1rem;
21+
}
22+
.feed-title {
23+
flex: 0 0 10rem;
24+
}
25+
.date {
26+
flex: 0 0 12rem;
27+
}
28+
.author {
29+
flex: 0 0 8rem;
30+
}
31+
}
32+
33+
.meta2 {
34+
flex: 1 1 100%;
35+
min-width: 0;
36+
display: flex;
37+
flex-flow: row nowrap;
38+
justify-content: flex-end;
39+
gap: 1.5rem;
40+
margin-right: 1rem;
41+
42+
.title, .snippet {
43+
overflow: hidden;
44+
text-overflow: ellipsis;
45+
}
46+
47+
.title {
48+
flex: 0 1 max-content;
49+
color: var(--text-color);
50+
}
51+
&:hover .title {
52+
text-decoration-line: underline;
53+
text-decoration-color: var(--underline-color);
54+
}
55+
.snippet {
56+
flex: 1 1 0%;
57+
color: var(--quiet-text-color);
58+
}
59+
}
60+
61+
read-toggle,
62+
.view-link {
63+
flex: 0 0 var(--bar-height);
64+
}
65+
read-toggle {
66+
button {
67+
width: 100%;
68+
height: 100%;
69+
}
70+
}
71+
.view-link {
72+
}
73+
74+
.outbound-icon,
75+
read-toggle button,
76+
.view-link {
77+
font-size: var(--icon-size);
78+
display: flex;
79+
flex-flow: row nowrap;
80+
align-items: center;
81+
justify-content: center;
82+
83+
.icon {
84+
flex: 0 0 auto;
85+
display: block;
86+
align-self: center;
87+
justify-self: center;
88+
}
89+
}
90+
}
91+
92+
</style>
93+
194
{% for article in articles %}
295
<div class="list-article">
3-
<div class="list-article-inner">
4-
<div class="list-article-slider">
5-
<a class="outbound" href="{{ article.url }}" target="_blank" title="View on source site">
6-
{# TODO: relative time #}
7-
<span class="meta1">{{ article.feed.title }} — {{ article.date }} — {{ article.author }}</span>
8-
<span class="meta2">
9-
<span class="title">{{ article.title }}</span>
10-
<span class="snippet">{{ article.content_snippet }}</span>
11-
</span>
12-
</a>
13-
<read-toggle article-id="{{ article.id }}" {{ article.read|yesno:"checked," }}></read-toggle>
14-
<a class="square view-link" href="{% url 'article-show' article.id %}">
15-
<svg width="1em" height="1em" title="View article" class="icon" aria-hidden="false"><use xlink:href="#icon-follow"></use></svg>
16-
</a>
17-
</div>
18-
</div>
96+
<span class="meta1">
97+
<span class="feed-title">{{ article.feed.title }}</span>
98+
<span class="date">{{ article.date }}</span>
99+
<span class="author">{{ article.author }}</span>
100+
</span>
101+
<a class="meta2 no-underline" href="{{ article.url }}" target="_blank" title="View on source site">
102+
<span class="title">{{ article.title }}</span>
103+
<span class="snippet">{{ article.content_snippet }}</span>
104+
</a>
105+
<read-toggle article-id="{{ article.id }}" {{ article.read|yesno:"checked," }}></read-toggle>
106+
<a class="square view-link" href="{% url 'article-show' article.id %}">
107+
<svg width="1em" height="1em" title="View article" class="icon" aria-hidden="false"><use xlink:href="#icon-follow"></use></svg>
108+
</a>
19109
</div>
20110
{% endfor %}
21111

22112
{% if next_page_after %}
23-
<div class="pagination"><a class="no-underline" href="?after={{ next_page_after }}">More →</a></div>
113+
<div class="pagination"><a class="lazy-underline" href="?after={{ next_page_after }}">More →</a></div>
24114
{% endif %}

0 commit comments

Comments
 (0)