Files: 263dcac6d85effcc6f97824bc6bc03a86122b31f / themes / ran / templates / period_archives.html
4591 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 | {%- if period | length == 1 -%} |
63 | <a href="/entries" rel="up"> |
64 | <span> ↑ </span> |
65 | {{- ARCHIVES_TITLE -}} |
66 | </a> |
67 | {%- elif period | length == 2 -%} |
68 | <a href="/{{- dates[0].date | strftime('%Y') -}}" rel="up"> |
69 | <span> ↑ </span> |
70 | <time datetime="{{- dates[0].date | strftime('%Y') -}}"> |
71 | {{- dates[0].date | strftime(DATE_FORMAT_YEAR) -}} |
72 | </time> |
73 | </a> |
74 | {%- else -%} |
75 | <a href="/{{- dates[0].date | strftime('%Y/%m') -}}" rel="up"> |
76 | <span> ↑ </span> |
77 | <time datetime="{{- dates[0].date | strftime('%Y-%m') -}}"> |
78 | {{- dates[0].date | strftime(DATE_FORMAT_MONTH) -}} |
79 | </time> |
80 | </a> |
81 | {%- endif -%} |
82 | {%- for article in articles | |
83 | selectattr("date", "greaterthan", dates[0].date) | |
84 | reverse -%} |
85 | {%- if loop.index == 1 -%} |
86 | {%- if period | length == 1 -%} |
87 | <a href="/{{- article.date | strftime('%Y') -}}" rel="next"> |
88 | <span> → </span> |
89 | <time datetime="{{- article.date | strftime('%Y') -}}"> |
90 | {{- article.date | strftime(DATE_FORMAT_YEAR) -}} |
91 | </time> |
92 | </a> |
93 | {%- elif period | length == 2 -%} |
94 | <a href="/{{- article.date | strftime('%Y/%m') -}}" |
95 | rel="next"> |
96 | <span> → </span> |
97 | <time datetime="{{- article.date | |
98 | strftime('%Y-%m') -}}"> |
99 | {{- article.date | strftime(DATE_FORMAT_MONTH) -}} |
100 | </time> |
101 | </a> |
102 | {%- else -%} |
103 | <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" |
104 | rel="next"> |
105 | <span> → </span> |
106 | <time datetime="{{- article.date | |
107 | strftime('%Y-%m-%d') -}}"> |
108 | {{- article.date | strftime(DATE_FORMAT_DAY) -}} |
109 | </time> |
110 | </a> |
111 | {%- endif -%} |
112 | {%- endif -%} |
113 | {%- endfor -%} |
114 | {%- for article in articles | |
115 | selectattr("date", "lessthan", dates[ dates | length - 1].date) -%} |
116 | {%- if loop.index == 1 -%} |
117 | {%- if period | length == 1 -%} |
118 | <a href="/{{- article.date | strftime('%Y') -}}" rel="prev"> |
119 | <span> ← </span> |
120 | <time datetime="{{- article.date | strftime('%Y') -}}"> |
121 | {{- article.date | strftime(DATE_FORMAT_YEAR) -}} |
122 | </time> |
123 | </a> |
124 | {%- elif period | length == 2 -%} |
125 | <a href="/{{- article.date | strftime('%Y/%m') -}}" |
126 | rel="prev"> |
127 | <span> ← </span> |
128 | <time datetime="{{- article.date | |
129 | strftime('%Y-%m') -}}"> |
130 | {{- article.date | strftime(DATE_FORMAT_MONTH) -}} |
131 | </time> |
132 | </a> |
133 | {%- else -%} |
134 | <a href="/{{- article.date | strftime('%Y/%m/%d') -}}" |
135 | rel="prev"> |
136 | <span> ← </span> |
137 | <time datetime="{{- article.date | |
138 | strftime('%Y-%m-%d') -}}"> |
139 | {{- article.date | strftime(DATE_FORMAT_DAY) -}} |
140 | </time> |
141 | </a> |
142 | {%- endif -%} |
143 | {%- endif -%} |
144 | {%- endfor -%} |
145 | </nav> |
146 | {{- super() -}} |
147 | {%- endblock -%} |
148 | |
149 |
Built with git-ssb-web