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