settings: Change "N minutes" options to Custom.

We change the various "Up to N minutes" settings option labels to
"Custom", since the N is a little too mathy for some users.

Since the new prompts for the value of N are longer, we need to move
those prompts to the next line. Mainly this means switching from
`dependent-inline-block` to `dependent-block`, but we also need to
move the block out of the containing input-group for the CSS to be
happy.

Substantially rewritten by tabbott to use CSS for positioning and
change the message deleting copy of this issue.

Fixes #20177.
This commit is contained in:
Archit Hadge 2021-11-07 15:12:11 +05:30 committed by Tim Abbott
parent 2d766f3e78
commit 25ccd4a7db
3 changed files with 34 additions and 34 deletions

View File

@ -345,7 +345,7 @@ const time_limit_dropdown_values = new Map([
[
"custom_limit",
{
text: $t({defaultMessage: "Up to N minutes after posting"}),
text: $t({defaultMessage: "Custom"}),
},
],
]);
@ -411,7 +411,7 @@ export const msg_delete_limit_dropdown_values = new Map([
[
"custom_limit",
{
text: $t({defaultMessage: "Up to N minutes after posting"}),
text: $t({defaultMessage: "Custom"}),
},
],
]);
@ -623,7 +623,7 @@ export const email_notifications_batching_period_values = [
},
{
value: "custom_period",
description: $t({defaultMessage: "N minutes"}),
description: $t({defaultMessage: "Custom"}),
},
];

View File

@ -129,9 +129,10 @@
<option value="{{ this.value }}">{{ this.description }}</option>
{{/each}}
</select>
<div class="dependent-inline-block">
</div>
<div class="dependent-block">
<label for="email_notification_batching_period_edit_minutes" class="inline-block">
{{t 'N' }}:
{{t 'Delay period (minutes)' }}:
</label>
<input type="text"
name="email_notification_batching_period_edit_minutes"
@ -140,7 +141,6 @@
autocomplete="off"
id="{{prefix}}email_notification_batching_period_edit_minutes"/>
</div>
</div>
{{#each notification_settings.email_message_notification_settings}}
{{> settings_checkbox

View File

@ -154,9 +154,10 @@
<option value="{{0}}">{{1.text}}</option>
{{/each}}
</select>
<div class="dependent-inline-block">
</div>
<div class="dependent-block">
<label for="id_realm_message_content_edit_limit_minutes" class="inline-block realm-time-limit-label">
{{t 'N' }}:
{{t 'Duration editing is allowed after posting (minutes)'}}:&nbsp;
</label>
<input type="text" id="id_realm_message_content_edit_limit_minutes"
name="realm_message_content_edit_limit_minutes"
@ -164,7 +165,6 @@
autocomplete="off"
value="{{ realm_message_content_edit_limit_minutes }}"/>
</div>
</div>
<div class="input-group">
<label for="realm_edit_topic_policy" class="dropdown-title">{{t "Who can edit the topic of any message" }}</label>
@ -200,9 +200,10 @@
<option value="{{0}}">{{1.text}}</option>
{{/each}}
</select>
<div class="dependent-inline-block">
</div>
<div class="dependent-block">
<label for="id_realm_message_content_delete_limit_minutes" class="inline-block realm-time-limit-label">
{{t 'N' }}:
{{t "Duration deletion is allowed after posting (minutes)" }}:
</label>
<input type="text" id="id_realm_message_content_delete_limit_minutes"
name="realm_message_content_delete_limit_minutes"
@ -210,7 +211,6 @@
autocomplete="off"
value="{{ realm_message_content_delete_limit_minutes }}"/>
</div>
</div>
<div class="input-group">
<label for="realm_move_messages_between_streams_policy">{{t "Who can move messages between streams" }}