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.

team: Migrate loading template to Handlebars.

Anders Kaseorgb6e98ecf7a66
diff --git a/templates/corporate/team.html b/templates/corporate/team.html
index 7ad9e329f95..7cdc210f4db 100644
--- a/templates/corporate/team.html
+++ b/templates/corporate/team.html
@@ -130,12 +130,6 @@ contributors, and 97+ people with 100+ commits." %}
</div>
<!-- Compiled using lodash -->
- <script type="text/template" id="loading-template">
- <p class="tab-loading">
- Loading…
- </p>
- </script>
-
<script type="text/template" id="total-count-template">
<p class="contributor-count">
<%= contributor_count %> total contributors
diff --git a/web/src/portico/team.ts b/web/src/portico/team.ts
index 0d50070c8d0..b339f8e7513 100644
--- a/web/src/portico/team.ts
+++ b/web/src/portico/team.ts
@@ -4,6 +4,7 @@ import assert from "minimalistic-assert";
import "../templates.ts";
import render_contributors from "../../templates/team/contributors.hbs";
+import render_loading from "../../templates/team/loading.hbs";
// The list of repository names is duplicated here in order to provide
// a clear type for Contributor objects.
@@ -177,7 +178,7 @@ export default function render_tabs(contributors: Contributor[]): void {
continue;
}
// Set as the loading template for now, and load when clicked.
- $(`#tab-${CSS.escape(tab_name)} .contributors-grid`).html($("#loading-template").html());
+ $(`#tab-${CSS.escape(tab_name)} .contributors-grid`).html(render_loading());
$(`#${CSS.escape(tab_name)}`).on("click", () => {
if (!loaded_tabs.includes(tab_name)) {
diff --git a/web/templates/team/loading.hbs b/web/templates/team/loading.hbs
new file mode 100644
index 00000000000..89b2ad6f56c
--- /dev/null
+++ b/web/templates/team/loading.hbs
@@ -0,0 +1,3 @@
+<p class="tab-loading">
+ Loading…
+</p>