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.

bottom_whitespace: Extract to a dedicated handlebars template.

Aman Agrawal06deeb323980
diff --git a/static/js/ui_init.js b/static/js/ui_init.js
index 11a0ea92228..6fd1e8f3f39 100644
--- a/static/js/ui_init.js
+++ b/static/js/ui_init.js
@@ -7,6 +7,7 @@ import * as fenced_code from "../shared/js/fenced_code";
import render_compose from "../templates/compose.hbs";
import render_edit_content_button from "../templates/edit_content_button.hbs";
import render_left_sidebar from "../templates/left_sidebar.hbs";
+import render_message_feed_bottom_whitespace from "../templates/message_feed_bottom_whitespace.hbs";
import render_message_feed_errors from "../templates/message_feed_errors.hbs";
import render_navbar from "../templates/navbar.hbs";
import render_right_sidebar from "../templates/right_sidebar.hbs";
@@ -147,6 +148,10 @@ function message_hover($message_row) {
$message_row.find(".edit_content").html(render_edit_content_button(args));
}
+function initialize_bottom_whitespace() {
+ $("#bottom_whitespace").html(render_message_feed_bottom_whitespace());
+}
+
function initialize_left_sidebar() {
const rendered_sidebar = render_left_sidebar({
is_guest: page_params.is_guest,
@@ -593,6 +598,7 @@ export function initialize_everything() {
// modules' initialization has not been audited for whether they
// expect DOM elements to always exist (As that did before these
// modules were migrated from Django templates to Handlebars).
+ initialize_bottom_whitespace();
initialize_left_sidebar();
initialize_right_sidebar();
initialize_compose_box();
diff --git a/static/templates/message_feed_bottom_whitespace.hbs b/static/templates/message_feed_bottom_whitespace.hbs
new file mode 100644
index 00000000000..a4e39a429eb
--- /dev/null
+++ b/static/templates/message_feed_bottom_whitespace.hbs
@@ -0,0 +1,7 @@
+<div class="bottom-messages-logo">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 773.12 773.12">
+ <circle cx="386.56" cy="386.56" r="386.56"/>
+ <path d="M566.66 527.25c0 33.03-24.23 60.05-53.84 60.05H260.29c-29.61 0-53.84-27.02-53.84-60.05 0-20.22 9.09-38.2 22.93-49.09l134.37-120c2.5-2.14 5.74 1.31 3.94 4.19l-49.29 98.69c-1.38 2.76.41 6.16 3.25 6.16h191.18c29.61 0 53.83 27.03 53.83 60.05zm0-281.39c0 20.22-9.09 38.2-22.93 49.09l-134.37 120c-2.5 2.14-5.74-1.31-3.94-4.19l49.29-98.69c1.38-2.76-.41-6.16-3.25-6.16H260.29c-29.61 0-53.84-27.02-53.84-60.05s24.23-60.05 53.84-60.05h252.54c29.61 0 53.83 27.02 53.83 60.05z"/>
+ </svg>
+</div>
+<div id="loading_newer_messages_indicator"></div>
diff --git a/templates/zerver/app/index.html b/templates/zerver/app/index.html
index 4a258c06235..310edcad7b5 100644
--- a/templates/zerver/app/index.html
+++ b/templates/zerver/app/index.html
@@ -193,13 +193,6 @@
<div id="mark_as_read_turned_off_banner" class="alert home-error-bar">
</div>
<div id="bottom_whitespace">
- <div class="bottom-messages-logo">
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 773.12 773.12">
- <circle cx="386.56" cy="386.56" r="386.56"/>
- <path d="M566.66 527.25c0 33.03-24.23 60.05-53.84 60.05H260.29c-29.61 0-53.84-27.02-53.84-60.05 0-20.22 9.09-38.2 22.93-49.09l134.37-120c2.5-2.14 5.74 1.31 3.94 4.19l-49.29 98.69c-1.38 2.76.41 6.16 3.25 6.16h191.18c29.61 0 53.83 27.03 53.83 60.05zm0-281.39c0 20.22-9.09 38.2-22.93 49.09l-134.37 120c-2.5 2.14-5.74-1.31-3.94-4.19l49.29-98.69c1.38-2.76-.41-6.16-3.25-6.16H260.29c-29.61 0-53.84-27.02-53.84-60.05s24.23-60.05 53.84-60.05h252.54c29.61 0 53.83 27.02 53.83 60.05z"/>
- </svg>
- </div>
- <div id="loading_newer_messages_indicator"></div>
</div>
</div>
</div>