-
Notifications
You must be signed in to change notification settings - Fork 1
/
linklist.html
228 lines (208 loc) · 6.99 KB
/
linklist.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
<!DOCTYPE html>
<html{if="$language !== 'auto'"} lang="{$language}"{/if}>
<head>
{include="includes"}
</head>
<body class="text-light bg-dark">
{include="page.header"}
<div id="linklist" class="mb-5">
<div id="plugin_zone_start_linklist">
{loop="$plugin_start_zone"}
{$value}
{/loop}
</div>
{if="count($links)==0"}
<div class="alert alert-warning">
<p class="mb-0">
{'Nothing found.'|t}
</p>
</div>
{elseif="!empty($search_term) or $search_tags !== '' or !empty($visibility) or $untaggedonly"}
<div class="alert alert-dark">
<p class="mb-0">
{function="sprintf(t('%s result', '%s results', $result_count), $result_count)"}
{if="!empty($search_term)"}
{'for'|t} <em><strong>{$search_term}</strong></em>
{/if}
{if="!empty($search_tags)"}
{$exploded_tags=explode(' ', $search_tags)}
{'tagged'|t}:
{loop="$exploded_tags"}
<span class="badge badge-secondary">
{$value}
<a href="?removetag={$value|urlencode}"
title="{'Remove tag'|t}"
aria-label="{'Remove tag'|t}"
class="text-reset"
>
<span aria-hidden="true">×</span>
</a>
</span>
{/loop}
{/if}
{if="!empty($visibility)"}
{'with status'|t} {$visibility}.
<a href="?visibility={$visibility}"
class="btn btn-sm btn-outline-primary"
>{'Show all'|t}</a>
{/if}
{if="$untaggedonly"}
{'without any tag'|t}.
<a href="?untaggedonly"
class="btn btn-sm btn-outline-primary"
>{'Show all'|t}</a>
{/if}
</p>
</div>
{/if}
<ol id="linklist-loop" class="list-unstyled">
{ignore}Set translation here, for performance{/ignore}
{$strPrivate=t('Private')}
{$strSticky=t('Pinned')}
{$strPin=t('Pin')}
{$strUnpin=t('Unpin')}
{$strAddTag=t('Filter on tag')}
{$strEdit=t('Edit')}
{$strPermalink=t('Permalink')}
{ignore}End of translations{/ignore}
{loop="links"}
<li id="{$value.shorturl}"
class="mb-3 border-bottom"
>
{if="$value.private"}
<small class="badge badge-secondary badge-pill float-right">{$strPrivate}</small>
{/if}
<h2 class="h4 text-break">
{if="$value.sticky"}
<small class="badge badge-warning badge-pill"
title="{$strSticky}"
aria-label="{$strSticky}"
>!</small>
{/if}
<a href="{$value.real_url}" title="{$value.real_url}">{$value.title}</a>
</h2>
<p>
<a href="{$value.real_url}"
title="{$value.title}"
class="text-muted"
>
<code>{$value.url}</code>
</a>
</p>
{if="(strlen($value.description) > 42) && count($links) > 1"}
<details class="my-3">
<summary class="text-white-50">
{'Description'|t}
</summary>
<p class="text-break">
{$value.description}
</p>
</details>
{else}
<p class="text-break">
{$value.description}
</p>
{/if}
{if="$value.tags"}
<p>
{$tag_counter=count($value.taglist)}
{loop="value.taglist"}
<a href="?addtag={$value|urlencode}"
rel="tag"
title="{$strAddTag}"
aria-label="{$strAddTag}"
class="badge badge-secondary text-dark"
>{$value}</a>
{if="$tag_counter - 1 != $counter"}·{/if}
{/loop}
</p>
{/if}
<div class="mb-3 text-muted d-flex d-print-none">
{$last_modified_date=$value.updated_timestamp ? format_date($value.updated) : format_date($value.created)}
<a href="?{$value.shorturl}"
title="{$last_modified_date}"
aria-label="{$strPermalink} - {$last_modified_date}"
rel="permalink"
class="btn btn-link btn-sm"
>
¶
</a>
{if="$is_logged_in"}
<a href="?edit_link={$value.id}"
class="btn btn-link btn-sm text-lowercase text-white-50"
>
{$strEdit}
</a>
<a href="?do=pin&id={$value.id}&token={$token}"
title="{$value.sticky ? $strUnpin : $strPin }"
aria-label="{$value.sticky ? $strUnpin : $strPin }"
class="btn btn-link btn-sm {$value.sticky ? 'text-white' : 'text-white-50' }"
>!</a>
{/if}
<span class="ml-auto">
<a href="https://web.archive.org/web/*/{$value.real_url}"
class="btn btn-link btn-sm"
>
<svg viewBox="0 0 56 64" style="width:0.875rem;height:1rem">
<path fill="currentColor" d="M0 7l28-7 27 6-1 2H2zm2 3h52v5H2zm0 46h52v4H2zm-2 5h56v3H0v-3m3-44h5v37H3V17m45 0h5v37h-5V17m-31 0h5v37h-5V17m17 0h5v37h-5V17" />
</svg>
</a>
{if="isset($value.link_plugin)"}
{loop="$value.link_plugin"}
{$value}
{/loop}
{/if}
</span>
</div>
</li>
{/loop}
</ol>
<div id="plugin_zone_end_linklist">
{loop="$plugin_end_zone"}
{$value}
{/loop}
</div>
{if="count($links)>1"}
{include="linklist.paging"}
{/if}
</div>
{if="!empty($linkcount)"}
{if="$is_logged_in and count($links)>1"}
<div class="my-3 text-center">
{$onlyPublic=($visibility==='public') ? ' ' : ''}
{$onlyPrivate=($visibility==='private') ? ' ' : ''}
{$onlyUntagged=($untaggedonly) ? ' ' : ''}
<p class="btn-group my-0"
role="group"
aria-label="{'Filter by:'|t}"
>
<a href="?visibility=public"
title="{'Only display public links'|t}"
aria-label="{'Only display public links'|t}"
class="btn btn-outline-secondary {$onlyPublic ? 'active' : ''}"
>{'Public'|t}</a>
<a href="?visibility=private"
title="{'Only display private links'|t}"
aria-label="{'Only display private links'|t}"
class="btn btn-outline-secondary {$onlyPrivate ? 'active' : ''}"
>{'Private'|t}</a>
<a href="?untaggedonly"
title="{'Only display untagged links'|t}"
aria-label="{'Only display untagged links'|t}"
class="btn btn-outline-secondary {$onlyUntagged ? 'active' : ''}"
>{'Untagged'|t}</a>
</p>
</div>
{/if}
<p class="my-3 text-center">
<strong>{$linkcount}</strong> {function="t('url', 'urls', $linkcount)"}
{if="$privateLinkcount > 0"}
·
<strong>{$privateLinkcount}</strong> {function="t('private url', 'private urls', $privateLinkcount)"}
{/if}
</p>
{/if}
{include="page.footer"}
</body>
</html>