From 611f1f8fd20af1a138cceb1fcf94d8a8a4a8ac9e Mon Sep 17 00:00:00 2001 From: vinitS101 Date: Sat, 11 May 2019 23:14:27 +0530 Subject: [PATCH] left_sidebar: Add "+Add streams" to bottom of streamlist. Added a new button at the bottom of the stream list which redirects users to '/#streams/all' where they can create new streams or subscribe to new streams. The button is not visible to guests. Fixes #11642. --- static/styles/left-sidebar.scss | 11 ++++++++++- templates/zerver/app/left_sidebar.html | 3 +++ zerver/views/home.py | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/static/styles/left-sidebar.scss b/static/styles/left-sidebar.scss index 6a1ac00a30..d275cc1960 100644 --- a/static/styles/left-sidebar.scss +++ b/static/styles/left-sidebar.scss @@ -84,7 +84,7 @@ li.show-more-topics a { overflow: visible; /* The -1px here prevents the scrollbar from going above the top of the container */ margin-top: -1px; - margin-bottom: 18px; + margin-bottom: 10px; padding: 0; font-weight: normal; } @@ -140,6 +140,15 @@ li.show-more-topics a { background-color: hsl(120, 11%, 82%); } +#add-stream-link { + text-decoration: none; + margin-left: 10px; +} + +#add-stream-link i { + margin-right: 5px; +} + ul.filters { list-style-type: none; margin-left: 0px; diff --git a/templates/zerver/app/left_sidebar.html b/templates/zerver/app/left_sidebar.html index f2028063e9..eef11b2517 100644 --- a/templates/zerver/app/left_sidebar.html +++ b/templates/zerver/app/left_sidebar.html @@ -71,6 +71,9 @@
+ {% if show_add_streams %} + {{ _('Add streams') }} + {% endif %}
diff --git a/zerver/views/home.py b/zerver/views/home.py index f9e77d518a..632b6d3892 100644 --- a/zerver/views/home.py +++ b/zerver/views/home.py @@ -249,12 +249,14 @@ def home_real(request: HttpRequest) -> HttpResponse: statsd.incr('views.home') show_invites = True + show_add_streams = True # Some realms only allow admins to invite users if user_profile.realm.invite_by_admins_only and not user_profile.is_realm_admin: show_invites = False if user_profile.is_guest: show_invites = False + show_add_streams = False show_billing = False show_plans = False @@ -295,6 +297,7 @@ def home_real(request: HttpRequest) -> HttpResponse: 'pipeline': settings.PIPELINE_ENABLED, 'search_pills_enabled': settings.SEARCH_PILLS_ENABLED, 'show_invites': show_invites, + 'show_add_streams': show_add_streams, 'show_billing': show_billing, 'show_plans': show_plans, 'is_admin': user_profile.is_realm_admin,