invidious-mod-JP/src/invidious/views/preferences.ecr

192 lines
9.8 KiB
Plaintext
Raw Normal View History

2018-07-16 16:24:24 +00:00
<% content_for "header" do %>
2018-12-20 21:32:09 +00:00
<title><%= translate(locale, "Preferences") %> - Invidious</title>
2018-07-16 16:24:24 +00:00
<% end %>
<script>
function update_value(element) {
document.getElementById('volume-value').innerText = element.value;
}
</script>
2018-07-26 14:59:05 +00:00
<div class="h-box">
<form class="pure-form pure-form-aligned" action="/preferences?referer=<%= referer %>" method="post">
<fieldset>
2018-12-20 21:32:09 +00:00
<legend><%= translate(locale, "Player preferences") %></legend>
2018-07-16 16:24:24 +00:00
2018-07-26 14:59:05 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="video_loop"><%= translate(locale, "Always loop: ") %></label>
2018-07-26 14:59:05 +00:00
<input name="video_loop" id="video_loop" type="checkbox" <% if user.preferences.video_loop %>checked<% end %>>
</div>
2018-07-16 16:24:24 +00:00
2018-07-26 14:59:05 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="autoplay"><%= translate(locale, "Autoplay: ") %></label>
2018-07-26 14:59:05 +00:00
<input name="autoplay" id="autoplay" type="checkbox" <% if user.preferences.autoplay %>checked<% end %>>
</div>
2018-07-16 16:24:24 +00:00
2018-10-30 14:41:23 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="continue"><%= translate(locale, "Autoplay next video: ") %></label>
2018-11-11 17:45:05 +00:00
<input name="continue" id="continue" type="checkbox" <% if user.preferences.continue %>checked<% end %>>
</div>
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="listen"><%= translate(locale, "Listen by default: ") %></label>
2018-10-30 14:41:23 +00:00
<input name="listen" id="listen" type="checkbox" <% if user.preferences.listen %>checked<% end %>>
</div>
2018-07-26 14:59:05 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="speed"><%= translate(locale, "Default speed: ") %></label>
2018-07-26 14:59:05 +00:00
<select name="speed" id="speed">
2018-08-11 20:03:24 +00:00
<% {2.0, 1.5, 1.0, 0.5}.each do |option| %>
2018-07-26 14:59:05 +00:00
<option <% if user.preferences.speed == option %> selected <% end %>><%= option %></option>
<% end %>
</select>
</div>
2018-07-16 16:57:52 +00:00
2018-07-26 14:59:05 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="quality"><%= translate(locale, "Preferred video quality: ") %></label>
2018-07-26 14:59:05 +00:00
<select name="quality" id="quality">
2018-09-25 00:28:36 +00:00
<% {"dash", "hd720", "medium", "small"}.each do |option| %>
2018-12-20 21:32:09 +00:00
<option value="<%= option %>" <% if user.preferences.quality == option %> selected <% end %>><%= translate(locale, option) %></option>
2018-07-26 14:59:05 +00:00
<% end %>
</select>
</div>
2018-07-16 16:24:24 +00:00
2018-07-26 14:59:05 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="volume"><%= translate(locale, "Player volume: ") %></label>
2018-07-26 14:59:05 +00:00
<input name="volume" id="volume" oninput="update_value(this);" type="range" min="0" max="100" step="5" value="<%= user.preferences.volume %>">
<span class="pure-form-message-inline" id="volume-value"><%= user.preferences.volume %></span>
</div>
2018-07-16 16:24:24 +00:00
2018-07-28 14:49:58 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="comments_0"><%= translate(locale, "Default comments: ") %></label>
2018-08-25 23:33:15 +00:00
<select name="comments_0" id="comments_0">
<% {"", "youtube", "reddit"}.each do |option| %>
2018-12-20 21:32:09 +00:00
<option value="<%= option %>" <% if user.preferences.comments[0] == option %> selected <% end %>><%= translate(locale, option) %></option>
2018-08-25 23:33:15 +00:00
<% end %>
</select>
</div>
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="comments_1"><%= translate(locale, "Fallback comments: ") %></label>
2018-08-25 23:33:15 +00:00
<select name="comments_1" id="comments_1">
<% {"", "youtube", "reddit"}.each do |option| %>
2018-12-20 21:32:09 +00:00
<option value="<%= option %>" <% if user.preferences.comments[1] == option %> selected <% end %>><%= translate(locale, option) %></option>
2018-07-28 14:49:58 +00:00
<% end %>
</select>
</div>
2018-08-06 18:23:36 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="captions_0"><%= translate(locale, "Default captions: ") %></label>
2018-08-06 18:23:36 +00:00
<select class="pure-u-1-5" name="captions_0" id="captions_0">
<% CAPTION_LANGUAGES.each do |option| %>
2018-12-20 21:32:09 +00:00
<option value="<%= option %>" <% if user.preferences.captions[0] == option %> selected <% end %>><%= translate(locale, option) %></option>
2018-08-06 18:23:36 +00:00
<% end %>
</select>
</div>
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="captions_fallback"><%= translate(locale, "Fallback captions: ") %></label>
2018-08-06 18:23:36 +00:00
<select class="pure-u-1-5" name="captions_1" id="captions_1">
<% CAPTION_LANGUAGES.each do |option| %>
2018-12-20 21:32:09 +00:00
<option value="<%= option %>" <% if user.preferences.captions[1] == option %> selected <% end %>><%= translate(locale, option) %></option>
2018-08-06 18:23:36 +00:00
<% end %>
</select>
<select class="pure-u-1-5" name="captions_2" id="captions_2">
<% CAPTION_LANGUAGES.each do |option| %>
2018-12-20 21:32:09 +00:00
<option value="<%= option %>" <% if user.preferences.captions[2] == option %> selected <% end %>><%= translate(locale, option) %></option>
2018-08-06 18:23:36 +00:00
<% end %>
</select>
</div>
2018-08-30 21:49:38 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="related_videos"><%= translate(locale, "Show related videos? ") %></label>
2018-08-30 21:49:38 +00:00
<input name="related_videos" id="related_videos" type="checkbox" <% if user.preferences.related_videos %>checked<% end %>>
</div>
2018-12-20 21:32:09 +00:00
<legend><%= translate(locale, "Visual preferences") %></legend>
2018-08-30 21:49:38 +00:00
2018-07-26 14:59:05 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="locale"><%= translate(locale, "Language: ") %></label>
<select name="locale" id="locale">
<% LOCALES.each_key do |option| %>
<option value="<%= option %>" <% if user.preferences.locale == option %> selected <% end %>><%= option %></option>
<% end %>
</select>
</div>
<div class="pure-control-group">
<label for="dark_mode"><%= translate(locale, "Dark mode: ") %></label>
2018-07-26 14:59:05 +00:00
<input name="dark_mode" id="dark_mode" type="checkbox" <% if user.preferences.dark_mode %>checked<% end %>>
</div>
2018-07-16 16:24:24 +00:00
2018-07-26 17:09:29 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="thin_mode"><%= translate(locale, "Thin mode: ") %></label>
2018-07-26 17:09:29 +00:00
<input name="thin_mode" id="thin_mode" type="checkbox" <% if user.preferences.thin_mode %>checked<% end %>>
</div>
2018-12-20 21:32:09 +00:00
<legend><%= translate(locale, "Subscription preferences") %></legend>
2018-08-30 21:49:38 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="redirect_feed"><%= translate(locale, "Redirect homepage to feed: ") %></label>
<input name="redirect_feed" id="redirect_feed" type="checkbox" <% if user.preferences.redirect_feed %>checked<% end %>>
</div>
2018-07-26 14:59:05 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="max_results"><%= translate(locale, "Number of videos shown in feed: ") %></label>
2018-07-26 14:59:05 +00:00
<input name="max_results" id="max_results" type="number" value="<%= user.preferences.max_results %>">
</div>
2018-07-17 00:31:49 +00:00
2018-07-26 14:59:05 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="sort"><%= translate(locale, "Sort videos by: ") %></label>
2018-07-26 14:59:05 +00:00
<select name="sort" id="sort">
<% {"published", "published - reverse", "alphabetically", "alphabetically - reverse", "channel name", "channel name - reverse"}.each do |option| %>
2018-12-20 21:32:09 +00:00
<option value="<%= option %>" <% if user.preferences.sort == option %> selected <% end %>><%= translate(locale, option) %></option>
2018-07-26 14:59:05 +00:00
<% end %>
</select>
</div>
2018-07-26 14:59:05 +00:00
<div class="pure-control-group">
2018-11-26 20:28:15 +00:00
<label for="latest_only">Only show latest <% if user.preferences.unseen_only %>unwatched<% end %> video from channel: </label>
2018-07-26 14:59:05 +00:00
<input name="latest_only" id="latest_only" type="checkbox" <% if user.preferences.latest_only %>checked<% end %>>
</div>
2018-07-29 01:40:59 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="unseen_only"><%= translate(locale, "Only show unwatched: ") %></label>
2018-07-29 01:40:59 +00:00
<input name="unseen_only" id="unseen_only" type="checkbox" <% if user.preferences.unseen_only %>checked<% end %>>
</div>
2018-07-31 15:44:07 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="notifications_only"><%= translate(locale, "Only show notifications (if there are any): ") %></label>
2018-07-31 15:44:07 +00:00
<input name="notifications_only" id="notifications_only" type="checkbox" <% if user.preferences.notifications_only %>checked<% end %>>
</div>
2018-12-20 21:32:09 +00:00
<legend><%= translate(locale, "Data preferences") %></legend>
2018-08-30 21:49:38 +00:00
2018-07-29 01:40:59 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<a href="/clear_watch_history?referer=<%= URI.escape(referer) %>"><%= translate(locale, "Clear watch history") %></a>
</div>
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<a href="/data_control?referer=<%= URI.escape(referer) %>"><%= translate(locale, "Import/Export data") %></a>
2018-08-06 00:59:45 +00:00
</div>
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<a href="/subscription_manager"><%= translate(locale, "Manage subscriptions") %></a>
2018-07-29 01:40:59 +00:00
</div>
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<a href="/feed/history"><%= translate(locale, "Watch history") %></a>
</div>
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<a href="/delete_account?referer=<%= URI.escape(referer) %>"><%= translate(locale, "Delete account") %></a>
</div>
2018-07-26 14:59:05 +00:00
<div class="pure-controls">
2018-12-20 21:32:09 +00:00
<button type="submit" class="pure-button pure-button-primary"><%= translate(locale, "Save preferences") %></button>
2018-07-26 14:59:05 +00:00
</div>
</fieldset>
</form>
2018-08-17 16:04:38 +00:00
</div>