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.

help: Add gear menu icons to relative links.

David Rosafa59d4f345d2
diff --git a/zerver/lib/markdown/help_relative_links.py b/zerver/lib/markdown/help_relative_links.py
index 4f72c524857..91f3613ac37 100644
--- a/zerver/lib/markdown/help_relative_links.py
+++ b/zerver/lib/markdown/help_relative_links.py
@@ -18,16 +18,25 @@ gear_info = {
# key is from REGEXP: `{relative|gear|key}`
# name is what the item is called in the gear menu: `Select **name**.`
# link is used for relative links: `Select [name](link).`
- "manage-streams": ["Manage streams", "/#streams/subscribed"],
- "settings": ["Personal Settings", "/#settings/profile"],
- "organization-settings": ["Organization settings", "/#organization/organization-profile"],
- "integrations": ["Integrations", "/integrations/"],
- "stats": ["Usage statistics", "/stats"],
- "plans": ["Plans and pricing", "/plans/"],
- "billing": ["Billing", "/billing/"],
- "keyboard-shortcuts": ["Keyboard shortcuts (?)", "/#keyboard-shortcuts"],
- "message-formatting": ["Message formatting", "/#message-formatting"],
- "search-filters": ["Search filters", "/#search-operators"],
+ "manage-streams": ['<i class="fa fa-exchange"></i> Manage streams', "/#streams/subscribed"],
+ "settings": ['<i class="fa fa-wrench"></i> Personal Settings', "/#settings/profile"],
+ "organization-settings": [
+ '<i class="fa fa-bolt"></i> Organization settings',
+ "/#organization/organization-profile",
+ ],
+ "integrations": ['<i class="fa fa-github"></i> Integrations', "/integrations/"],
+ "stats": ['<i class="fa fa-bar-chart"></i> Usage statistics', "/stats"],
+ "plans": ['<i class="fa fa-rocket"></i> Plans and pricing', "/plans/"],
+ "billing": ['<i class="fa fa-credit-card"></i> Billing', "/billing/"],
+ "keyboard-shortcuts": [
+ '<i class="fa fa-keyboard-o"></i> Keyboard shortcuts (?)',
+ "/#keyboard-shortcuts",
+ ],
+ "message-formatting": [
+ '<i class="fa fa-pencil"></i> Message formatting',
+ "/#message-formatting",
+ ],
+ "search-filters": ['<i class="fa fa-search"></i> Search filters', "/#search-operators"],
"about-zulip": ["About Zulip", "/#about-zulip"],
}
diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.py
index c1a490967cf..4ef513990c8 100644
--- a/zerver/tests/test_docs.py
+++ b/zerver/tests/test_docs.py
@@ -388,13 +388,18 @@ class HelpTest(ZulipTestCase):
def test_help_relative_links_for_gear(self) -> None:
result = self.client_get("/help/analytics")
- self.assertIn('<a href="/stats">Usage statistics</a>', str(result.content))
+ self.assertIn(
+ '<a href="/stats"><i class="fa fa-bar-chart"></i> Usage statistics</a>',
+ str(result.content),
+ )
self.assertEqual(result.status_code, 200)
with self.settings(ROOT_DOMAIN_LANDING_PAGE=True):
result = self.client_get("/help/analytics", subdomain="")
self.assertEqual(result.status_code, 200)
- self.assertIn("<strong>Usage statistics</strong>", str(result.content))
+ self.assertIn(
+ '<strong><i class="fa fa-bar-chart"></i> Usage statistics</strong>', str(result.content)
+ )
self.assertNotIn("/stats", str(result.content))
def test_help_relative_links_for_stream(self) -> None: