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 %>
2018-07-26 14:59:05 +00:00
<div class="h-box">
2019-09-24 17:31:33 +00:00
<form class="pure-form pure-form-aligned" action="/preferences?referer=<%= URI.encode_www_form(referer) %>" method="post">
2018-07-26 14:59:05 +00:00
<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>
2019-02-24 15:49:48 +00:00
<input name="video_loop" id="video_loop" type="checkbox" <% if preferences.video_loop %>checked<% end %>>
2018-07-26 14:59:05 +00:00
</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>
2019-02-24 15:49:48 +00:00
<input name="autoplay" id="autoplay" type="checkbox" <% if preferences.autoplay %>checked<% end %>>
2018-07-26 14:59:05 +00:00
</div>
2018-07-16 16:24:24 +00:00
2018-10-30 14:41:23 +00:00
<div class="pure-control-group">
2019-04-19 14:38:27 +00:00
<label for="continue"><%= translate(locale, "Play next by default: ") %></label>
2019-02-24 15:49:48 +00:00
<input name="continue" id="continue" type="checkbox" <% if preferences.continue %>checked<% end %>>
2018-11-11 17:45:05 +00:00
</div>
2019-04-19 14:38:27 +00:00
<div class="pure-control-group">
<label for="continue_autoplay"><%= translate(locale, "Autoplay next video: ") %></label>
<input name="continue_autoplay" id="continue_autoplay" type="checkbox" <% if preferences.continue_autoplay %>checked<% end %>>
</div>
2019-03-13 02:05:49 +00:00
<div class="pure-control-group">
2019-07-19 00:39:55 +00:00
<label for="local"><%= translate(locale, "Proxy videos: ") %></label>
2019-07-07 14:07:53 +00:00
<input name="local" id="local" type="checkbox" <% if preferences.local && !CONFIG.disabled?("local") %>checked<% end %> <% if CONFIG.disabled?("local") %>disabled<% end %>>
2019-03-13 02:05:49 +00:00
</div>
2018-11-11 17:45:05 +00:00
<div class="pure-control-group">
2018-12-20 21:32:09 +00:00
<label for="listen"><%= translate(locale, "Listen by default: ") %></label>
2019-02-24 15:49:48 +00:00
<input name="listen" id="listen" type="checkbox" <% if preferences.listen %>checked<% end %>>
2018-10-30 14:41:23 +00:00
</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">
2019-07-14 15:08:46 +00:00
<% {2.0, 1.75, 1.5, 1.25, 1.0, 0.75, 0.5, 0.25}.each do |option| %>
2019-05-02 01:03:39 +00:00
<option <% if preferences.speed == option %> selected <% end %>><%= option %></option>
<% end %>
2018-07-26 14:59:05 +00:00
</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">
2019-05-02 01:03:39 +00:00
<% {"dash", "hd720", "medium", "small"}.each do |option| %>
2019-07-07 14:07:53 +00:00
<% if !(option == "dash" && CONFIG.disabled?("dash")) %>
<option value="<%= option %>" <% if preferences.quality == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
2019-05-02 01:03:39 +00:00
<% end %>
2018-07-26 14:59:05 +00:00
</select>
</div>
2018-07-16 16:24:24 +00:00
2020-12-13 09:16:26 +00:00
<% if !CONFIG.disabled?("dash") %>
<div class="pure-control-group">
<label for="quality_dash"><%= translate(locale, "Preferred dash video quality: ") %></label>
<select name="quality_dash" id="quality_dash">
2020-12-19 16:48:20 +00:00
<% {"auto", "best", "4320p", "2160p", "1440p", "1080p", "720p", "480p", "360p", "240p", "144p", "worst"}.each do |option| %>
2020-12-13 09:16:26 +00:00
<option value="<%= option %>" <% if preferences.quality_dash == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</div>
<% end %>
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>
2020-03-15 21:46:08 +00:00
<input name="volume" id="volume" data-onrange="update_volume_value" type="range" min="0" max="100" step="5" value="<%= preferences.volume %>">
2019-02-24 15:49:48 +00:00
<span class="pure-form-message-inline" id="volume-value"><%= preferences.volume %></span>
2018-07-26 14:59:05 +00:00
</div>
2018-07-16 16:24:24 +00:00
2018-07-28 14:49:58 +00:00
<div class="pure-control-group">
2019-03-01 22:06:45 +00:00
<label for="comments[0]"><%= translate(locale, "Default comments: ") %></label>
<% preferences.comments.each_with_index do |comments, index| %>
2019-05-02 01:03:39 +00:00
<select name="comments[<%= index %>]" id="comments[<%= index %>]">
<% {"", "youtube", "reddit"}.each do |option| %>
2020-11-16 00:33:55 +00:00
<option value="<%= option %>" <% if preferences.comments[index] == option %> selected <% end %>><%= translate(locale, option.blank? ? "none" : option) %></option>
2019-05-02 01:03:39 +00:00
<% end %>
</select>
2018-08-06 18:23:36 +00:00
<% end %>
</div>
<div class="pure-control-group">
2019-03-01 22:06:45 +00:00
<label for="captions[0]"><%= translate(locale, "Default captions: ") %></label>
<% preferences.captions.each_with_index do |caption, index| %>
2019-05-02 01:03:39 +00:00
<select class="pure-u-1-6" name="captions[<%= index %>]" id="captions[<%= index %>]">
<% CAPTION_LANGUAGES.each do |option| %>
2020-11-16 00:33:55 +00:00
<option value="<%= option %>" <% if preferences.captions[index] == option %> selected <% end %>><%= translate(locale, option.blank? ? "none" : option) %></option>
2019-05-02 01:03:39 +00:00
<% end %>
</select>
2018-08-06 18:23:36 +00:00
<% end %>
</div>
2018-08-30 21:49:38 +00:00
<div class="pure-control-group">
2019-07-19 00:39:55 +00:00
<label for="related_videos"><%= translate(locale, "Show related videos: ") %></label>
2019-02-24 15:49:48 +00:00
<input name="related_videos" id="related_videos" type="checkbox" <% if preferences.related_videos %>checked<% end %>>
2018-08-30 21:49:38 +00:00
</div>
2019-05-01 04:39:04 +00:00
<div class="pure-control-group">
2019-07-19 00:39:55 +00:00
<label for="annotations"><%= translate(locale, "Show annotations by default: ") %></label>
2019-05-01 04:39:04 +00:00
<input name="annotations" id="annotations" type="checkbox" <% if preferences.annotations %>checked<% end %>>
</div>
2019-11-11 16:06:06 +00:00
<div class="pure-control-group">
2021-04-02 23:00:43 +00:00
<label for="extend_desc"><%= translate(locale, "Automatically extend video description: ") %></label>
2019-11-11 16:06:06 +00:00
<input name="extend_desc" id="extend_desc" type="checkbox" <% if preferences.extend_desc %>checked<% end %>>
</div>
2021-04-12 03:55:07 +00:00
<div class="pure-control-group">
<label for="vr_mode"><%= translate(locale, "Interactive 360 degree videos") %></label>
<input name="vr_mode" id="vr_mode" type="checkbox" <% if preferences.vr_mode %>checked<% end %>>
</div>
2019-11-11 16:06:06 +00:00
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">
2019-05-02 01:03:39 +00:00
<% LOCALES.each_key do |option| %>
<option value="<%= option %>" <% if preferences.locale == option %> selected <% end %>><%= option %></option>
<% end %>
2018-12-20 21:32:09 +00:00
</select>
</div>
2019-08-09 00:00:22 +00:00
<div class="pure-control-group">
<label for="player_style"><%= translate(locale, "Player style: ") %></label>
<select name="player_style" id="player_style">
2019-08-14 20:12:37 +00:00
<% {"invidious", "youtube"}.each do |option| %>
2019-08-09 00:00:22 +00:00
<option value="<%= option %>" <% if preferences.player_style == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</div>
2018-12-20 21:32:09 +00:00
<div class="pure-control-group">
2019-08-15 16:29:55 +00:00
<label for="dark_mode"><%= translate(locale, "Theme: ") %></label>
<select name="dark_mode" id="dark_mode">
<% {"", "light", "dark"}.each do |option| %>
2020-11-16 00:33:55 +00:00
<option value="<%= option %>" <% if preferences.dark_mode == option %> selected <% end %>><%= translate(locale, option.blank? ? "auto" : option) %></option>
2019-08-15 16:29:55 +00:00
<% end %>
</select>
2018-07-26 14:59:05 +00:00
</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>
2019-02-24 15:49:48 +00:00
<input name="thin_mode" id="thin_mode" type="checkbox" <% if preferences.thin_mode %>checked<% end %>>
2018-07-26 17:09:29 +00:00
</div>
2019-10-21 00:42:18 +00:00
<% if env.get?("user") %>
2020-12-19 18:30:42 +00:00
<% feed_options = {"", "Popular", "Trending", "Subscriptions", "Playlists"} %>
2019-10-21 00:42:18 +00:00
<% else %>
2020-12-19 18:30:42 +00:00
<% feed_options = {"", "Popular", "Trending"} %>
2019-10-21 00:42:18 +00:00
<% end %>
<div class="pure-control-group">
<label for="default_home"><%= translate(locale, "Default homepage: ") %></label>
<select name="default_home" id="default_home">
<% feed_options.each do |option| %>
2021-04-08 02:36:40 +00:00
<option value="<%= option %>" <% if preferences.default_home == option %> selected <% end %>><%= translate(locale, option.blank? ? "Search" : option) %></option>
2019-10-21 00:42:18 +00:00
<% end %>
</select>
</div>
<div class="pure-control-group">
<label for="feed_menu"><%= translate(locale, "Feed menu: ") %></label>
<% (feed_options.size - 1).times do |index| %>
<select name="feed_menu[<%= index %>]" id="feed_menu[<%= index %>]">
<% feed_options.each do |option| %>
2021-04-08 02:36:40 +00:00
<option value="<%= option %>" <% if preferences.feed_menu[index]? == option %> selected <% end %>><%= translate(locale, option.blank? ? "Search" : option) %></option>
2019-10-21 00:42:18 +00:00
<% end %>
</select>
<% end %>
</div>
2020-02-23 12:23:25 +00:00
<% if env.get? "user" %>
<div class="pure-control-group">
<label for="show_nick"><%= translate(locale, "Show nickname on top: ") %></label>
<input name="show_nick" id="show_nick" type="checkbox" <% if preferences.show_nick %>checked<% end %>>
</div>
<% end %>
2019-10-21 00:42:18 +00:00
2021-05-16 03:08:33 +00:00
<legend><%= translate(locale, "Miscellaneous preferences") %></legend>
<div class="pure-control-group">
2021-06-14 10:00:07 +00:00
<label for="automatic_instance_redirect"><%= translate(locale, "Automaticatic instance redirection (fallback to redirect.invidious.io): ") %></label>
2021-05-16 03:08:33 +00:00
<input name="automatic_instance_redirect" id="automatic_instance_redirect" type="checkbox" <% if preferences.automatic_instance_redirect %>checked<% end %>>
</div>
2019-02-24 15:49:48 +00:00
<% if env.get? "user" %>
2019-05-02 01:03:39 +00:00
<legend><%= translate(locale, "Subscription preferences") %></legend>
<div class="pure-control-group">
2019-07-19 00:39:55 +00:00
<label for="annotations_subscribed"><%= translate(locale, "Show annotations by default for subscribed channels: ") %></label>
2019-05-02 01:03:39 +00:00
<input name="annotations_subscribed" id="annotations_subscribed" type="checkbox" <% if preferences.annotations_subscribed %>checked<% end %>>
</div>
<div class="pure-control-group">
<label for="max_results"><%= translate(locale, "Number of videos shown in feed: ") %></label>
<input name="max_results" id="max_results" type="number" value="<%= preferences.max_results %>">
</div>
<div class="pure-control-group">
<label for="sort"><%= translate(locale, "Sort videos by: ") %></label>
<select name="sort" id="sort">
<% {"published", "published - reverse", "alphabetically", "alphabetically - reverse", "channel name", "channel name - reverse"}.each do |option| %>
<option value="<%= option %>" <% if preferences.sort == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</div>
<div class="pure-control-group">
<% if preferences.unseen_only %>
<label for="latest_only"><%= translate(locale, "Only show latest unwatched video from channel: ") %></label>
<% else %>
<label for="latest_only"><%= translate(locale, "Only show latest video from channel: ") %></label>
<% end %>
<input name="latest_only" id="latest_only" type="checkbox" <% if preferences.latest_only %>checked<% end %>>
</div>
<div class="pure-control-group">
<label for="unseen_only"><%= translate(locale, "Only show unwatched: ") %></label>
<input name="unseen_only" id="unseen_only" type="checkbox" <% if preferences.unseen_only %>checked<% end %>>
</div>
<div class="pure-control-group">
<label for="notifications_only"><%= translate(locale, "Only show notifications (if there are any): ") %></label>
<input name="notifications_only" id="notifications_only" type="checkbox" <% if preferences.notifications_only %>checked<% end %>>
</div>
2019-05-05 12:46:01 +00:00
2019-06-01 23:06:44 +00:00
<% # Web notifications are only supported over HTTPS %>
2021-01-23 18:39:04 +00:00
<% if Kemal.config.ssl || CONFIG.https_only %>
2019-05-05 12:46:01 +00:00
<div class="pure-control-group">
2020-03-15 21:46:08 +00:00
<a href="#" data-onclick="notification_requestPermission"><%= translate(locale, "Enable web notifications") %></a>
2019-05-05 12:46:01 +00:00
</div>
<% end %>
2019-02-24 15:49:48 +00:00
<% end %>
2018-07-31 15:44:07 +00:00
2021-01-23 18:39:04 +00:00
<% if env.get?("user") && CONFIG.admins.includes? env.get?("user").as(User).email %>
2019-05-02 01:03:39 +00:00
<legend><%= translate(locale, "Administrator preferences") %></legend>
<div class="pure-control-group">
2019-10-21 00:42:18 +00:00
<label for="admin_default_home"><%= translate(locale, "Default homepage: ") %></label>
<select name="admin_default_home" id="admin_default_home">
<% feed_options.each do |option| %>
2020-11-16 00:33:55 +00:00
<option value="<%= option %>" <% if CONFIG.default_user_preferences.default_home == option %> selected <% end %>><%= translate(locale, option.blank? ? "none" : option) %></option>
2019-05-02 01:03:39 +00:00
<% end %>
</select>
</div>
<div class="pure-control-group">
2019-10-21 00:42:18 +00:00
<label for="admin_feed_menu"><%= translate(locale, "Feed menu: ") %></label>
<% (feed_options.size - 1).times do |index| %>
<select name="admin_feed_menu[<%= index %>]" id="admin_feed_menu[<%= index %>]">
<% feed_options.each do |option| %>
2020-11-16 00:33:55 +00:00
<option value="<%= option %>" <% if CONFIG.default_user_preferences.feed_menu[index]? == option %> selected <% end %>><%= translate(locale, option.blank? ? "none" : option) %></option>
2019-05-02 01:03:39 +00:00
<% end %>
</select>
<% end %>
</div>
2020-12-27 05:12:43 +00:00
<div class="pure-control-group">
<label for="popular_enabled"><%= translate(locale, "Popular enabled: ") %></label>
2021-01-23 18:39:04 +00:00
<input name="popular_enabled" id="popular_enabled" type="checkbox" <% if CONFIG.popular_enabled %>checked<% end %>>
2020-12-27 05:12:43 +00:00
</div>
2019-05-02 01:03:39 +00:00
<div class="pure-control-group">
2019-07-19 00:39:55 +00:00
<label for="captcha_enabled"><%= translate(locale, "CAPTCHA enabled: ") %></label>
2021-01-23 18:39:04 +00:00
<input name="captcha_enabled" id="captcha_enabled" type="checkbox" <% if CONFIG.captcha_enabled %>checked<% end %>>
2019-05-02 01:03:39 +00:00
</div>
<div class="pure-control-group">
2019-07-19 00:39:55 +00:00
<label for="login_enabled"><%= translate(locale, "Login enabled: ") %></label>
2021-01-23 18:39:04 +00:00
<input name="login_enabled" id="login_enabled" type="checkbox" <% if CONFIG.login_enabled %>checked<% end %>>
2019-05-02 01:03:39 +00:00
</div>
<div class="pure-control-group">
2019-07-19 00:39:55 +00:00
<label for="registration_enabled"><%= translate(locale, "Registration enabled: ") %></label>
2021-01-23 18:39:04 +00:00
<input name="registration_enabled" id="registration_enabled" type="checkbox" <% if CONFIG.registration_enabled %>checked<% end %>>
2019-05-02 01:03:39 +00:00
</div>
<div class="pure-control-group">
2019-07-19 00:39:55 +00:00
<label for="statistics_enabled"><%= translate(locale, "Report statistics: ") %></label>
2021-01-23 18:39:04 +00:00
<input name="statistics_enabled" id="statistics_enabled" type="checkbox" <% if CONFIG.statistics_enabled %>checked<% end %>>
2019-05-02 01:03:39 +00:00
</div>
2019-03-01 22:06:45 +00:00
<% end %>
2019-02-24 15:49:48 +00:00
<% if env.get? "user" %>
2019-05-02 01:03:39 +00:00
<legend><%= translate(locale, "Data preferences") %></legend>
2018-08-30 21:49:38 +00:00
2019-05-02 01:03:39 +00:00
<div class="pure-control-group">
2019-09-24 17:31:33 +00:00
<a href="/clear_watch_history?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Clear watch history") %></a>
2019-05-02 01:03:39 +00:00
</div>
2019-03-01 22:06:45 +00:00
2019-05-02 01:03:39 +00:00
<div class="pure-control-group">
2019-09-24 17:31:33 +00:00
<a href="/change_password?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Change password") %></a>
2019-05-02 01:03:39 +00:00
</div>
2019-04-22 15:18:17 +00:00
2019-05-02 01:03:39 +00:00
<div class="pure-control-group">
2019-09-24 17:31:33 +00:00
<a href="/data_control?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Import/export data") %></a>
2019-05-02 01:03:39 +00:00
</div>
2018-08-06 00:59:45 +00:00
2019-05-02 01:03:39 +00:00
<div class="pure-control-group">
<a href="/subscription_manager"><%= translate(locale, "Manage subscriptions") %></a>
</div>
2018-07-29 01:40:59 +00:00
2019-05-02 01:03:39 +00:00
<div class="pure-control-group">
<a href="/token_manager"><%= translate(locale, "Manage tokens") %></a>
</div>
2019-04-18 21:23:50 +00:00
2019-08-05 23:49:13 +00:00
<div class="pure-control-group">
<a href="/view_all_playlists"><%= translate(locale, "View all playlists") %></a>
</div>
2019-05-02 01:03:39 +00:00
<div class="pure-control-group">
<a href="/feed/history"><%= translate(locale, "Watch history") %></a>
</div>
2018-11-21 19:10:56 +00:00
2019-05-02 01:03:39 +00:00
<div class="pure-control-group">
2019-09-24 17:31:33 +00:00
<a href="/delete_account?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Delete account") %></a>
2019-05-02 01:03:39 +00:00
</div>
2019-02-24 15:49:48 +00:00
<% end %>
2018-11-08 06:12:14 +00:00
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>