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.

rendered_markdown: Update markdown timestamps to use Zulip icon.

Karl Stolleybee5cd4e04e2
diff --git a/web/src/info_overlay.ts b/web/src/info_overlay.ts
index 821bbfbc0a0..4a319efb219 100644
--- a/web/src/info_overlay.ts
+++ b/web/src/info_overlay.ts
@@ -158,7 +158,7 @@ def zulip():
{
markdown: "<time:2023-05-28T13:30:00+05:30>",
output_html:
- '<p><time datetime="2023-05-28T08:00:00Z"><i class="fa fa-clock-o"></i>Sun, May 28, 2023, 1:30 PM</time></p>',
+ '<p><time datetime="2023-05-28T08:00:00Z"><i class="zulip-icon zulip-icon-clock markdown-timestamp-icon"></i>Sun, May 28, 2023, 1:30 PM</time></p>',
},
{
markdown: `/poll What did you drink this morning?
diff --git a/web/styles/rendered_markdown.css b/web/styles/rendered_markdown.css
index aa0b82b0f0e..e51a758f613 100644
--- a/web/styles/rendered_markdown.css
+++ b/web/styles/rendered_markdown.css
@@ -225,7 +225,7 @@
white-space: nowrap;
margin: 0 2px 1px;
- .fa-clock-o {
+ .markdown-timestamp-icon {
align-self: center;
}
}
diff --git a/web/templates/markdown_timestamp.hbs b/web/templates/markdown_timestamp.hbs
index 8388615f0d1..85aa33c1894 100644
--- a/web/templates/markdown_timestamp.hbs
+++ b/web/templates/markdown_timestamp.hbs
@@ -1,2 +1,2 @@
-<i class="fa fa-clock-o"></i>
+<i class="zulip-icon zulip-icon-clock markdown-timestamp-icon"></i>
{{ text ~}}
diff --git a/web/tests/rendered_markdown.test.js b/web/tests/rendered_markdown.test.js
index 307cdf87f84..6074dfee9e3 100644
--- a/web/tests/rendered_markdown.test.js
+++ b/web/tests/rendered_markdown.test.js
@@ -424,7 +424,10 @@ run_test("timestamp", ({mock_template}) => {
rm.update_elements($content);
// Final asserts
- assert.equal($timestamp.html(), '<i class="fa fa-clock-o"></i>\nThu, Jan 1, 1970, 12:00 AM');
+ assert.equal(
+ $timestamp.html(),
+ '<i class="zulip-icon zulip-icon-clock markdown-timestamp-icon"></i>\nThu, Jan 1, 1970, 12:00 AM',
+ );
assert.equal($timestamp_invalid.text(), "never-been-set");
});
@@ -443,11 +446,17 @@ run_test("timestamp-twenty-four-hour-time", ({mock_template, override}) => {
// We will temporarily change the 24h setting for this test.
override(user_settings, "twenty_four_hour_time", true);
rm.update_elements($content);
- assert.equal($timestamp.html(), '<i class="fa fa-clock-o"></i>\nWed, Jul 15, 2020, 20:40');
+ assert.equal(
+ $timestamp.html(),
+ '<i class="zulip-icon zulip-icon-clock markdown-timestamp-icon"></i>\nWed, Jul 15, 2020, 20:40',
+ );
override(user_settings, "twenty_four_hour_time", false);
rm.update_elements($content);
- assert.equal($timestamp.html(), '<i class="fa fa-clock-o"></i>\nWed, Jul 15, 2020, 8:40 PM');
+ assert.equal(
+ $timestamp.html(),
+ '<i class="zulip-icon zulip-icon-clock markdown-timestamp-icon"></i>\nWed, Jul 15, 2020, 8:40 PM',
+ );
});
run_test("timestamp-error", () => {