Add a page to update all thumbnails through AJAX requests in both templates
This commit is contained in:
parent
787faa42f3
commit
28f2652460
17 changed files with 487 additions and 105 deletions
|
@ -248,12 +248,10 @@
|
|||
<label for="enableThumbnails">
|
||||
<span class="label-name">{'Enable thumbnails'|t}</span><br>
|
||||
<span class="label-desc">
|
||||
{'Warning: '|t}
|
||||
{if="$gd_enabled"}
|
||||
{'It\'s recommended to visit the picture wall after enabling this feature.'|t}
|
||||
{'If you have a large database, the first retrieval may take a few minutes.'|t}
|
||||
{else}
|
||||
{if="! $gd_enabled"}
|
||||
{'You need to enable the extension <code>php-gd</code> to use thumbnails.'|t}
|
||||
{elseif="$thumbnails_enabled"}
|
||||
<a href="?do=thumbs_update">{'Synchonize thumbnails'|t}</a>
|
||||
{/if}
|
||||
</span>
|
||||
</label>
|
||||
|
|
|
@ -171,4 +171,18 @@
|
|||
</div>
|
||||
{/if}
|
||||
|
||||
{if="!empty($global_warnings) && $is_logged_in"}
|
||||
<div class="pure-g pure-alert pure-alert-warning pure-alert-closable" id="shaarli-warnings-alert">
|
||||
<div class="pure-u-2-24"></div>
|
||||
<div class="pure-u-20-24">
|
||||
{loop="global_warnings"}
|
||||
<p>{$value}</p>
|
||||
{/loop}
|
||||
</div>
|
||||
<div class="pure-u-2-24">
|
||||
<i class="fa fa-times pure-alert-close"></i>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="clear"></div>
|
||||
|
|
48
tpl/default/thumbnails.html
Normal file
48
tpl/default/thumbnails.html
Normal file
|
@ -0,0 +1,48 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
{include="includes"}
|
||||
</head>
|
||||
<body>
|
||||
{include="page.header"}
|
||||
|
||||
<div class="pure-g thumbnails-page-container">
|
||||
<div class="pure-u-lg-1-3 pure-u-1-24"></div>
|
||||
<div class="pure-u-lg-1-3 pure-u-22-24 page-form page-form-light">
|
||||
<h2 class="window-title">{'Thumbnails update'|t}</h2>
|
||||
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-lg-1-3 pure-u-1-24"></div>
|
||||
<div class="pure-u-lg-1-3 pure-u-22-24">
|
||||
<div class="thumbnail-placeholder" style="width: {$thumbnails_width}px; height: {$thumbnails_height}px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-1-12"></div>
|
||||
<div class="pure-u-5-6">
|
||||
<div class="thumbnail-link-title"></div>
|
||||
|
||||
<div class="progressbar">
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pure-g">
|
||||
<div class="pure-u-lg-1-3 pure-u-1-24"></div>
|
||||
<div class="pure-u-lg-1-3 pure-u-22-24">
|
||||
<div class="progress-counter">
|
||||
<span class="progress-current">0</span> / <span class="progress-total">{$ids|count}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="ids" value="{function="implode($ids, ',')"}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include="page.footer"}
|
||||
<script src="js/thumbnails_update.min.js?v={$version_hash}"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -132,11 +132,13 @@
|
|||
<td valign="top"><b>Enable thumbnails</b></td>
|
||||
<td>
|
||||
<input type="checkbox" name="enableThumbnails" id="enableThumbnails"
|
||||
{if="$thumbnails_enabled"}checked{/if}/>
|
||||
{if="$thumbnails_enabled"}checked{/if} {if="!$gd_enabled"}disabled{/if}>
|
||||
<label for="enableThumbnails">
|
||||
<strong>Warning:</strong>
|
||||
If you have a large database, the first retrieval may take a few minutes.
|
||||
It's recommended to visit the picture wall after enabling this feature
|
||||
{if="! $gd_enabled"}
|
||||
{'You need to enable the extension <code>php-gd</code> to use thumbnails.'|t}
|
||||
{elseif="$thumbnails_enabled"}
|
||||
<a href="?do=thumbs_update">{'Synchonize thumbnails'|t}</a>
|
||||
{/if}
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
28
tpl/vintage/thumbnails.html
Normal file
28
tpl/vintage/thumbnails.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>{include="includes"}</head>
|
||||
<body>
|
||||
<div id="pageheader">
|
||||
{include="page.header"}
|
||||
</div>
|
||||
|
||||
<div class="center thumbnails-update-container">
|
||||
<div class="thumbnail-placeholder" style="width: {$thumbnails_width}px; height: {$thumbnails_height}px;"></div>
|
||||
|
||||
<div class="thumbnail-link-title"></div>
|
||||
|
||||
<div class="progressbar">
|
||||
<div></div>
|
||||
</div>
|
||||
|
||||
<div class="progress-counter">
|
||||
<span class="progress-current">0</span> / <span class="progress-total">{$ids|count}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="ids" value="{function="implode($ids, ',')"}" />
|
||||
|
||||
{include="page.footer"}
|
||||
<script src="js/thumbnails_update.min.js?v={$version_hash}"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue