create stream: Show current user on top of "People to add" list

Fixes #7475
This commit is contained in:
YJDave
2017-11-26 17:27:03 +05:30
committed by showell
parent 76511449f1
commit ffe3776b5f
2 changed files with 6 additions and 5 deletions

View File

@@ -164,9 +164,6 @@ function create_stream() {
var is_invite_only = $('#stream_creation_form input[name=privacy]:checked').val() === "invite-only";
var principals = get_principals();
// You are always subscribed to streams you create.
principals.push(people.my_current_email());
created_stream = stream_name;
var announce = (!!page_params.notifications_stream &&
@@ -218,8 +215,12 @@ exports.new_stream_clicked = function (stream_name) {
exports.show_new_stream_modal = function () {
$("#stream-creation").removeClass("hide");
$(".right .settings").hide();
var all_users = people.get_rest_of_realm();
// Add current user on top of list
all_users.unshift(people.get_person_from_user_id(page_params.user_id));
$('#people_to_add').html(templates.render('new_stream_users', {
users: people.get_rest_of_realm(),
users: all_users,
streams: stream_data.get_streams_for_settings_page(),
}));

View File

@@ -30,7 +30,7 @@
<div id="user-checkboxes">
{{#each users}}
<label class="checkbox add-user-label" data-user-id="{{this.user_id}}" data-email="{{this.email}}">
<input type="checkbox" name="user" value="{{this.email}}" />
<input type="checkbox" name="user" value="{{this.email}}" {{#if @first}}checked="checked"{{/if}}/>
<span></span>
{{this.full_name}} ({{this.email}})
</label>