mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Small download refactoring. See commit message
Wrap download widget around details box Remove ability to disable dl on only certain vids
This commit is contained in:
parent
e50a9bfa77
commit
fddca10b6b
2 changed files with 39 additions and 33 deletions
|
@ -92,7 +92,6 @@ class Config
|
|||
property admins : Array(String) = [] of String
|
||||
property external_port : Int32? = nil
|
||||
property default_user_preferences : ConfigPreferences = ConfigPreferences.from_yaml("")
|
||||
property dmca_content : Array(String) = [] of String # For compliance with DMCA, disables download widget using list of video IDs
|
||||
property check_tables : Bool = false # Check table integrity, automatically try to add any missing columns, create tables, etc.
|
||||
property cache_annotations : Bool = false # Cache annotations requested from IA, will not cache empty annotations or annotations that only contain cards
|
||||
property banner : String? = nil # Optional banner to be displayed along top of page for announcements, etc.
|
||||
|
|
|
@ -161,12 +161,18 @@ we're going to need to do it here in order to allow for translations.
|
|||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if CONFIG.dmca_content.includes?(video.id) || CONFIG.disabled?("downloads") %>
|
||||
<p id="download"><%= translate(locale, "Download is disabled.") %></p>
|
||||
<% if CONFIG.disabled?("downloads") %>
|
||||
<% else %>
|
||||
<details id="download-box">
|
||||
<summary class="simulated_a">
|
||||
<p>
|
||||
<i style="margin: 0px 2px;" class="icon ion-md-download"></i>
|
||||
<%= translate(locale, "Download") %>
|
||||
</p>
|
||||
</summary>
|
||||
|
||||
<form class="pure-form pure-form-stacked" action="/latest_version" method="get" rel="noopener" target="_blank">
|
||||
<div class="pure-control-group">
|
||||
<label for="download_widget"><%= translate(locale, "Download as: ") %></label>
|
||||
<select style="width:100%" name="download_widget" id="download_widget">
|
||||
<% fmt_stream.each do |option| %>
|
||||
<option value='{"id":"<%= video.id %>","itag":"<%= option["itag"] %>","title":"<%= URI.encode_www_form(video.title) %>-<%= video.id %>.<%= option["mimeType"].as_s.split(";")[0].split("/")[1] %>"}'>
|
||||
|
@ -184,8 +190,8 @@ we're going to need to do it here in order to allow for translations.
|
|||
</option>
|
||||
<% end %>
|
||||
<% captions.each do |caption| %>
|
||||
<option value='{"id":"<%= video.id %>","label":"<%= caption.name %>","title":"<%= URI.encode_www_form(video.title) %>-<%= video.id %>.<%= caption.languageCode %>.vtt"}'>
|
||||
<%= translate(locale, "Subtitles - `x` (.vtt)", caption.name) %>
|
||||
<option value='{"id":"<%= video.id %>","label":"<%= caption.name.simpleText %>","title":"<%= URI.encode_www_form(video.title) %>-<%= video.id %>.<%= caption.languageCode %>.vtt"}'>
|
||||
<%= translate(locale, "Subtitles - `x` (.vtt)", caption.name.simpleText) %>
|
||||
</option>
|
||||
<% end %>
|
||||
</select>
|
||||
|
@ -195,6 +201,7 @@ we're going to need to do it here in order to allow for translations.
|
|||
<b><%= translate(locale, "Download") %></b>
|
||||
</button>
|
||||
</form>
|
||||
</details>
|
||||
<% end %>
|
||||
|
||||
<p id="views"><i class="icon ion-ios-eye"></i> <%= number_with_separator(video.views) %></p>
|
||||
|
|
Loading…
Reference in a new issue