mirror of https://github.com/zulip/zulip.git
settings: Add UI for realm-level default of enter_sends settings.
This commit is contained in:
parent
22ec3c7993
commit
ba1fe77996
|
@ -411,6 +411,7 @@ export const realm_user_settings_defaults_labels = {
|
|||
}),
|
||||
|
||||
realm_presence_enabled: $t({defaultMessage: "Display availability to other users when online"}),
|
||||
realm_enter_sends: $t({defaultMessage: "Enter sends when composing a message"}),
|
||||
};
|
||||
|
||||
// NOTIFICATIONS
|
||||
|
|
|
@ -36,5 +36,18 @@ export function set_up() {
|
|||
);
|
||||
});
|
||||
|
||||
container.find(".enter_sends").on("change", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
const data = {enter_sends: container.find(".enter_sends").prop("checked")};
|
||||
settings_ui.do_settings_change(
|
||||
channel.patch,
|
||||
"/json/realm/user_settings_defaults",
|
||||
data,
|
||||
container.find(".other-setting-status").expectOne(),
|
||||
);
|
||||
});
|
||||
|
||||
maybe_disable_widgets();
|
||||
}
|
||||
|
|
|
@ -16,4 +16,14 @@
|
|||
help_link="/help/status-and-availability"
|
||||
prefix="realm_"}}
|
||||
</div>
|
||||
|
||||
<div class="form-horizontal" class="other_settings">
|
||||
<h3 class="inline-block">{{t "Other settings" }}</h3>
|
||||
<div class="alert-notification other-setting-status"></div>
|
||||
{{> settings_checkbox
|
||||
setting_name="enter_sends"
|
||||
is_checked=settings_object.enter_sends
|
||||
label=settings_label.realm_enter_sends
|
||||
prefix="realm_"}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -118,6 +118,7 @@ IGNORED_PHRASES = [
|
|||
# SPECIAL CASES
|
||||
# Enter is usually capitalized
|
||||
r"Press Enter to send",
|
||||
r"Send message on pressing Enter",
|
||||
# Because topics usually are lower-case, this would look weird if it were capitalized
|
||||
r"more topics",
|
||||
# For consistency with "more topics"
|
||||
|
|
Loading…
Reference in New Issue