org settings: Make time limit input elements inline to dropdown.

(To make the capitalization pass we added `N` to ignored phrases.)
This commit is contained in:
Shubham Dhama 2018-05-02 22:32:51 +05:30 committed by Tim Abbott
parent b4bd299a34
commit ec4e5e73ab
5 changed files with 39 additions and 29 deletions

View File

@ -220,7 +220,7 @@ exports.setup_time_limit_dropdown_values = function () {
seconds: 7*24*60*60,
},
custom_limit: {
text: i18n.t("Custom time limit after posting"),
text: i18n.t("Up to N minutes after posting"),
},
};
exports.msg_edit_limit_dropdown_values = time_limit_dropdown_values;

View File

@ -337,6 +337,11 @@ td .button {
margin: -5px 0 15px 35px;
}
.dependent-inline-block {
display: inline-block;
margin: 0 0 0 10px !important;
}
.no-margin {
margin: 0px;
}
@ -606,11 +611,15 @@ input[type=checkbox].inline-block {
margin-top: -10px;
}
.admin-realm-message-content-edit-limit-minutes {
#settings_page .admin-realm-time-limit-input {
width: 5ch;
text-align: right;
}
#settings_page .realm-time-limit-label {
vertical-align: middle;
}
.admin-realm-message-content-delete-limit-minutes {
width: 5ch;
text-align: right;
@ -1380,8 +1389,7 @@ input[type=checkbox].inline-block {
#id_realm_create_stream_permission,
#id_realm_org_join_restrictions,
#id_realm_bot_creation_policy,
#id_realm_user_invite_restriction,
#id_realm_msg_edit_limit_setting {
#id_realm_user_invite_restriction {
width: 100%;
}

View File

@ -74,7 +74,7 @@
<label for="aitin" class="inline-block">{{t "Minimum account age (N)" }}:</label>
<input type="text" id="id_realm_waiting_period_threshold"
name="realm_waiting_period_threshold"
class="admin-realm-message-content-edit-limit-minutes"
class="admin-realm-time-limit-input"
value="{{ realm_waiting_period_threshold }}"/>
</div>

View File

@ -17,16 +17,15 @@
<option value="{{@key}}">{{this.text}}</option>
{{/each}}
</select>
</div>
<div class="dependent-block">
<label for="id_realm_message_content_edit_limit_minutes" class="inline-block">
{{t 'Time limit in minutes after posting' }}:
</label>
<input type="text" id="id_realm_message_content_edit_limit_minutes"
name="realm_message_content_edit_limit_minutes"
class="admin-realm-message-content-edit-limit-minutes"
value="{{ realm_message_content_edit_limit_minutes }}"/>
<div class="dependent-inline-block">
<label for="id_realm_message_content_edit_limit_minutes" class="inline-block realm-time-limit-label">
{{t 'N' }}:
</label>
<input type="text" id="id_realm_message_content_edit_limit_minutes"
name="realm_message_content_edit_limit_minutes"
class="admin-realm-time-limit-input"
value="{{ realm_message_content_edit_limit_minutes }}"/>
</div>
</div>
{{partial "settings_checkbox"
@ -36,24 +35,25 @@
"label" admin_settings_label.realm_allow_community_topic_editing}}
<div class="input-group">
<label for="realm_msg_delete_limit_setting" class="inline-block dropdown-title">{{t "Allow message deleting" }}</label>
<i class="icon-vector-info-sign settings-info-icon realm_allow_message_deleting_tooltip" data-toggle="tooltip"
title="{{t 'Administrators can always delete any message.' }}"/>
<select name="realm_msg_delete_limit_setting" class="block" id="id_realm_msg_delete_limit_setting">
<label for="realm_msg_delete_limit_setting" class="dropdown-title">
{{t "Allow message deleting" }}
<i class="icon-vector-info-sign settings-info-icon realm_allow_message_deleting_tooltip" data-toggle="tooltip"
title="{{t 'Administrators can always delete any message.' }}"/>
</label>
<select name="realm_msg_delete_limit_setting" id="id_realm_msg_delete_limit_setting">
{{#each msg_delete_limit_dropdown_values}}
<option value="{{@key}}">{{this.text}}</option>
{{/each}}
</select>
</div>
<div class="dependent-block">
<label for="id_realm_message_content_delete_limit_minutes" class="inline-block">
{{t 'Time limit in minutes after posting' }}:
</label>
<input type="text" id="id_realm_message_content_delete_limit_minutes"
name="realm_message_content_delete_limit_minutes"
class="admin-realm-message-content-edit-limit-minutes"
value="{{ realm_message_content_delete_limit_minutes }}"/>
<div class="dependent-inline-block">
<label for="id_realm_message_content_delete_limit_minutes" class="inline-block realm-time-limit-label">
{{t 'N' }}:
</label>
<input type="text" id="id_realm_message_content_delete_limit_minutes"
name="realm_message_content_delete_limit_minutes"
class="admin-realm-time-limit-input"
value="{{ realm_message_content_delete_limit_minutes }}"/>
</div>
</div>
{{partial "settings_checkbox"

View File

@ -108,6 +108,8 @@ IGNORED_PHRASES = [
r"^marketing$",
r"^cookie$",
r"^new_emoji$",
# Used to refer custom time limits
r"\bN\b",
# TO CLEAN UP
# Just want to avoid churning login.html right now