diff options
author | plegall <plg@piwigo.org> | 2015-12-30 16:08:54 +0100 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2015-12-30 16:08:54 +0100 |
commit | 6ba0148e646b2a193dc4111bb0a443d8c193e646 (patch) | |
tree | 382ecd35afae3522d07377df332f0ecfee1f5045 /themes/default/template/picture.tpl | |
parent | f28420acfeb5d69e9ea39cd8d00cf9775d6cea54 (diff) | |
parent | 7b653c04d6cfb20366c3bb0e183a521b3c9d22d2 (diff) |
Merge branch 'feature/379-multiple-format'
Diffstat (limited to 'themes/default/template/picture.tpl')
-rw-r--r-- | themes/default/template/picture.tpl | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl index 733cefcf8..bfc0c2498 100644 --- a/themes/default/template/picture.tpl +++ b/themes/default/template/picture.tpl @@ -65,9 +65,28 @@ function changeImgSrc(url,typeSave,typeMap) </a> {/if}{/strip} {strip}{if isset($current.U_DOWNLOAD)} - <a href="{$current.U_DOWNLOAD}" title="{'Download this file'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> + <a id="downloadSwitchLink" href="{$current.U_DOWNLOAD}" title="{'Download this file'|@translate}" class="pwg-state-default pwg-button" rel="nofollow"> <span class="pwg-icon pwg-icon-save"></span><span class="pwg-button-text">{'Download'|@translate}</span> </a> + +{if !empty($current.formats)} +{footer_script require='jquery'}{literal} +jQuery().ready(function() { + jQuery("#downloadSwitchLink").removeAttr("href"); + + (window.SwitchBox=window.SwitchBox||[]).push("#downloadSwitchLink", "#downloadSwitchBox"); +}); +{/literal}{/footer_script} + +<div id="downloadSwitchBox" class="switchBox"> + <div class="switchBoxTitle">{'Download'|translate} - {'Formats'|translate}</div> + <ul> + {foreach from=$current.formats item=format} + <li><a href="{$format.download_url}" rel="nofollow">{$format.label}<span class="downloadformatDetails"> ({$format.filesize})</span></a></li> + {/foreach} + </ul> +</div> +{/if} {* has formats *} {/if}{/strip} {if isset($PLUGIN_PICTURE_BUTTONS)}{foreach from=$PLUGIN_PICTURE_BUTTONS item=button}{$button}{/foreach}{/if} {if isset($PLUGIN_PICTURE_ACTIONS)}{$PLUGIN_PICTURE_ACTIONS}{/if} |