help: Add gear menu icons to relative links.

This commit is contained in:
David Rosa 2023-07-25 08:41:30 -05:00 committed by Tim Abbott
parent 195e5b8dc1
commit fa59d4f345
2 changed files with 26 additions and 12 deletions

View File

@ -18,16 +18,25 @@ gear_info = {
# key is from REGEXP: `{relative|gear|key}` # key is from REGEXP: `{relative|gear|key}`
# name is what the item is called in the gear menu: `Select **name**.` # name is what the item is called in the gear menu: `Select **name**.`
# link is used for relative links: `Select [name](link).` # link is used for relative links: `Select [name](link).`
"manage-streams": ["Manage streams", "/#streams/subscribed"], "manage-streams": ['<i class="fa fa-exchange"></i> Manage streams', "/#streams/subscribed"],
"settings": ["Personal Settings", "/#settings/profile"], "settings": ['<i class="fa fa-wrench"></i> Personal Settings', "/#settings/profile"],
"organization-settings": ["Organization settings", "/#organization/organization-profile"], "organization-settings": [
"integrations": ["Integrations", "/integrations/"], '<i class="fa fa-bolt"></i> Organization settings',
"stats": ["Usage statistics", "/stats"], "/#organization/organization-profile",
"plans": ["Plans and pricing", "/plans/"], ],
"billing": ["Billing", "/billing/"], "integrations": ['<i class="fa fa-github"></i> Integrations', "/integrations/"],
"keyboard-shortcuts": ["Keyboard shortcuts (?)", "/#keyboard-shortcuts"], "stats": ['<i class="fa fa-bar-chart"></i> Usage statistics', "/stats"],
"message-formatting": ["Message formatting", "/#message-formatting"], "plans": ['<i class="fa fa-rocket"></i> Plans and pricing', "/plans/"],
"search-filters": ["Search filters", "/#search-operators"], "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"], "about-zulip": ["About Zulip", "/#about-zulip"],
} }

View File

@ -388,13 +388,18 @@ class HelpTest(ZulipTestCase):
def test_help_relative_links_for_gear(self) -> None: def test_help_relative_links_for_gear(self) -> None:
result = self.client_get("/help/analytics") 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) self.assertEqual(result.status_code, 200)
with self.settings(ROOT_DOMAIN_LANDING_PAGE=True): with self.settings(ROOT_DOMAIN_LANDING_PAGE=True):
result = self.client_get("/help/analytics", subdomain="") result = self.client_get("/help/analytics", subdomain="")
self.assertEqual(result.status_code, 200) 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)) self.assertNotIn("/stats", str(result.content))
def test_help_relative_links_for_stream(self) -> None: def test_help_relative_links_for_stream(self) -> None: