help: Stop collapsing sidebar sections.

Three reasons:

1. The sliding was disorienting.
2. The collapsing disallowed searching for other pages with Ctrl+F.
3. The collapsing mechanism wasn't accessible (not usable with the
   keyboard / no ARIA tags).

Tweaked by tabbott to center the left sidebar on the selected page.

Part of #15948.
This commit is contained in:
Gittenburg
2020-07-28 22:48:50 +02:00
committed by Tim Abbott
parent 49d0d7f3cc
commit 87d8a54b91
3 changed files with 3 additions and 16 deletions

View File

@@ -91,14 +91,11 @@ class MarkdownDirectoryView(ApiURLView):
context["page_is_help_center"] = True
context["doc_root"] = "/help/"
(sidebar_index, http_status_ignored) = self.get_path("include/sidebar_index")
# We want the sliding/collapsing behavior for /help pages only
sidebar_class = "sidebar slide"
title_base = "Zulip Help Center"
else:
context["page_is_api_center"] = True
context["doc_root"] = "/api/"
(sidebar_index, http_status_ignored) = self.get_path("sidebar_index")
sidebar_class = "sidebar"
title_base = "Zulip API Documentation"
# The following is a somewhat hacky approach to extract titles from articles.
@@ -118,7 +115,6 @@ class MarkdownDirectoryView(ApiURLView):
context["OPEN_GRAPH_DESCRIPTION"] = self.request.placeholder_open_graph_description
context["sidebar_index"] = sidebar_index
context["sidebar_class"] = sidebar_class
# An "article" might require the api_uri_context to be rendered
api_uri_context: Dict[str, Any] = {}
add_api_uri_context(api_uri_context, self.request)