mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	temaplate: Separate stream and user group tabs in user profile modal.
We had stream and group tab inside a common div with class `subscription-group-list` due to this adding any info elements like alert boxes that were specific to one of them became difficult. To fix this we keep them in their own `.tabcontent` div. This change also makes the handling of display of different tabs a lot easier and cleans up unnecessary javascript code that was handling the display of common parent div of stream and group tab.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							775b8eb05f
						
					
				
				
					commit
					e10a315efd
				
			@@ -429,27 +429,16 @@ export function show_user_profile(user) {
 | 
				
			|||||||
            {label: $t({defaultMessage: "User groups"}), key: "groups-tab"},
 | 
					            {label: $t({defaultMessage: "User groups"}), key: "groups-tab"},
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        callback(name, key) {
 | 
					        callback(name, key) {
 | 
				
			||||||
            function hide_profile_tab() {
 | 
					            $(".tabcontent").hide();
 | 
				
			||||||
                $("#profile-tab").hide();
 | 
					            $("#" + key).show();
 | 
				
			||||||
                $(".subscription-group-list").show();
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            switch (name) {
 | 
					            switch (name) {
 | 
				
			||||||
                case "User groups":
 | 
					                case "User groups":
 | 
				
			||||||
                    hide_profile_tab();
 | 
					 | 
				
			||||||
                    $("#streams-tab").hide();
 | 
					 | 
				
			||||||
                    render_user_group_list(groups_of_user, user);
 | 
					                    render_user_group_list(groups_of_user, user);
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                case "Streams":
 | 
					                case "Streams":
 | 
				
			||||||
                    hide_profile_tab();
 | 
					 | 
				
			||||||
                    $("#groups-tab").hide();
 | 
					 | 
				
			||||||
                    render_user_stream_list(user_streams, user);
 | 
					                    render_user_stream_list(user_streams, user);
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                default:
 | 
					 | 
				
			||||||
                    // default is profile section
 | 
					 | 
				
			||||||
                    $(".subscription-group-list").hide();
 | 
					 | 
				
			||||||
                    break;
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            $("#" + key).show();
 | 
					 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -362,7 +362,8 @@ ul {
 | 
				
			|||||||
        margin-bottom: 20px;
 | 
					        margin-bottom: 20px;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    .subscription-group-list {
 | 
					    .subscription-group-list,
 | 
				
			||||||
 | 
					    .subscription-stream-list {
 | 
				
			||||||
        position: relative;
 | 
					        position: relative;
 | 
				
			||||||
        border: 1px solid hsl(0, 0%, 83%);
 | 
					        border: 1px solid hsl(0, 0%, 83%);
 | 
				
			||||||
        border-radius: 4px;
 | 
					        border-radius: 4px;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -64,12 +64,14 @@
 | 
				
			|||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            <div class="subscription-group-list">
 | 
					            <div class="tabcontent" id="streams-tab">
 | 
				
			||||||
                <div class="tabcontent" id="streams-tab">
 | 
					                <div class="subscription-stream-list">
 | 
				
			||||||
                    <table class="user-stream-list" data-empty="{{t 'No stream subscriptions.'}}"></table>
 | 
					                    <table class="user-stream-list" data-empty="{{t 'No stream subscriptions.'}}"></table>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                <div class="tabcontent" id="groups-tab">
 | 
					            <div class="tabcontent" id="groups-tab">
 | 
				
			||||||
 | 
					                <div class="subscription-group-list">
 | 
				
			||||||
                    <table class="user-group-list" data-empty="{{t 'No user group subscriptions.'}}"></table>
 | 
					                    <table class="user-group-list" data-empty="{{t 'No user group subscriptions.'}}"></table>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user