Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #45, use specific template for Batch Downloader #46

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions template/download_button.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{* download button for Batch Downloader plugin *}

{if isset($BATCH_DWN_SIZES)}
<a href="{$BATCH_DWN_URL}{$BATCH_DWN_SIZE}" id="batchDownloadLink" title="{'Download all pictures of this selection'|translate}" class="dropdown-toggle" data-toggle="dropdown">
<span class="glyphicon glyphicon-download-alt"></span><span class="glyphicon-text">{'Download all pictures of this selection'|@translate}</span><span class="caret"></span>
</a>

<ul id="batchDownloadBox" class="dropdown-menu" role="menu">
<li class="switchBoxTitle">{'Download'|translate} - {'Photo sizes'|translate}</li>
{foreach from=$BATCH_DWN_SIZES item=size name=loop}
<li>
<a href="{$BATCH_DWN_URL}{$size.TYPE}" rel="nofollow">
{$size.DISPLAY} {if $size.SIZE}<span class="downloadSizeDetails">({$size.SIZE})</span>{/if}
</a>
</li>
{/foreach}
</ul>
{else}
<a href="{$BATCH_DWN_URL}{$BATCH_DWN_SIZE}" id="batchDownloadLink" title="{'Download all pictures of this selection'|translate}">
<span class="glyphicon glyphicon-download-alt"></span><span class="glyphicon-text">{'Download all pictures of this selection'|@translate}</span>
</a>
{/if}

{footer_script require='jquery'}
var batchdown_count = {$BATCH_DWN_COUNT};
var batchdown_string = "{'Confirm the download of %d pictures?'|translate}";

{if isset($BATCH_DWN_SIZES)}
jQuery("#batchDownloadLink").closest("li").addClass("dropdown");

jQuery("#batchDownloadBox a").click(function() {
return confirm(batchdown_string.replace('%d', batchdown_count));
});
{else}
jQuery("#batchDownloadLink").click(function() {
return confirm(batchdown_string.replace('%d', batchdown_count));
});
{/if}
{/footer_script}
13 changes: 12 additions & 1 deletion theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -469,4 +469,15 @@ fieldset[disabled] .html-radios-inline label {
.user-collections-icon {
width:16px;
height:16px;
}
}

/* BatchDownloader */
.downloadSizeDetails {
font-style:italic;
font-size:80%;
}
#batchDownloadBox .switchBoxTitle {
text-align:center;
border-bottom:1px solid #eee;
padding-bottom:5px;
}