Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
home: Send rendered realm description for spectators.
Aman Agrawalc396c2f7a4c1
diff --git a/static/js/ui_init.js b/static/js/ui_init.jsindex 16890bf2d32..b6e09ba77ae 100644--- a/static/js/ui_init.js+++ b/static/js/ui_init.js@@ -62,6 +62,7 @@ import * as realm_playground from "./realm_playground";import * as realm_user_settings_defaults from "./realm_user_settings_defaults";import * as recent_topics_util from "./recent_topics_util";import * as reload from "./reload";+import * as rendered_markdown from "./rendered_markdown";import * as resize from "./resize";import * as rows from "./rows";import * as scroll_bar from "./scroll_bar";@@ -158,6 +159,11 @@ function initialize_right_sidebar() {});$("#right-sidebar-container").html(rendered_sidebar);+ if (page_params.is_spectator) {+ rendered_markdown.update_elements(+ $(".right-sidebar .realm-description .rendered_markdown"),+ );+ }$("#user_presences").on("mouseenter", ".user_sidebar_entry", (e) => {const status_emoji = $(e.target).closest(".user_sidebar_entry").find("img.status_emoji");diff --git a/static/styles/right_sidebar.css b/static/styles/right_sidebar.cssindex e667205955b..6fd1e76fad4 100644--- a/static/styles/right_sidebar.css+++ b/static/styles/right_sidebar.css@@ -253,9 +253,4 @@width: 100%;margin-bottom: 10px;}-- ul,- ol {- margin-left: 0;- }}diff --git a/static/templates/right_sidebar.hbs b/static/templates/right_sidebar.hbsindex d48d9a34a76..966f5a44ee7 100644--- a/static/templates/right_sidebar.hbs+++ b/static/templates/right_sidebar.hbs@@ -31,7 +31,7 @@</a><div class="only-visible-for-spectators"><div class="realm-description">- <p>{{ realm_description }}</p>+ <div class="rendered_markdown">{{rendered_markdown realm_description }}</div><a href="/register" class="signup_button color_animated_button"><i class="fa fa-pencil-square-o"></i><span>{{t 'Sign up' }}</span>diff --git a/zerver/lib/home.py b/zerver/lib/home.pyindex 1bfaa574d38..6a17cb1890f 100644--- a/zerver/lib/home.py+++ b/zerver/lib/home.py@@ -15,6 +15,7 @@ from zerver.lib.i18n import (get_language_list,get_language_translation_data,)+from zerver.lib.realm_description import get_realm_rendered_descriptionfrom zerver.lib.request import RequestNotesfrom zerver.models import Message, Realm, Stream, UserProfilefrom zerver.views.message_flags import get_latest_update_message_flag_activity@@ -239,4 +240,9 @@ def build_page_params_for_home_page_load(page_params["translation_data"] = get_language_translation_data(request_language)+ if user_profile is None:+ # Get rendered version of realm description which is displayed in right+ # sidebar for spectator.+ page_params["realm_description"] = get_realm_rendered_description(realm)+return register_ret["queue_id"], page_params