TelegramIndex-Fork/app/templates/info.html

133 lines
7.4 KiB
HTML
Raw Normal View History

2020-08-10 09:27:52 +02:00
{% include 'header.html' %}
2020-12-12 15:16:44 +01:00
2020-08-10 09:27:52 +02:00
<div class="p-4 space-y-8">
{% if found %}
{% if media %}
2020-09-01 09:29:32 +02:00
<h1 class="text-blue-500 text-center text-lg lg:text-xl xl:text-3xl w-full break-all">
2020-08-10 09:27:52 +02:00
Download {{name}}
</h1>
2020-12-12 15:16:44 +01:00
<div class="mx-auto w-full p-2 md:flex ">
<div>
</div>
2020-08-10 09:27:52 +02:00
{% if media.image %}
2020-09-07 17:11:51 +02:00
<img class="mx-auto rounded" src="../{{file_id}}/thumbnail" alt="{{name}}">
2020-08-10 09:27:52 +02:00
{% elif media.video %}
2020-08-16 13:02:56 +02:00
<div id="video-warning" class="mx-auto p-4 bg-gray-600 text-gray-300 rounded border text-center hidden break-words">
<p> Video {{name}} could not be played!</p>
</div>
2020-12-12 15:16:44 +01:00
<div id="my-video-wrapper">
2020-09-07 17:11:51 +02:00
<video id="my-video-player" class="mx-auto rounded" controls poster="../{{file_id}}/thumbnail">
<source src="../{{file_id}}/download" type="video/mp4" />
2020-09-01 09:29:32 +02:00
</video>
</div>
2020-12-12 15:16:44 +01:00
2020-08-16 13:02:56 +02:00
<script>
var video = document.querySelector("video");
var src = video.firstElementChild
src.addEventListener('error', function(evt) {
console.log(evt);
2020-09-01 09:29:32 +02:00
document.getElementById('my-video-wrapper').style.display = 'none';
2020-08-16 13:02:56 +02:00
document.getElementById('video-warning').style.display = 'block';
2020-12-12 15:16:44 +01:00
});
2020-08-16 13:02:56 +02:00
var myFP = fluidPlayer(
'my-video-player',{
"layoutControls": {
"autoPlay": false,
"mute": true,
"allowTheatre": true,
"playPauseAnimation": true,
"playbackRateEnabled": true,
"allowDownload": false,
"playButtonShowing": true,
"fillToContainer": true,
"posterImage": ""
}
}
);
</script>
2020-08-10 09:27:52 +02:00
{% elif media.audio %}
2020-08-16 13:02:56 +02:00
<div id="audio-warning" class="mx-auto p-4 bg-gray-600 text-gray-300 rounded border text-center hidden break-words">
<p> Audio {{name}} could not be played!</p>
</div>
2020-12-12 15:16:44 +01:00
2020-09-01 09:29:32 +02:00
<div id="my-audio-wrapper">
2020-09-07 17:11:51 +02:00
<img class="mx-auto rounded w-full" src="../{{file_id}}/thumbnail" alt="{{name}}">
2020-09-01 09:29:32 +02:00
<audio class="mx-auto" controls muted>
2020-09-07 17:11:51 +02:00
<source src="../{{file_id}}/download" type="audio/mpeg" />
2020-09-01 09:29:32 +02:00
</audio>
</div>
2020-08-16 13:02:56 +02:00
<script>
var audio = document.querySelector("audio");
var src = audio.firstElementChild
src.addEventListener('error', function(evt) {
console.log(evt);
2020-09-01 09:29:32 +02:00
document.getElementById('my-audio-wrapper').style.display = 'none';
2020-08-16 13:02:56 +02:00
document.getElementById('audio-warning').style.display = 'block';
});
</script>
2020-08-10 09:27:52 +02:00
{% endif %}
2020-12-12 15:16:44 +01:00
{% if caption_html %}
2020-12-12 15:16:44 +01:00
2020-08-16 08:43:30 +02:00
<div class="mx-auto mt-1">
2020-09-03 15:12:23 +02:00
<div class="flex justify-center text-gray-300 font-mono">
<p class="text-left w-full rounded p-4 bg-gray-900 shadow-lg"> {{ caption_html|safe }} </p>
2020-08-15 09:13:46 +02:00
</div>
{% if reply_btns %}
<div class="w-full block">
{% for row in reply_btns %}
<div class="flex justify-center">
{% for btn in row %}
2020-08-16 08:43:30 +02:00
<a class="p-2 m-1 flex-1 border rounded bg-white border-blue-500 text-center text-blue-500 hover:bg-blue-500 hover:text-white transition ease-in duration-150" href="{{ btn.url }}" target="_blank"> {{btn.text}} </a>
2020-08-15 09:13:46 +02:00
{% endfor %}
</div>
{% endfor %}
</div>
{% endif %}
2020-08-10 09:27:52 +02:00
</div>
2020-12-12 15:16:44 +01:00
2020-08-10 09:27:52 +02:00
{% endif %}
2020-12-12 15:16:44 +01:00
2020-08-10 09:27:52 +02:00
</div>
2020-12-12 15:16:44 +01:00
2020-09-03 15:12:23 +02:00
<div class="text-center text-white">
2020-12-12 15:16:44 +01:00
2020-09-07 17:11:51 +02:00
<a class="rounded p-3 bg-indigo-500 hover:bg-indigo-700 shadow-lg" href="../{{file_id}}/download">Download Now! ({{ human_size }})</a>
2020-12-12 15:16:44 +01:00
2020-08-10 09:27:52 +02:00
</div>
{% else %}
2020-08-15 09:13:46 +02:00
<div class="mx-auto flex flex-wrap justify-center w-full md:w-3/4 mt-1">
2020-09-03 15:12:23 +02:00
<div class="flex justify-center text-gray-300 font-mono">
<p class="text-left rounded p-4 bg-gray-900 w-full shadow-lg"> {{ text_html|safe }} </p>
2020-08-15 09:13:46 +02:00
</div>
{% if reply_btns %}
<div class="w-full block">
{% for row in reply_btns %}
<div class="flex justify-center">
{% for btn in row %}
2020-08-16 08:43:30 +02:00
<a class="p-2 m-1 flex-1 border rounded bg-white border-blue-500 text-center text-blue-500 hover:bg-blue-500 hover:text-white transition ease-in duration-150" href="{{ btn.url }}" target="_blank"> {{btn.text}} </a>
2020-08-15 09:13:46 +02:00
{% endfor %}
</div>
{% endfor %}
</div>
{% endif %}
2020-08-10 09:27:52 +02:00
</div>
{% endif %}
2020-12-12 15:16:44 +01:00
2020-08-10 09:27:52 +02:00
{% else %}
<h1 class="text-blue-500 text-center text-2xl md:text-3xl lg:text-4xl xl:text-5xl">Ooops...</h1>
2020-12-12 15:16:44 +01:00
2020-08-10 09:27:52 +02:00
<p class="text-center text-sm md:text-base lg:text-xl xl:text-2xl font-semibold">
{{ reason }}
</p>
{% endif %}
2020-12-12 15:16:44 +01:00
2020-08-10 09:27:52 +02:00
</div>
2020-12-12 15:16:44 +01:00
2020-08-12 12:39:29 +02:00
{% include 'footer.html' %}