aboutsummaryrefslogtreecommitdiffhomepage
path: root/tpl
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2018-07-28 09:41:29 +0200
committerGitHub <noreply@github.com>2018-07-28 09:41:29 +0200
commitad5f47adbaee1eef85e90950ab8a45fe82959924 (patch)
treed23a186661db00d36cb2b2287a7bf890fbc62cfb /tpl
parent8fdd65b88412a0db28c723a486650c434fe5668c (diff)
parent7b4fea0e39be9e74e9aef13e73af9bbd2b1a6397 (diff)
downloadShaarli-ad5f47adbaee1eef85e90950ab8a45fe82959924.tar.gz
Shaarli-ad5f47adbaee1eef85e90950ab8a45fe82959924.tar.zst
Shaarli-ad5f47adbaee1eef85e90950ab8a45fe82959924.zip
Merge pull request #687 from ArthurHoaro/web-thumb
Use web-thumbnailer to retrieve thumbnails
Diffstat (limited to 'tpl')
-rw-r--r--tpl/default/configure.html31
-rw-r--r--tpl/default/linklist.html15
-rw-r--r--tpl/default/page.header.html22
-rw-r--r--tpl/default/picwall.html74
-rw-r--r--tpl/default/thumbnails.html48
-rw-r--r--tpl/default/tools.html8
-rw-r--r--tpl/vintage/configure.html23
-rw-r--r--tpl/vintage/linklist.html12
-rw-r--r--tpl/vintage/picwall.html8
-rw-r--r--tpl/vintage/thumbnails.html28
10 files changed, 233 insertions, 36 deletions
diff --git a/tpl/default/configure.html b/tpl/default/configure.html
index a63c7ad3..42e32230 100644
--- a/tpl/default/configure.html
+++ b/tpl/default/configure.html
@@ -242,6 +242,37 @@
242 </div> 242 </div>
243 </div> 243 </div>
244 </div> 244 </div>
245 <div class="pure-g">
246 <div class="pure-u-lg-{$ratioLabel} pure-u-{$ratioLabelMobile}">
247 <div class="form-label">
248 <label for="enableThumbnails">
249 <span class="label-name">{'Enable thumbnails'|t}</span><br>
250 <span class="label-desc">
251 {if="! $gd_enabled"}
252 {'You need to enable the extension <code>php-gd</code> to use thumbnails.'|t}
253 {elseif="$thumbnails_enabled"}
254 <a href="?do=thumbs_update">{'Synchronize thumbnails'|t}</a>
255 {/if}
256 </span>
257 </label>
258 </div>
259 </div>
260 <div class="pure-u-lg-{$ratioInput} pure-u-{$ratioInputMobile}">
261 <div class="form-input">
262 <select name="enableThumbnails" id="enableThumbnails" class="align">
263 <option value="all" {if="$thumbnails_mode=='all'"}selected{/if}>
264 {'All'|t}
265 </option>
266 <option value="common" {if="$thumbnails_mode=='common'"}selected{/if}>
267 {'Only common media hosts'|t}
268 </option>
269 <option value="none" {if="$thumbnails_mode=='none'"}selected{/if}>
270 {'None'|t}
271 </option>
272 </select>
273 </div>
274 </div>
275 </div>
245 <div class="center"> 276 <div class="center">
246 <input type="submit" value="{'Save'|t}" name="save"> 277 <input type="submit" value="{'Save'|t}" name="save">
247 </div> 278 </div>
diff --git a/tpl/default/linklist.html b/tpl/default/linklist.html
index 322cddd5..8ea2ce66 100644
--- a/tpl/default/linklist.html
+++ b/tpl/default/linklist.html
@@ -131,9 +131,17 @@
131 131
132 <div class="linklist-item linklist-item{if="$value.class"} {$value.class}{/if}" data-id="{$value.id}"> 132 <div class="linklist-item linklist-item{if="$value.class"} {$value.class}{/if}" data-id="{$value.id}">
133 <div class="linklist-item-title"> 133 <div class="linklist-item-title">
134 {$thumb=thumbnail($value.url)} 134 {if="$thumbnails_enabled && !empty($value.thumbnail)"}
135 {if="$thumb!=false"} 135 <div class="linklist-item-thumbnail" style="width:{$thumbnails_width}px;height:{$thumbnails_height}px;">
136 <div class="linklist-item-thumbnail">{$thumb}</div> 136 <div class="thumbnail">
137 <a href="{$value.real_url}">
138 {ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
139 <img data-src="{$value.thumbnail}#" class="b-lazy"
140 src="#"
141 alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
142 </a>
143 </div>
144 </div>
137 {/if} 145 {/if}
138 146
139 {if="$is_logged_in"} 147 {if="$is_logged_in"}
@@ -268,5 +276,6 @@
268</div> 276</div>
269 277
270{include="page.footer"} 278{include="page.footer"}
279<script src="js/thumbnails.min.js?v={$version_hash}"></script>
271</body> 280</body>
272</html> 281</html>
diff --git a/tpl/default/page.header.html b/tpl/default/page.header.html
index 82568d63..fc03404e 100644
--- a/tpl/default/page.header.html
+++ b/tpl/default/page.header.html
@@ -30,9 +30,11 @@
30 <li class="pure-menu-item" id="shaarli-menu-tags"> 30 <li class="pure-menu-item" id="shaarli-menu-tags">
31 <a href="?do=tagcloud" class="pure-menu-link">{'Tag cloud'|t}</a> 31 <a href="?do=tagcloud" class="pure-menu-link">{'Tag cloud'|t}</a>
32 </li> 32 </li>
33 <li class="pure-menu-item" id="shaarli-menu-picwall"> 33 {if="$thumbnails_enabled"}
34 <a href="?do=picwall{$searchcrits}" class="pure-menu-link">{'Picture wall'|t}</a> 34 <li class="pure-menu-item" id="shaarli-menu-picwall">
35 </li> 35 <a href="?do=picwall{$searchcrits}" class="pure-menu-link">{'Picture wall'|t}</a>
36 </li>
37 {/if}
36 <li class="pure-menu-item" id="shaarli-menu-daily"> 38 <li class="pure-menu-item" id="shaarli-menu-daily">
37 <a href="?do=daily" class="pure-menu-link">{'Daily'|t}</a> 39 <a href="?do=daily" class="pure-menu-link">{'Daily'|t}</a>
38 </li> 40 </li>
@@ -169,4 +171,18 @@
169 </div> 171 </div>
170{/if} 172{/if}
171 173
174{if="!empty($global_warnings) && $is_logged_in"}
175 <div class="pure-g pure-alert pure-alert-warning pure-alert-closable" id="shaarli-warnings-alert">
176 <div class="pure-u-2-24"></div>
177 <div class="pure-u-20-24">
178 {loop="global_warnings"}
179 <p>{$value}</p>
180 {/loop}
181 </div>
182 <div class="pure-u-2-24">
183 <i class="fa fa-times pure-alert-close"></i>
184 </div>
185 </div>
186{/if}
187
172 <div class="clear"></div> 188 <div class="clear"></div>
diff --git a/tpl/default/picwall.html b/tpl/default/picwall.html
index 2f7e03dc..9a0b10dc 100644
--- a/tpl/default/picwall.html
+++ b/tpl/default/picwall.html
@@ -5,41 +5,61 @@
5</head> 5</head>
6<body> 6<body>
7{include="page.header"} 7{include="page.header"}
8{if="!$thumbnails_enabled"}
9<div class="pure-g pure-alert pure-alert-warning page-single-alert">
10 <div class="pure-u-1 center">
11 {'Picture wall unavailable (thumbnails are disabled).'|t}
12 </div>
13</div>
14{else}
15 {if="count($linksToDisplay)===0 && $is_logged_in"}
16 <div class="pure-g pure-alert pure-alert-warning page-single-alert">
17 <div class="pure-u-1 center">
18 {'There is no cached thumbnail. Try to <a href="?do=thumbs_update">synchronize them</a>.'|t}
19 </div>
20 </div>
21 {/if}
8 22
9<div class="pure-g"> 23 <div class="pure-g">
10 <div class="pure-u-lg-1-6 pure-u-1-24"></div> 24 <div class="pure-u-lg-1-6 pure-u-1-24"></div>
11 <div class="pure-u-lg-2-3 pure-u-22-24 page-form page-visitor"> 25 <div class="pure-u-lg-2-3 pure-u-22-24 page-form page-visitor">
12 {$countPics=count($linksToDisplay)} 26 {$countPics=count($linksToDisplay)}
13 <h2 class="window-title">{'Picture Wall'|t} - {$countPics} {'pics'|t}</h2> 27 <h2 class="window-title">{'Picture Wall'|t} - {$countPics} {'pics'|t}</h2>
14 28
15 <div id="plugin_zone_start_picwall" class="plugin_zone"> 29 <div id="plugin_zone_start_picwall" class="plugin_zone">
16 {loop="$plugin_start_zone"} 30 {loop="$plugin_start_zone"}
17 {$value} 31 {$value}
18 {/loop} 32 {/loop}
19 </div> 33 </div>
20 34
21 <div id="picwall_container" class="picwall-container"> 35 <div id="picwall-container" class="picwall-container">
22 {loop="$linksToDisplay"} 36 {loop="$linksToDisplay"}
23 <div class="picwall-pictureframe"> 37 <div class="picwall-pictureframe">
24 {$value.thumbnail}<a href="{$value.real_url}"><span class="info">{$value.title}</span></a> 38 {ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
25 {loop="$value.picwall_plugin"} 39 <img data-src="{$value.thumbnail}#" class="b-lazy"
26 {$value} 40 src="#"
27 {/loop} 41 alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
28 </div> 42 <a href="{$value.real_url}"><span class="info">{$value.title}</span></a>
29 {/loop} 43 {loop="$value.picwall_plugin"}
30 <div class="clear"></div> 44 {$value}
31 </div> 45 {/loop}
46 </div>
47 {/loop}
48 <div class="clear"></div>
49 </div>
32 50
33 <div id="plugin_zone_end_picwall" class="plugin_zone"> 51 <div id="plugin_zone_end_picwall" class="plugin_zone">
34 {loop="$plugin_end_zone"} 52 {loop="$plugin_end_zone"}
35 {$value} 53 {$value}
36 {/loop} 54 {/loop}
55 </div>
37 </div> 56 </div>
57 <div class="pure-u-lg-1-6 pure-u-1-24"></div>
38 </div> 58 </div>
39</div> 59{/if}
40 60
41{include="page.footer"} 61{include="page.footer"}
42<script src="js/picwall.min.js?v={$version_hash}"></script> 62<script src="js/thumbnails.min.js?v={$version_hash}"></script>
43</body> 63</body>
44</html> 64</html>
45 65
diff --git a/tpl/default/thumbnails.html b/tpl/default/thumbnails.html
new file mode 100644
index 00000000..a8cf904e
--- /dev/null
+++ b/tpl/default/thumbnails.html
@@ -0,0 +1,48 @@
1<!DOCTYPE html>
2<html>
3<head>
4 {include="includes"}
5</head>
6<body>
7{include="page.header"}
8
9<div class="pure-g thumbnails-page-container">
10 <div class="pure-u-lg-1-3 pure-u-1-24"></div>
11 <div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light">
12 <h2 class="window-title">{'Thumbnails update'|t}</h2>
13
14 <div class="pure-g">
15 <div class="pure-u-lg-1-3 pure-u-1-24"></div>
16 <div class="pure-u-lg-1-3 pure-u-22-24">
17 <div class="thumbnail-placeholder" style="width: {$thumbnails_width}px; height: {$thumbnails_height}px;"></div>
18 </div>
19 </div>
20
21 <div class="pure-g">
22 <div class="pure-u-1-12"></div>
23 <div class="pure-u-5-6">
24 <div class="thumbnail-link-title"></div>
25
26 <div class="progressbar">
27 <div></div>
28 </div>
29 </div>
30 </div>
31
32 <div class="pure-g">
33 <div class="pure-u-lg-1-3 pure-u-1-24"></div>
34 <div class="pure-u-lg-1-3 pure-u-22-24">
35 <div class="progress-counter">
36 <span class="progress-current">0</span> / <span class="progress-total">{$ids|count}</span>
37 </div>
38 </div>
39 </div>
40
41 <input type="hidden" name="ids" value="{function="implode($ids, ',')"}" />
42 </div>
43</div>
44
45{include="page.footer"}
46<script src="js/thumbnails_update.min.js?v={$version_hash}"></script>
47</body>
48</html>
diff --git a/tpl/default/tools.html b/tpl/default/tools.html
index ece66884..20060994 100644
--- a/tpl/default/tools.html
+++ b/tpl/default/tools.html
@@ -45,6 +45,14 @@
45 </a> 45 </a>
46 </div> 46 </div>
47 47
48 {if="$thumbnails_enabled"}
49 <div class="tools-item">
50 <a href="?do=thumbs_update" title="{'Synchronize all link thumbnails'|t}">
51 <span class="pure-button pure-u-lg-2-3 pure-u-3-4">{'Synchronize thumbnails'|t}</span>
52 </a>
53 </div>
54 {/if}
55
48 {loop="$tools_plugin"} 56 {loop="$tools_plugin"}
49 <div class="tools-item"> 57 <div class="tools-item">
50 {$value} 58 {$value}
diff --git a/tpl/vintage/configure.html b/tpl/vintage/configure.html
index 479284eb..9466c235 100644
--- a/tpl/vintage/configure.html
+++ b/tpl/vintage/configure.html
@@ -128,6 +128,29 @@
128 <input type="text" name="apiSecret" id="apiSecret" size="50" value="{$api_secret}" /> 128 <input type="text" name="apiSecret" id="apiSecret" size="50" value="{$api_secret}" />
129 </td> 129 </td>
130 </tr> 130 </tr>
131 <tr>
132 <td valign="top"><b>Enable thumbnails</b></td>
133 <td>
134 <select name="enableThumbnails" id="enableThumbnails" class="align">
135 <option value="all" {if="$thumbnails_mode=='all'"}selected{/if}>
136 {'All'|t}
137 </option>
138 <option value="common" {if="$thumbnails_mode=='common'"}selected{/if}>
139 {'Only common media hosts'|t}
140 </option>
141 <option value="none" {if="$thumbnails_mode=='none'"}selected{/if}>
142 {'None'|t}
143 </option>
144 </select>
145 <label for="enableThumbnails">
146 {if="! $gd_enabled"}
147 {'You need to enable the extension <code>php-gd</code> to use thumbnails.'|t}
148 {elseif="$thumbnails_enabled"}
149 <a href="?do=thumbs_update">{'Synchonize thumbnails'|t}</a>
150 {/if}
151 </label>
152 </td>
153 </tr>
131 154
132 <tr> 155 <tr>
133 <td></td> 156 <td></td>
diff --git a/tpl/vintage/linklist.html b/tpl/vintage/linklist.html
index 1ca51be3..3f202849 100644
--- a/tpl/vintage/linklist.html
+++ b/tpl/vintage/linklist.html
@@ -80,7 +80,16 @@
80 {loop="$links"} 80 {loop="$links"}
81 <li{if="$value.class"} class="{$value.class}"{/if}> 81 <li{if="$value.class"} class="{$value.class}"{/if}>
82 <a id="{$value.shorturl}"></a> 82 <a id="{$value.shorturl}"></a>
83 <div class="thumbnail">{$value.url|thumbnail}</div> 83 {if="$thumbnails_enabled && !empty($value.thumbnail)"}
84 <div class="thumbnail">
85 <a href="{$value.real_url}">
86 {ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
87 <img data-src="{$value.thumbnail}#" class="b-lazy"
88 src="#"
89 alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
90 </a>
91 </div>
92 {/if}
84 <div class="linkcontainer"> 93 <div class="linkcontainer">
85 {if="$is_logged_in"} 94 {if="$is_logged_in"}
86 <div class="linkeditbuttons"> 95 <div class="linkeditbuttons">
@@ -145,6 +154,7 @@
145</div> 154</div>
146 155
147 {include="page.footer"} 156 {include="page.footer"}
157<script src="js/thumbnails.min.js"></script>
148 158
149</body> 159</body>
150</html> 160</html>
diff --git a/tpl/vintage/picwall.html b/tpl/vintage/picwall.html
index 29688914..5f1d266e 100644
--- a/tpl/vintage/picwall.html
+++ b/tpl/vintage/picwall.html
@@ -15,7 +15,11 @@
15 <div id="picwall_container"> 15 <div id="picwall_container">
16 {loop="$linksToDisplay"} 16 {loop="$linksToDisplay"}
17 <div class="picwall_pictureframe"> 17 <div class="picwall_pictureframe">
18 {$value.thumbnail}<a href="{$value.real_url}"><span class="info">{$value.title}</span></a> 18 {ignore}RainTPL hack: put the 2 src on two different line to avoid path replace bug{/ignore}
19 <img data-src="{$value.thumbnail}#" class="b-lazy"
20 src="#"
21 alt="thumbnail" width="{$thumbnails_width}" height="{$thumbnails_height}" />
22 <a href="{$value.real_url}"><span class="info">{$value.title}</span></a>
19 {loop="$value.picwall_plugin"} 23 {loop="$value.picwall_plugin"}
20 {$value} 24 {$value}
21 {/loop} 25 {/loop}
@@ -34,6 +38,6 @@
34 38
35{include="page.footer"} 39{include="page.footer"}
36 40
37<script src="js/picwall.min.js"></script> 41<script src="js/thumbnails.min.js"></script>
38</body> 42</body>
39</html> 43</html>
diff --git a/tpl/vintage/thumbnails.html b/tpl/vintage/thumbnails.html
new file mode 100644
index 00000000..79aebf8d
--- /dev/null
+++ b/tpl/vintage/thumbnails.html
@@ -0,0 +1,28 @@
1<!DOCTYPE html>
2<html>
3<head>{include="includes"}</head>
4<body>
5<div id="pageheader">
6{include="page.header"}
7</div>
8
9<div class="center thumbnails-update-container">
10 <div class="thumbnail-placeholder" style="width: {$thumbnails_width}px; height: {$thumbnails_height}px;"></div>
11
12 <div class="thumbnail-link-title"></div>
13
14 <div class="progressbar">
15 <div></div>
16 </div>
17
18 <div class="progress-counter">
19 <span class="progress-current">0</span> / <span class="progress-total">{$ids|count}</span>
20 </div>
21</div>
22
23<input type="hidden" name="ids" value="{function="implode($ids, ',')"}" />
24
25{include="page.footer"}
26<script src="js/thumbnails_update.min.js?v={$version_hash}"></script>
27</body>
28</html>