Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
help: Tweak stream/group settings instructions for logged in users.
David Rosa91ddcd4e1d2d
diff --git a/help/change-the-color-of-a-stream.md b/help/change-the-color-of-a-stream.mdindex 8f7c79ef7b9..0221abd7a22 100644--- a/help/change-the-color-of-a-stream.md+++ b/help/change-the-color-of-a-stream.md@@ -23,7 +23,7 @@ stream. Changing a stream's color does not change it for anyone else.{start_tabs}-{relative|stream|subscribed}+{relative|gear|stream-settings}1. Select a stream.diff --git a/help/include/how-to-create-a-user-group.md b/help/include/how-to-create-a-user-group.mdindex d4eb64efd09..39c1f117e1e 100644--- a/help/include/how-to-create-a-user-group.md+++ b/help/include/how-to-create-a-user-group.md@@ -1,6 +1,6 @@{start_tabs}-{relative|group|all}+{relative|gear|group-settings}1. Click **Create user group** on the right, or click the **plus**(<i class="fa fa-plus"></i>) icon in the upper right.diff --git a/help/message-a-stream-by-email.md b/help/message-a-stream-by-email.mdindex 720dd975382..a060641f9c9 100644--- a/help/message-a-stream-by-email.md+++ b/help/message-a-stream-by-email.md@@ -24,7 +24,7 @@ API](/api/send-message).{start_tabs}-{relative|stream|subscribed}+{relative|gear|stream-settings}1. Select a stream.diff --git a/help/mute-a-stream.md b/help/mute-a-stream.mdindex 041f3ca8f47..5bc9eeb507b 100644--- a/help/mute-a-stream.md+++ b/help/mute-a-stream.md@@ -49,7 +49,7 @@{tab|desktop-web}-{relative|stream|subscribed}+{relative|gear|stream-settings}1. Select a stream.diff --git a/help/pin-a-stream.md b/help/pin-a-stream.mdindex e37c14a235e..0ebbe3bb768 100644--- a/help/pin-a-stream.md+++ b/help/pin-a-stream.md@@ -50,7 +50,7 @@ which is especially handy if you are subscribed to a large number of streams.{tab|desktop-web}-{relative|stream|subscribed}+{relative|gear|stream-settings}1. Select a stream.diff --git a/help/unsubscribe-from-a-stream.md b/help/unsubscribe-from-a-stream.mdindex f08eee56dfb..e5cb5f20e6a 100644--- a/help/unsubscribe-from-a-stream.md+++ b/help/unsubscribe-from-a-stream.md@@ -28,7 +28,7 @@ You can always unsubscribe from any stream in Zulip.{tab|desktop-web}-{relative|stream|subscribed}+{relative|gear|stream-settings}1. Click the **checkmark**(<img src="/static/images/help/desktop-web-check-icon.svg" alt="checkmark" class="help-center-icon"/>)diff --git a/zerver/lib/markdown/help_relative_links.py b/zerver/lib/markdown/help_relative_links.pyindex bb52d9e041f..24fa7a51a7f 100644--- a/zerver/lib/markdown/help_relative_links.py+++ b/zerver/lib/markdown/help_relative_links.py@@ -99,44 +99,46 @@ def help_handle_match(key: str) -> str:stream_info = {"all": ["All streams", "/#streams/all"],- "subscribed": ["Subscribed streams", "/#streams/subscribed"],}-stream_instructions_no_link = """+stream_all_instructions = """1. Click on the **gear** (<i class="zulip-icon zulip-icon-gear"></i>) icon inthe upper right corner of the web or desktop app.-1. Click <i class="zulip-icon zulip-icon-hash"></i> **Stream settings**.+1. Select <i class="zulip-icon zulip-icon-hash"></i> **Stream settings**.++1. Click {item} in the upper left."""def stream_handle_match(key: str) -> str:if relative_help_links:- return f"1. Go to [{stream_info[key][0]}]({stream_info[key][1]})."- if key == "all":- return stream_instructions_no_link + "\n\n1. Click **All streams** in the upper left."- return stream_instructions_no_link+ item = f"[{stream_info[key][0]}]({stream_info[key][1]})"+ else:+ item = f"**{stream_info[key][0]}**"+ return stream_all_instructions.format(item=item)group_info = {"all": ["All groups", "/#groups/all"],- "subscribed": ["Your groups", "/#groups/your"],}-group_instructions_no_link = """+group_all_instructions = """1. Click on the **gear** (<i class="zulip-icon zulip-icon-gear"></i>) icon inthe upper right corner of the web or desktop app.-1. Click <i class="zulip-icon zulip-icon-user-cog"></i> **Group settings**.+1. Select <i class="zulip-icon zulip-icon-user-cog"></i> **Group settings**.++1. Click {item} in the upper left."""def group_handle_match(key: str) -> str:if relative_help_links:- return f"1. Go to [{group_info[key][0]}]({group_info[key][1]})."- if key == "all":- return group_instructions_no_link + "\n\n1. Click **All groups** in the upper left."- return group_instructions_no_link+ item = f"[{group_info[key][0]}]({group_info[key][1]})"+ else:+ item = f"**{group_info[key][0]}**"+ return group_all_instructions.format(item=item)draft_instructions = """diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.pyindex 380ac05da77..d2c1b216481 100644--- a/zerver/tests/test_docs.py+++ b/zerver/tests/test_docs.py@@ -424,13 +424,19 @@ class HelpTest(ZulipTestCase):def test_help_relative_links_for_stream(self) -> None:result = self.client_get("/help/message-a-stream-by-email")- self.assertIn('<a href="/#streams/subscribed">Subscribed streams</a>', str(result.content))+ self.assertIn(+ '<a href="/#streams/subscribed"><i class="zulip-icon zulip-icon-hash"></i> Stream settings</a>',+ str(result.content),+ )self.assertEqual(result.status_code, 200)with self.settings(ROOT_DOMAIN_LANDING_PAGE=True):result = self.client_get("/help/message-a-stream-by-email", subdomain="")self.assertEqual(result.status_code, 200)- self.assertIn("<strong>Stream settings</strong>", str(result.content))+ self.assertIn(+ '<strong><i class="zulip-icon zulip-icon-hash"></i> Stream settings</strong>',+ str(result.content),+ )self.assertNotIn("/#streams", str(result.content))