invidious-experimenting/src/invidious/views/preferences.ecr

283 lines
15 KiB
Plaintext
Raw Normal View History

2018-07-16 21:54:24 +05:30
<% content_for "header" do %>
2018-12-21 03:02:09 +05:30
<title><%= translate(locale, "Preferences") %> - Invidious</title>
2018-07-16 21:54:24 +05:30
<% end %>
<script>
function update_value(element) {
document.getElementById('volume-value').innerText = element.value;
}
</script>
2018-07-26 20:29:05 +05:30
<div class="h-box">
<form class="pure-form pure-form-aligned" action="/preferences?referer=<%= URI.encode_www_form(referer) %>" method="post">
2018-07-26 20:29:05 +05:30
<fieldset>
2018-12-21 03:02:09 +05:30
<legend><%= translate(locale, "Player preferences") %></legend>
2018-07-16 21:54:24 +05:30
2018-07-26 20:29:05 +05:30
<div class="pure-control-group">
2018-12-21 03:02:09 +05:30
<label for="video_loop"><%= translate(locale, "Always loop: ") %></label>
<input name="video_loop" id="video_loop" type="checkbox" <% if preferences.video_loop %>checked<% end %>>
2018-07-26 20:29:05 +05:30
</div>
2018-07-16 21:54:24 +05:30
2018-07-26 20:29:05 +05:30
<div class="pure-control-group">
2018-12-21 03:02:09 +05:30
<label for="autoplay"><%= translate(locale, "Autoplay: ") %></label>
<input name="autoplay" id="autoplay" type="checkbox" <% if preferences.autoplay %>checked<% end %>>
2018-07-26 20:29:05 +05:30
</div>
2018-07-16 21:54:24 +05:30
2018-10-30 20:11:23 +05:30
<div class="pure-control-group">
2019-04-19 20:08:27 +05:30
<label for="continue"><%= translate(locale, "Play next by default: ") %></label>
<input name="continue" id="continue" type="checkbox" <% if preferences.continue %>checked<% end %>>
2018-11-11 23:15:05 +05:30
</div>
2019-04-19 20:08:27 +05:30
<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 07:35:49 +05:30
<div class="pure-control-group">
2019-07-19 06:09:55 +05:30
<label for="local"><%= translate(locale, "Proxy videos: ") %></label>
<input name="local" id="local" type="checkbox" <% if preferences.local && !CONFIG.disabled?("local") %>checked<% end %> <% if CONFIG.disabled?("local") %>disabled<% end %>>
2019-03-13 07:35:49 +05:30
</div>
2018-11-11 23:15:05 +05:30
<div class="pure-control-group">
2018-12-21 03:02:09 +05:30
<label for="listen"><%= translate(locale, "Listen by default: ") %></label>
<input name="listen" id="listen" type="checkbox" <% if preferences.listen %>checked<% end %>>
2018-10-30 20:11:23 +05:30
</div>
2018-07-26 20:29:05 +05:30
<div class="pure-control-group">
2018-12-21 03:02:09 +05:30
<label for="speed"><%= translate(locale, "Default speed: ") %></label>
2018-07-26 20:29:05 +05:30
<select name="speed" id="speed">
2019-07-14 20:38:46 +05:30
<% {2.0, 1.75, 1.5, 1.25, 1.0, 0.75, 0.5, 0.25}.each do |option| %>
2019-05-02 06:33:39 +05:30
<option <% if preferences.speed == option %> selected <% end %>><%= option %></option>
<% end %>
2018-07-26 20:29:05 +05:30
</select>
</div>
2018-07-16 22:27:52 +05:30
2018-07-26 20:29:05 +05:30
<div class="pure-control-group">
2018-12-21 03:02:09 +05:30
<label for="quality"><%= translate(locale, "Preferred video quality: ") %></label>
2018-07-26 20:29:05 +05:30
<select name="quality" id="quality">
2019-05-02 06:33:39 +05:30
<% {"dash", "hd720", "medium", "small"}.each do |option| %>
<% if !(option == "dash" && CONFIG.disabled?("dash")) %>
<option value="<%= option %>" <% if preferences.quality == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
2019-05-02 06:33:39 +05:30
<% end %>
2018-07-26 20:29:05 +05:30
</select>
</div>
2018-07-16 21:54:24 +05:30
2018-07-26 20:29:05 +05:30
<div class="pure-control-group">
2018-12-21 03:02:09 +05:30
<label for="volume"><%= translate(locale, "Player volume: ") %></label>
<input name="volume" id="volume" oninput="update_value(this);" type="range" min="0" max="100" step="5" value="<%= preferences.volume %>">
<span class="pure-form-message-inline" id="volume-value"><%= preferences.volume %></span>
2018-07-26 20:29:05 +05:30
</div>
2018-07-16 21:54:24 +05:30
2018-07-28 20:19:58 +05:30
<div class="pure-control-group">
2019-03-02 03:36:45 +05:30
<label for="comments[0]"><%= translate(locale, "Default comments: ") %></label>
<% preferences.comments.each_with_index do |comments, index| %>
2019-05-02 06:33:39 +05:30
<select name="comments[<%= index %>]" id="comments[<%= index %>]">
<% {"", "youtube", "reddit"}.each do |option| %>
<option value="<%= option %>" <% if preferences.comments[index] == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
2018-08-06 23:53:36 +05:30
<% end %>
</div>
<div class="pure-control-group">
2019-03-02 03:36:45 +05:30
<label for="captions[0]"><%= translate(locale, "Default captions: ") %></label>
<% preferences.captions.each_with_index do |caption, index| %>
2019-05-02 06:33:39 +05:30
<select class="pure-u-1-6" name="captions[<%= index %>]" id="captions[<%= index %>]">
<% CAPTION_LANGUAGES.each do |option| %>
<option value="<%= option %>" <% if preferences.captions[index] == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
2018-08-06 23:53:36 +05:30
<% end %>
</div>
2018-08-31 03:19:38 +05:30
<div class="pure-control-group">
2019-07-19 06:09:55 +05:30
<label for="related_videos"><%= translate(locale, "Show related videos: ") %></label>
<input name="related_videos" id="related_videos" type="checkbox" <% if preferences.related_videos %>checked<% end %>>
2018-08-31 03:19:38 +05:30
</div>
2019-05-01 10:09:04 +05:30
<div class="pure-control-group">
2019-07-19 06:09:55 +05:30
<label for="annotations"><%= translate(locale, "Show annotations by default: ") %></label>
2019-05-01 10:09:04 +05:30
<input name="annotations" id="annotations" type="checkbox" <% if preferences.annotations %>checked<% end %>>
</div>
2018-12-21 03:02:09 +05:30
<legend><%= translate(locale, "Visual preferences") %></legend>
2018-08-31 03:19:38 +05:30
2018-07-26 20:29:05 +05:30
<div class="pure-control-group">
2018-12-21 03:02:09 +05:30
<label for="locale"><%= translate(locale, "Language: ") %></label>
<select name="locale" id="locale">
2019-05-02 06:33:39 +05:30
<% LOCALES.each_key do |option| %>
<option value="<%= option %>" <% if preferences.locale == option %> selected <% end %>><%= option %></option>
<% end %>
2018-12-21 03:02:09 +05:30
</select>
</div>
<div class="pure-control-group">
<label for="player_style"><%= translate(locale, "Player style: ") %></label>
<select name="player_style" id="player_style">
2019-08-15 01:42:37 +05:30
<% {"invidious", "youtube"}.each do |option| %>
<option value="<%= option %>" <% if preferences.player_style == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</div>
2018-12-21 03:02:09 +05:30
<div class="pure-control-group">
<label for="dark_mode"><%= translate(locale, "Theme: ") %></label>
<select name="dark_mode" id="dark_mode">
<% {"", "light", "dark"}.each do |option| %>
<option value="<%= option %>" <% if preferences.dark_mode == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
2018-07-26 20:29:05 +05:30
</div>
2018-07-16 21:54:24 +05:30
2018-07-26 22:39:29 +05:30
<div class="pure-control-group">
2018-12-21 03:02:09 +05:30
<label for="thin_mode"><%= translate(locale, "Thin mode: ") %></label>
<input name="thin_mode" id="thin_mode" type="checkbox" <% if preferences.thin_mode %>checked<% end %>>
2018-07-26 22:39:29 +05:30
</div>
<% if env.get? "user" %>
2019-05-02 06:33:39 +05:30
<legend><%= translate(locale, "Subscription preferences") %></legend>
<div class="pure-control-group">
2019-07-19 06:09:55 +05:30
<label for="annotations_subscribed"><%= translate(locale, "Show annotations by default for subscribed channels: ") %></label>
2019-05-02 06:33:39 +05:30
<input name="annotations_subscribed" id="annotations_subscribed" type="checkbox" <% if preferences.annotations_subscribed %>checked<% end %>>
</div>
<div class="pure-control-group">
<label for="redirect_feed"><%= translate(locale, "Redirect homepage to feed: ") %></label>
<input name="redirect_feed" id="redirect_feed" type="checkbox" <% if preferences.redirect_feed %>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 18:16:01 +05:30
2019-06-02 04:36:44 +05:30
<% # Web notifications are only supported over HTTPS %>
<% if Kemal.config.ssl || config.https_only %>
2019-05-05 18:16:01 +05:30
<div class="pure-control-group">
<a href="#" onclick="Notification.requestPermission()"><%= translate(locale, "Enable web notifications") %></a>
</div>
<% end %>
<% end %>
2018-07-31 21:14:07 +05:30
2019-03-02 03:36:45 +05:30
<% if env.get?("user") && config.admins.includes? env.get?("user").as(User).email %>
2019-05-02 06:33:39 +05:30
<legend><%= translate(locale, "Administrator preferences") %></legend>
<div class="pure-control-group">
<label for="default_home"><%= translate(locale, "Default homepage: ") %></label>
<select name="default_home" id="default_home">
<% {"Popular", "Top", "Trending", "Subscriptions"}.each do |option| %>
<option value="<%= option %>" <% if config.default_home == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
</div>
<div class="pure-control-group">
<label for="feed_menu"><%= translate(locale, "Feed menu: ") %></label>
<% 4.times do |index| %>
<select name="feed_menu[<%= index %>]" id="feed_menu[<%= index %>]">
<% {"", "Popular", "Top", "Trending", "Subscriptions"}.each do |option| %>
<option value="<%= option %>" <% if config.feed_menu[index]? == option %> selected <% end %>><%= translate(locale, option) %></option>
<% end %>
</select>
<% end %>
</div>
<div class="pure-control-group">
2019-07-19 06:09:55 +05:30
<label for="top_enabled"><%= translate(locale, "Top enabled: ") %></label>
2019-05-02 06:33:39 +05:30
<input name="top_enabled" id="top_enabled" type="checkbox" <% if config.top_enabled %>checked<% end %>>
</div>
<div class="pure-control-group">
2019-07-19 06:09:55 +05:30
<label for="captcha_enabled"><%= translate(locale, "CAPTCHA enabled: ") %></label>
2019-05-02 06:33:39 +05:30
<input name="captcha_enabled" id="captcha_enabled" type="checkbox" <% if config.captcha_enabled %>checked<% end %>>
</div>
<div class="pure-control-group">
2019-07-19 06:09:55 +05:30
<label for="login_enabled"><%= translate(locale, "Login enabled: ") %></label>
2019-05-02 06:33:39 +05:30
<input name="login_enabled" id="login_enabled" type="checkbox" <% if config.login_enabled %>checked<% end %>>
</div>
<div class="pure-control-group">
2019-07-19 06:09:55 +05:30
<label for="registration_enabled"><%= translate(locale, "Registration enabled: ") %></label>
2019-05-02 06:33:39 +05:30
<input name="registration_enabled" id="registration_enabled" type="checkbox" <% if config.registration_enabled %>checked<% end %>>
</div>
<div class="pure-control-group">
2019-07-19 06:09:55 +05:30
<label for="statistics_enabled"><%= translate(locale, "Report statistics: ") %></label>
2019-05-02 06:33:39 +05:30
<input name="statistics_enabled" id="statistics_enabled" type="checkbox" <% if config.statistics_enabled %>checked<% end %>>
</div>
2019-03-02 03:36:45 +05:30
<% end %>
<% if env.get? "user" %>
2019-05-02 06:33:39 +05:30
<legend><%= translate(locale, "Data preferences") %></legend>
2018-08-31 03:19:38 +05:30
2019-05-02 06:33:39 +05:30
<div class="pure-control-group">
<a href="/clear_watch_history?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Clear watch history") %></a>
2019-05-02 06:33:39 +05:30
</div>
2019-03-02 03:36:45 +05:30
2019-05-02 06:33:39 +05:30
<div class="pure-control-group">
<a href="/change_password?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Change password") %></a>
2019-05-02 06:33:39 +05:30
</div>
2019-04-22 20:48:17 +05:30
2019-05-02 06:33:39 +05:30
<div class="pure-control-group">
<a href="/data_control?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Import/export data") %></a>
2019-05-02 06:33:39 +05:30
</div>
2018-08-06 06:29:45 +05:30
2019-05-02 06:33:39 +05:30
<div class="pure-control-group">
<a href="/subscription_manager"><%= translate(locale, "Manage subscriptions") %></a>
</div>
2018-07-29 07:10:59 +05:30
2019-05-02 06:33:39 +05:30
<div class="pure-control-group">
<a href="/token_manager"><%= translate(locale, "Manage tokens") %></a>
</div>
2019-04-19 02:53:50 +05:30
2019-08-06 05:19:13 +05:30
<div class="pure-control-group">
<a href="/view_all_playlists"><%= translate(locale, "View all playlists") %></a>
</div>
2019-05-02 06:33:39 +05:30
<div class="pure-control-group">
<a href="/feed/history"><%= translate(locale, "Watch history") %></a>
</div>
2019-05-02 06:33:39 +05:30
<div class="pure-control-group">
<a href="/delete_account?referer=<%= URI.encode_www_form(referer) %>"><%= translate(locale, "Delete account") %></a>
2019-05-02 06:33:39 +05:30
</div>
<% end %>
2018-07-26 20:29:05 +05:30
<div class="pure-controls">
2018-12-21 03:02:09 +05:30
<button type="submit" class="pure-button pure-button-primary"><%= translate(locale, "Save preferences") %></button>
2018-07-26 20:29:05 +05:30
</div>
</fieldset>
</form>
2018-08-17 21:34:38 +05:30
</div>