Make 'modified_source_code_url' editable from admin preferences

This commit is contained in:
Samantaz Fox 2021-10-03 22:08:47 +02:00
parent aada4603a8
commit 0936a307d0
No known key found for this signature in database
GPG Key ID: F42821059186176E
3 changed files with 9 additions and 1 deletions

View File

@ -428,5 +428,6 @@
"footer_documentation": "Documentation",
"footer_source_code": "Source code",
"footer_original_source_code": "Original source code",
"footer_modfied_source_code": "Modified Source code"
"footer_modfied_source_code": "Modified Source code",
"adminprefs_modified_source_code_url_label": "URL to modified source code repository"
}

View File

@ -198,6 +198,8 @@ module Invidious::Routes::PreferencesRoute
statistics_enabled ||= "off"
CONFIG.statistics_enabled = statistics_enabled == "on"
CONFIG.modified_source_code_url = env.params.body["modified_source_code_url"]?.try &.as(String)
File.write("config/config.yml", CONFIG.to_yaml)
end
else

View File

@ -286,6 +286,11 @@
<label for="statistics_enabled"><%= translate(locale, "Report statistics: ") %></label>
<input name="statistics_enabled" id="statistics_enabled" type="checkbox" <% if CONFIG.statistics_enabled %>checked<% end %>>
</div>
<div class="pure-control-group">
<label for="modified_source_code_url"><%= translate(locale, "adminprefs_modified_source_code_url_label") %></label>
<input name="modified_source_code_url" id="modified_source_code_url" type="input" <% if CONFIG.modified_source_code_url %>checked<% end %>>
</div>
<% end %>
<% if env.get? "user" %>