mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-05 12:18:30 +00:00
Add toggleable preference for nickname display
This commit is contained in:
parent
cb8b98f939
commit
bb9c07aa93
@ -113,6 +113,7 @@
|
||||
"Administrator preferences": "Administrator preferences",
|
||||
"Default homepage: ": "Default homepage: ",
|
||||
"Feed menu: ": "Feed menu: ",
|
||||
"Show nickname on top: ": "Show nickname on top: ",
|
||||
"Top enabled: ": "Top enabled: ",
|
||||
"CAPTCHA enabled: ": "CAPTCHA enabled: ",
|
||||
"Login enabled: ": "Login enabled: ",
|
||||
@ -384,4 +385,4 @@
|
||||
"Playlists": "Playlists",
|
||||
"Community": "Community",
|
||||
"Current version: ": "Current version: "
|
||||
}
|
||||
}
|
||||
|
@ -332,5 +332,6 @@
|
||||
"Videos": "Filmy",
|
||||
"Playlists": "Playlisty",
|
||||
"Community": "Społeczność",
|
||||
"Current version: ": "Aktualna wersja: "
|
||||
"Current version: ": "Aktualna wersja: ",
|
||||
"Show nickname on top: ": "Pokaż nazwę użytkownika na górze: "
|
||||
}
|
||||
|
@ -2042,6 +2042,10 @@ post "/preferences" do |env|
|
||||
notifications_only ||= "off"
|
||||
notifications_only = notifications_only == "on"
|
||||
|
||||
show_nick = env.params.body["show_nick"]?.try &.as(String)
|
||||
show_nick ||= "off"
|
||||
show_nick = show_nick == "on"
|
||||
|
||||
# Convert to JSON and back again to take advantage of converters used for compatability
|
||||
preferences = Preferences.from_json({
|
||||
annotations: annotations,
|
||||
@ -2058,6 +2062,7 @@ post "/preferences" do |env|
|
||||
locale: locale,
|
||||
max_results: max_results,
|
||||
notifications_only: notifications_only,
|
||||
show_nick: show_nick,
|
||||
player_style: player_style,
|
||||
quality: quality,
|
||||
default_home: default_home,
|
||||
|
@ -150,6 +150,7 @@ struct ConfigPreferences
|
||||
unseen_only: {type: Bool, default: false},
|
||||
video_loop: {type: Bool, default: false},
|
||||
volume: {type: Int32, default: 100},
|
||||
show_nick: {type: Bool, default: true},
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -93,6 +93,7 @@ struct Preferences
|
||||
unseen_only: {type: Bool, default: CONFIG.default_user_preferences.unseen_only},
|
||||
video_loop: {type: Bool, default: CONFIG.default_user_preferences.video_loop},
|
||||
volume: {type: Int32, default: CONFIG.default_user_preferences.volume},
|
||||
show_nick: {type: Bool, default: CONFIG.default_user_preferences.show_nick},
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -161,6 +161,11 @@ function update_value(element) {
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<% if env.get? "user" %>
|
||||
<legend><%= translate(locale, "Subscription preferences") %></legend>
|
||||
|
||||
|
@ -66,9 +66,11 @@
|
||||
<i class="icon ion-ios-cog"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="pure-u-1-4">
|
||||
<span id="user_name">Welcome, <%= env.get("user").as(User).email %></span>
|
||||
</div>
|
||||
<% if env.get("preferences").as(Preferences).show_nick %>
|
||||
<div class="pure-u-1-4">
|
||||
<span id="user_name">Welcome, <%= env.get("user").as(User).email %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="pure-u-1-4">
|
||||
<form action="/signout?referer=<%= env.get?("current_page") %>" method="post">
|
||||
<input type="hidden" name="csrf_token" value="<%= URI.encode_www_form(env.get?("csrf_token").try &.as(String) || "") %>">
|
||||
|
Loading…
Reference in New Issue
Block a user