Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

user_profile: Add links to group settings.

tnmkrca6e0ce8c82d
diff --git a/web/src/user_profile.js b/web/src/user_profile.js
index 6e357497811..58ff6711460 100644
--- a/web/src/user_profile.js
+++ b/web/src/user_profile.js
@@ -204,6 +204,8 @@ function format_user_group_list_item_html(group) {
return render_user_group_list_item({
group_id: group.id,
name: group.name,
+ group_edit_url: hash_util.group_edit_url(group),
+ is_guest: current_user.is_guest,
});
}
@@ -953,6 +955,10 @@ export function initialize() {
hide_user_profile();
});
+ $("body").on("click", "#user-profile-modal .group_list_item_link", () => {
+ hide_user_profile();
+ });
+
$("body").on("input", "#user-profile-streams-tab .stream-search", () => {
const $input = $("#user-profile-streams-tab .stream-search");
if ($input.val().trim().length > 0) {
diff --git a/web/templates/user_group_list_item.hbs b/web/templates/user_group_list_item.hbs
index 9973a58c7ca..b9378b5f263 100644
--- a/web/templates/user_group_list_item.hbs
+++ b/web/templates/user_group_list_item.hbs
@@ -1,5 +1,9 @@
<tr data-group-id="{{group_id}}">
<td class="group_list_item">
- {{name}}
+ {{#if is_guest}}
+ {{name}}
+ {{else}}
+ <a class="group_list_item_link" href="{{group_edit_url}}">{{name}}</a>
+ {{/if}}
</td>
</tr>