mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	stream settings: Add name attr to settings elements.
				
					
				
			Add `name` attribute to stream settings `input` elements and change `id` attribute corresponding to name. `name` attribute stores value of settings name which is stored in frontend data sets.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							de1f4066ba
						
					
				
				
					commit
					1f5720d1b8
				
			@@ -124,7 +124,7 @@ run_test('update_property', () => {
 | 
			
		||||
    with_overrides(function (override) {
 | 
			
		||||
        override('stream_list.refresh_pinned_or_unpinned_stream', noop);
 | 
			
		||||
        stream_events.update_property(1, 'pin_to_top', true);
 | 
			
		||||
        checkbox = $('#pinstream-1');
 | 
			
		||||
        checkbox = $(".subscription_settings[data-stream-id='1'] #sub_pin_to_top_setting .sub_setting_control");
 | 
			
		||||
        assert.equal(checkbox.prop('checked'), true);
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ function update_stream_email_notifications(sub, value) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function update_stream_pin(sub, value) {
 | 
			
		||||
    var pin_checkbox = $('#pinstream-' + sub.stream_id);
 | 
			
		||||
    var pin_checkbox = $(".subscription_settings[data-stream-id='" + sub.stream_id + "'] #sub_pin_to_top_setting .sub_setting_control");
 | 
			
		||||
    pin_checkbox.prop('checked', value);
 | 
			
		||||
    sub.pin_to_top = value;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,7 @@
 | 
			
		||||
                <ul class="grey-box">
 | 
			
		||||
                    <li>
 | 
			
		||||
                        <div id="sub_is_muted_setting" class="sub_setting_checkbox sub-mute-setting">
 | 
			
		||||
                            <input id="mutestream-{{stream_id}}" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if is_muted}}checked{{/if}} />
 | 
			
		||||
                            <input id="is_muted_{{stream_id}}" name="is_muted" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if is_muted}}checked{{/if}} />
 | 
			
		||||
                            <label class="subscription-control-label">{{t "Mute stream" }}</label>
 | 
			
		||||
                            <p class="mute-note {{#unless is_muted}}hide-mute-note{{/unless}}">{{t "Muted streams don't show up in \"All messages\" or generate notifications unless you are mentioned." }}</p>
 | 
			
		||||
                        </div>
 | 
			
		||||
@@ -58,34 +58,34 @@
 | 
			
		||||
                    <li>
 | 
			
		||||
                        <div id="sub_desktop_notifications_setting"
 | 
			
		||||
                          class="sub_setting_checkbox sub_notification_setting {{#if is_muted}}muted-sub{{/if}}">
 | 
			
		||||
                            <input id="desktop-notifystream-{{stream_id}}" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if desktop_notifications_display}}checked{{/if}} {{#if is_muted}}disabled="disabled"{{/if}}/>
 | 
			
		||||
                            <input id="desktop_notifications_{{stream_id}}" name="desktop_notifications" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if desktop_notifications_display}}checked{{/if}} {{#if is_muted}}disabled="disabled"{{/if}}/>
 | 
			
		||||
                            <label class="subscription-control-label">{{t "Visual desktop notifications" }}</label>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </li>
 | 
			
		||||
                    <li>
 | 
			
		||||
                        <div id="sub_audible_notifications_setting"
 | 
			
		||||
                          class="sub_setting_checkbox sub_notification_setting {{#if is_muted}}muted-sub{{/if}}">
 | 
			
		||||
                            <input id="audible-notifystream-{{stream_id}}" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if audible_notifications_display}}checked{{/if}} {{#if is_muted}}disabled="disabled"{{/if}}/>
 | 
			
		||||
                            <input id="audible_notifications_{{stream_id}}" name="audible_notifications" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if audible_notifications_display}}checked{{/if}} {{#if is_muted}}disabled="disabled"{{/if}}/>
 | 
			
		||||
                            <label class="subscription-control-label">{{t "Audible desktop notifications" }}</label>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </li>
 | 
			
		||||
                    <li>
 | 
			
		||||
                        <div id="sub_push_notifications_setting"
 | 
			
		||||
                          class="sub_setting_checkbox sub_notification_setting {{#if is_muted}}muted-sub{{/if}}">
 | 
			
		||||
                            <input id="push-notifystream-{{stream_id}}" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if push_notifications_display}}checked{{/if}} {{#if is_muted}}disabled="disabled"{{/if}}/>
 | 
			
		||||
                            <input id="push_notifications_{{stream_id}}" name="push_notifications" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if push_notifications_display}}checked{{/if}} {{#if is_muted}}disabled="disabled"{{/if}}/>
 | 
			
		||||
                            <label class="subscription-control-label">{{t "Mobile notifications" }}</label>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </li>
 | 
			
		||||
                    <li>
 | 
			
		||||
                        <div id="sub_email_notifications_setting"
 | 
			
		||||
                          class="sub_setting_checkbox sub_notification_setting {{#if is_muted}}muted-sub{{/if}}">
 | 
			
		||||
                            <input id="email-notifystream-{{stream_id}}" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if email_notifications_display}}checked{{/if}} {{#if is_muted}}disabled="disabled"{{/if}}/>
 | 
			
		||||
                            <input id="email_notifications_{{stream_id}}" name="email_notifications" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if email_notifications_display}}checked{{/if}} {{#if is_muted}}disabled="disabled"{{/if}}/>
 | 
			
		||||
                            <label class="subscription-control-label">{{t "Email notifications" }}</label>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </li>
 | 
			
		||||
                    <li>
 | 
			
		||||
                        <div id="sub_pin_to_top_setting" class="sub_setting_checkbox">
 | 
			
		||||
                            <input id="pinstream-{{stream_id}}" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if pin_to_top}}checked{{/if}} />
 | 
			
		||||
                            <input id="pin_to_top_{{stream_id}}" name="pin_to_top" class="sub_setting_control" type="checkbox" tabindex="-1" {{#if pin_to_top}}checked{{/if}} />
 | 
			
		||||
                            <label class="subscription-control-label">{{t "Pin stream to top of left sidebar" }}</label>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </li>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user