Files: fb012f7e00f1b895de8756242d4e6eb0d5bb028f / themes / ran / templates / period_archives.html
5253 bytesRaw
1 | {%- extends "base.html" -%} |
2 | {%- block title -%} |
3 | {# period is a string, but we want a date, so use an article's date. #} |
4 | {%- if period | length == 1 -%} |
5 | {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}} |
6 | {%- elif period | length == 2 -%} |
7 | {{- dates[0].date | strftime(DATE_FORMAT_MONTH) -}} |
8 | {%- else -%} |
9 | {{- dates[0].date | strftime(DATE_FORMAT_DAY) -}} |
10 | {%- endif -%} |
11 | {%- endblock -%} |
12 | {%- block pagedetails -%} |
13 | {{- super() -}} |
14 | {%- if period | length == 1 and |
15 | dates | unique(attribute="date.month") | list | length > 1 -%} |
16 | <section class="smalllinks"> |
17 | <h2>Months:</h2> |
18 | <ul> |
19 | {%- for article in dates | |
20 | reverse | |
21 | unique(attribute="date.month") -%} |
22 | <li> |
23 | <a href="/{{- article.date | strftime('%Y/%m') -}}"> |
24 | <time datetime="{{- article.date | |
25 | strftime('%Y-%m') -}}"> |
26 | {{- article.date | |
27 | strftime(DATE_FORMAT_MONTH_OF_YEAR) |
28 | -}} |
29 | </time> |
30 | </a> |
31 | </li> |
32 | {%- endfor -%} |
33 | </ul> |
34 | </section> |
35 | {%- elif period | length == 2 and |
36 | dates | unique(attribute="date.day") | list | length > 1 -%} |
37 | <section class="smalllinks"> |
38 | <h2>Days:</h2> |
39 | <ul> |
40 | {%- for article in dates | |
41 | reverse | |
42 | unique(attribute="date.day") -%} |
43 | <li> |
44 | <a href="/{{- article.date | strftime('%Y/%m/%d') -}}"> |
45 | <time datetime="{{- article.date | |
46 | strftime('%Y-%m-%d') -}}"> |
47 | {{- article.date | |
48 | strftime(DATE_FORMAT_DAY_OF_MONTH) |
49 | -}} |
50 | </time> |
51 | </a> |
52 | </li> |
53 | {%- endfor -%} |
54 | </ul> |
55 | </section> |
56 | {%- endif -%} |
57 | {%- endblock -%} |
58 | {%- block maincontent -%} |
59 | <nav class="nearby"> |
60 | <ul> |
61 | {%- for article in articles | |
62 | selectattr("date", "greaterthan", dates[0].date) | |
63 | reverse -%} |
64 | {%- if loop.index == 1 -%} |
65 | {%- if period | length == 1 -%} |
66 | <li class="next"> |
67 | <a href="/{{- article.date | strftime('%Y') -}}" |
68 | rel="next"> |
69 | <span> → </span> |
70 | <time datetime="{{- article.date | |
71 | strftime('%Y') -}}"> |
72 | {{- article.date | |
73 | strftime(DATE_FORMAT_YEAR) -}} |
74 | </time> |
75 | </a> |
76 | </li> |
77 | {%- elif period | length == 2 -%} |
78 | <li class="next"> |
79 | <a href="/{{- article.date | strftime('%Y/%m') -}}" |
80 | rel="next"> |
81 | <span> → </span> |
82 | <time datetime="{{- article.date | |
83 | strftime('%Y-%m') -}}"> |
84 | {{- article.date | |
85 | strftime(DATE_FORMAT_MONTH) -}} |
86 | </time> |
87 | </a> |
88 | </li> |
89 | {%- else -%} |
90 | <li class="next"> |
91 | <a href="/{{- article.date | |
92 | strftime('%Y/%m/%d') -}}" |
93 | rel="next"> |
94 | <span> → </span> |
95 | <time datetime="{{- article.date | |
96 | strftime('%Y-%m-%d') -}}"> |
97 | {{- article.date | |
98 | strftime(DATE_FORMAT_DAY) -}} |
99 | </time> |
100 | </a> |
101 | </li> |
102 | {%- endif -%} |
103 | {%- endif -%} |
104 | {%- endfor -%} |
105 | {%- for article in articles | |
106 | selectattr("date", "lessthan", |
107 | dates[ dates | length - 1].date) -%} |
108 | {%- if loop.index == 1 -%} |
109 | {%- if period | length == 1 -%} |
110 | <li class="prev"> |
111 | <a href="/{{- article.date | strftime('%Y') -}}" |
112 | rel="prev"> |
113 | <span> ← </span> |
114 | <time datetime="{{- article.date | |
115 | strftime('%Y') -}}"> |
116 | {{- article.date | |
117 | strftime(DATE_FORMAT_YEAR) -}} |
118 | </time> |
119 | </a> |
120 | </li> |
121 | {%- elif period | length == 2 -%} |
122 | <li class="prev"> |
123 | <a href="/{{- article.date | strftime('%Y/%m') -}}" |
124 | rel="prev"> |
125 | <span> ← </span> |
126 | <time datetime="{{- article.date | |
127 | strftime('%Y-%m') -}}"> |
128 | {{- article.date | |
129 | strftime(DATE_FORMAT_MONTH) -}} |
130 | </time> |
131 | </a> |
132 | </li> |
133 | {%- else -%} |
134 | <li class="prev"> |
135 | <a href="/{{- article.date | |
136 | strftime('%Y/%m/%d') -}}" |
137 | rel="prev"> |
138 | <span> ← </span> |
139 | <time datetime="{{- article.date | |
140 | strftime('%Y-%m-%d') -}}"> |
141 | {{- article.date | |
142 | strftime(DATE_FORMAT_DAY) -}} |
143 | </time> |
144 | </a> |
145 | </li> |
146 | {%- endif -%} |
147 | {%- endif -%} |
148 | {%- endfor -%} |
149 | {%- if period | length == 1 -%} |
150 | <li class="up"> |
151 | <a href="/entries" rel="up"> |
152 | <span> ↑ </span> |
153 | {{- ARCHIVES_TITLE -}} |
154 | </a> |
155 | </li> |
156 | {%- elif period | length == 2 -%} |
157 | <li class="up"> |
158 | <a href="/{{- dates[0].date | strftime('%Y') -}}" rel="up"> |
159 | <span> ↑ </span> |
160 | <time datetime="{{- dates[0].date | strftime('%Y') -}}"> |
161 | {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}} |
162 | </time> |
163 | </a> |
164 | </li> |
165 | {%- else -%} |
166 | <li class="up"> |
167 | <a href="/{{- dates[0].date | strftime('%Y/%m') -}}" |
168 | rel="up"> |
169 | <span> ↑ </span> |
170 | <time datetime="{{- dates[0].date | |
171 | strftime('%Y-%m') -}}"> |
172 | {{- dates[0].date | strftime(DATE_FORMAT_MONTH) -}} |
173 | </time> |
174 | </a> |
175 | </li> |
176 | {%- endif -%} |
177 | </ul> |
178 | </nav> |
179 | <hr class="visuallyhidden"> |
180 | {{- super() -}} |
181 | {%- endblock -%} |
182 | |
183 |
Built with git-ssb-web