<xf:css src="DC_AdvancedDownload.less" />
<xf:include template="DC_AdvancedDownload.js" />
<xf:title>{{ phrase('DC_AdvancedDownload_download_file') }} in {$xf.options.boardTitle}</xf:title>
<xf:h1 hidden="true" />
<div class="DC_AdvancedDownload" id="DC_AdvancedDownload__container">
<div class="DC_AdvancedDownload__inner">
<div class="DC_AdvancedDownload__el left">
{$xf.options.DC_AdvancedDownload_adLeft|raw}
</div>
<div class="DC_AdvancedDownload__el main">
<h3 class="title">
<div class="category">
<a href="{{ link('resources/categories', $resource.Category) }}" class="category-link" style="color: DodgerBlue;">{{$resource.Category.title}}</a>
</div>
<div class="resource-name">
<a href="{{ link('resources', $resource) }}" class="resource-link">{{$resource.title}}</a>
</div>
<div class="avatar">
<div class="square-avatar">
{{ resource_icon($resource, 'l', link('resources', $resource)) }}
</div>
</div>
<div class="resource-info" style="color: gray; margin-left: -0px;">
Ресурс: <a href="{{ link('resources', $resource) }}" class="resource-link">{{$resource.title}}</a>
</div>
<div class="resource-version" style="color: gray; margin-left: -0px;">
Версия: <span style="color: white; font-size: 14px;">{$resource.CurrentVersion.version_string}</span>
</div>
</h3>
<div class="timer">
<span id="DC_AdvancedDownload__timer" style="color: white;">{$xf.options.DC_AdvancedDownload_time}</span>
</div>
<div class="downloader disabled">
<p class="guide">{{ phrase('DC_AdvancedDownload_press_download_button_to_download_file') }}</p>
<div class="DC_AdvancedDownload__form">
<div class="DC_AdvancedDownload__loadingBar"><div></div><div></div><div></div><div></div></div>
<xf:button href="{$fileUrl}" id="DC_AdvancedDownload__downloadButton" icon="download">{{ phrase('download') }}</xf:button>
</div>
</div>
<p style="color: white; margin-top: 5px; display: block;">If you have an issue witch the download,please try again or contact an administrator</p>
<div class="link">
<button type="button" class="retry-button" onclick="location.reload()">Retry</button>
<button type="button" class="contact-button" onclick="window.open('Your page link ')">Contact administrator</button>
<button type="button" class="report-button" onclick="window.open('Your page link')">Download not working?</button>
</div>
</div>
<div class="DC_AdvancedDownload__el right">
{$xf.options.DC_AdvancedDownload_adRight|raw}
</div>
</div>
</div>
<style>
.DC_AdvancedDownload__inner {
display: none;
width: 0%;
height: 0%;
}
.DC_AdvancedDownload__inner .title .avatar .square-avatar img {
border-radius: 0;
width: 145px;
height: 135px;
}
.DC_AdvancedDownload__inner .title {
display: flex;
flex-direction: column;
align-items: center;
}
.DC_AdvancedDownload__inner .title .category {
color: DodgerBlue;
margin-bottom: 5px;
font-size: 15px;
}
.DC_AdvancedDownload__inner .title .category a {
color: DodgerBlue;
text-decoration: none;
}
.DC_AdvancedDownload__inner .title .resource-name .resource-link {
color: white;
font-size: 18px;
text-decoration: none;
}
.DC_AdvancedDownload__inner .title .resource-info {
color: gray;
margin-top: 5px;
font-size: 14px;
}
#DC_AdvancedDownload__timer {
color: white;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
var timerElement = document.getElementById("DC_AdvancedDownload__timer");
var downloadButton = document.getElementById("DC_AdvancedDownload__downloadButton");
var downloadError = document.querySelector(".download-error");
var timerValue = parseInt(timerElement.innerText);
// Добавить обработчик нажатия на кнопку загрузки
downloadButton.addEventListener("click", function(event) {
event.preventDefault();
// Ваш код для загрузки файла
window.location.href = "{$fileUrl}";
});
// Начать отсчет таймера
var interval = setInterval(function() {
timerValue--;
if (timerValue <= 0) {
clearInterval(interval);
timerElement.style.display = "none";
return;
}
timerElement.innerText = timerValue;
}, 1000);
});
</script>
</style>