diff --git a/static/js/admin.js b/static/js/admin.js index a6fa0e7f0c..ebfd58b7f7 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -160,6 +160,7 @@ export function build_page() { twenty_four_hour_time_values: settings_config.twenty_four_hour_time_values, create_web_public_stream_policy_values: settings_config.create_web_public_stream_policy_values, + disable_enable_spectator_access_setting: !page_params.server_web_public_streams_enabled, }; if (options.realm_logo_source !== "D" && options.realm_night_logo_source === "D") { diff --git a/static/styles/dark_theme.css b/static/styles/dark_theme.css index efabd1daf6..a5ce8b9b78 100644 --- a/static/styles/dark_theme.css +++ b/static/styles/dark_theme.css @@ -1140,6 +1140,14 @@ body.dark-theme { color: hsl(236, 15%, 70%); } } + + /* Originally the icon inherits the color of label, but when the setting + is disabled, the color of the label is changed and thus the icon becomes + too light. So, we set the color explicitly to original color of label to + keep the color of the icon same even when the setting is disabled. */ + #id_realm_enable_spectator_access_label a { + color: hsl(236, 33%, 90%); + } } @supports (-moz-appearance: none) { diff --git a/static/styles/settings.css b/static/styles/settings.css index e693fccbc1..ed7f9b56fb 100644 --- a/static/styles/settings.css +++ b/static/styles/settings.css @@ -380,6 +380,14 @@ td .button { .hidden-email { font-style: italic; } + + /* Originally the icon inherits the color of label, but when the setting + is disabled, the color of the label is changed and thus the icon becomes + too light. So, we set the color explicitly to original color of label to + keep the color of the icon same even when the setting is disabled. */ + #id_realm_enable_spectator_access_label a { + color: hsl(0, 0%, 20%); + } } #admin-user-list, diff --git a/static/templates/settings/organization_permissions_admin.hbs b/static/templates/settings/organization_permissions_admin.hbs index 9d66aab543..95f225de39 100644 --- a/static/templates/settings/organization_permissions_admin.hbs +++ b/static/templates/settings/organization_permissions_admin.hbs @@ -107,7 +107,9 @@ setting_name="realm_enable_spectator_access" prefix="id_" is_checked=realm_enable_spectator_access - label=admin_settings_label.realm_enable_spectator_access}} + label=admin_settings_label.realm_enable_spectator_access + is_disabled=disable_enable_spectator_access_setting + help_link="help/web-public-streams"}}
+ id="{{prefix}}{{setting_name}}" {{#if is_checked}}checked="checked"{{/if}} {{#if is_disabled}}disabled{{/if}} />