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.

landing_page: Restructure top-level navigation.

Eeshan Garg603652465110
diff --git a/static/js/portico/header.js b/static/js/portico/header.js
index 0418b9984dc..ad5f99a83d7 100644
--- a/static/js/portico/header.js
+++ b/static/js/portico/header.js
@@ -10,12 +10,38 @@ $(() => {
const $this = $(e.target);
if (
+ $this.closest(".dropdown .dropdown-label").length > 0 &&
+ !$this.closest("ul .dropdown").hasClass("show") &&
+ window.matchMedia("(max-width: 686px)").matches
+ ) {
+ $this.closest("ul .dropdown").addClass("show");
+ } else if (
$this.closest(".dropdown .dropdown-pill").length > 0 &&
- !$(".dropdown").hasClass("show")
+ !$this.closest("ul .dropdown").hasClass("show")
) {
- $(".dropdown").addClass("show");
+ $this.closest("ul .dropdown").addClass("show");
} else if (!$this.is(".dropdown ul") && $this.closest(".dropdown ul").length === 0) {
- $(".dropdown").removeClass("show");
+ $this.closest("ul .dropdown").removeClass("show");
+ }
+ });
+
+ $(".nav-dropdown").on("mouseover", (e) => {
+ const $this = $(e.target);
+ if (
+ !$this.closest("ul .dropdown").hasClass("show") &&
+ window.matchMedia("(min-width: 687px)").matches
+ ) {
+ $this.closest("ul .dropdown").addClass("show");
+ }
+ });
+
+ $(".nav-dropdown").on("mouseout", (e) => {
+ const $this = $(e.target);
+ if (
+ $this.closest("ul .dropdown").hasClass("show") &&
+ window.matchMedia("(min-width: 687px)").matches
+ ) {
+ $this.closest("ul .dropdown").removeClass("show");
}
});
});
diff --git a/static/styles/portico/landing_page.css b/static/styles/portico/landing_page.css
index d79c0528903..7a28e629003 100644
--- a/static/styles/portico/landing_page.css
+++ b/static/styles/portico/landing_page.css
@@ -287,7 +287,8 @@ nav {
user-select: none;
}
- li {
+ li,
+ div.dropdown-label {
position: relative;
display: inline-block;
margin: 10px;
@@ -311,6 +312,42 @@ nav {
transform: scaleX(2) scaleY(0.5);
}
}
+
+ i.fa-chevron-down {
+ position: relative;
+ top: -2px;
+ font-size: 0.6em;
+ margin-left: 5px;
+ transition: all 0.2s ease;
+ }
+ }
+ }
+
+ .nav-dropdown {
+ padding-bottom: 3px;
+ ul {
+ width: 300px;
+ }
+
+ @media (width > 686px) {
+ ul.product-options {
+ width: 125px;
+ }
+
+ ul.solutions-options {
+ width: 175px;
+ }
+
+ ul.resources-options {
+ width: 350px;
+
+ div.dropdown-column {
+ float: left;
+ &:first-of-type {
+ width: 40%;
+ }
+ }
+ }
}
}
@@ -3486,6 +3523,8 @@ nav {
transition: all 0.5s ease;
+ overflow-y: auto;
+
&.show {
transform: translate(0, 0);
}
@@ -3501,16 +3540,13 @@ nav {
color: initial;
}
- li {
+ li,
+ div.dropdown div.dropdown-label {
display: block;
font-size: 1.5em;
font-weight: 300;
line-height: 1.5;
- &:first-of-type {
- margin-top: 20px;
- }
-
&.active {
font-weight: 400;
@@ -3523,13 +3559,53 @@ nav {
}
}
}
+
+ div.dropdown div.dropdown-label.first {
+ margin-top: 30px;
+ }
+
+ div.dropdown ul.dropdown-list {
+ position: relative;
+ box-shadow: none;
+ padding-left: 10px;
+ border: none;
+
+ li {
+ &:hover {
+ background-color: unset;
+ }
+ }
+ }
+
+ .nav-dropdown {
+ ul.resources-options {
+ div.dropdown-column {
+ float: none;
+
+ &:first-child {
+ padding-bottom: 20px;
+ }
+
+ li.nav-header {
+ font-size: 1em;
+ }
+ }
+ }
+ }
+ }
+
+ &.portico-header {
+ div.content ul div.nav-dropdown {
+ display: block;
+ padding-bottom: 0;
+ }
}
}
.portico-header .content > ul::before {
content: "Zulip";
display: block;
- margin-top: 20px;
+ margin-top: 25px;
padding-top: 5px;
margin-left: 10px;
@@ -3555,6 +3631,7 @@ nav {
nav ul li,
nav ul li a,
+ nav ul div.dropdown div.dropdown-label,
.portico-header .dropdown-pill .realm-name {
color: hsl(0, 0%, 27%) !important;
}
diff --git a/static/styles/portico/portico.css b/static/styles/portico/portico.css
index d691ca8a93a..1e1d37ab71b 100644
--- a/static/styles/portico/portico.css
+++ b/static/styles/portico/portico.css
@@ -589,7 +589,7 @@ input.text-error {
right: 0;
margin: 10px 0 0 0;
list-style-type: none;
- width: 200px;
+ width: 300px;
background-color: hsl(0, 0%, 100%);
padding: 5px 0;
border-radius: 4px;
@@ -636,6 +636,16 @@ input.text-error {
a i {
margin-right: 5px;
}
+
+ &.nav-header {
+ background-color: transparent;
+ cursor: default;
+ }
+ }
+
+ &.dropdown-list {
+ margin-top: 3px;
+ margin-right: 3px;
}
}
diff --git a/templates/zerver/landing_nav.html b/templates/zerver/landing_nav.html
index 4ec53a908ef..d28c923b187 100644
--- a/templates/zerver/landing_nav.html
+++ b/templates/zerver/landing_nav.html
@@ -16,26 +16,94 @@
</a>
<ul>
<div class="exit">&times;</div>
- <li data-on-page="hello">
- <a href="/hello/">Home</a>
- </li>
- <li data-on-page="why-zulip">
- <a href="/why-zulip/">Why Zulip</a>
- </li>
- <li data-on-page="features">
- <a href="/features/">Features</a>
- </li>
+ <div class="dropdown nav-dropdown">
+ <div class="dropdown-label first">Product<i class="fa fa-chevron-down"></i></div>
+ <ul class="dropdown-list product-options">
+ <li>
+ <a href="/hello">Home</a>
+ </li>
+ <li>
+ <a href="/why-zulip">Why Zulip</a>
+ </li>
+ <li>
+ <a href="/features/">Features</a>
+ </li>
+ <li>
+ <a href="/security/">Security</a>
+ </li>
+ <li>
+ <a href="/integrations/">Integrations</a>
+ </li>
+ <li>
+ <a href="/api/">REST API</a>
+ </li>
+ </ul>
+ </div>
+ <div class="dropdown nav-dropdown">
+ <div class="dropdown-label">Solutions<i class="fa fa-chevron-down"></i></div>
+ <ul class="dropdown-list solutions-options">
+ <li>
+ <a href="/for/companies/">Companies</a>
+ </li>
+ <li>
+ <a href="/for/open-source/">Open source projects</a>
+ </li>
+ <li>
+ <a href="/for/working-groups-and-communities/">Working groups and communities</a>
+ </li>
+ </ul>
+ </div>
<li data-on-page="plans">
- <a href="/plans/">Plans</a>
+ <a href="/plans/">Pricing</a>
</li>
+ <div class="dropdown nav-dropdown">
+ <div class="dropdown-label">Resources<i class="fa fa-chevron-down"></i></div>
+ <ul class="dropdown-list resources-options">
+ <div class="dropdown-column">
+ <li class="nav-header">For users</li>
+ <li>
+ <a href="/help/getting-started-with-zulip">Getting started</a>
+ </li>
+ <li>
+ <a href="/help">Help center</a>
+ </li>
+ <li>
+ <a href="https://zulip.readthedocs.io/en/latest/contributing/chat-zulip-org.html" target=”_blank”>
+ Community chat
+ </a>
+ </li>
+ <li>
+ <a href="/help/contact-support">Contact support</a>
+ </li>
+ <li>
+ <a href="https://blog.zulip.com/">Blog</a>
+ </li>
+ </div>
+ <div class="dropdown-column">
+ <li class="nav-header">For administrators</li>
+ <li>
+ <a href="/help/getting-your-organization-started-with-zulip">
+ Setting up your organization
+ </a>
+ </li>
+ <li>
+ <a href="https://zulip.readthedocs.io/en/stable/production/install.html">
+ Installing a Zulip server
+ </a>
+ </li>
+ <li>
+ <a href="https://zulip.readthedocs.io/en/stable/production/upgrade-or-modify.html">
+ Upgrading a Zulip server
+ </a>
+ </li>
+ <li>
+ <a href="https://github.com/zulip/zulip" target="_blank" rel="noopener noreferer">GitHub</a>
+ </li>
+ </div>
+ </ul>
+ </div>
<li data-on-page="apps">
- <a href="{{ apps_page_url }}">Apps</a>
- </li>
- <li data-on-page="integrations">
- <a href="/integrations/">Integrations</a>
- </li>
- <li data-on-page="security">
- <a href="/security/">Security</a>
+ <a href="{{ apps_page_url }}">Download</a>
</li>
{% if user_is_authenticated %}
{% include 'zerver/portico-header-dropdown.html' %}
@@ -58,6 +126,9 @@
<li>
<a href="/accounts/find/">Find accounts</a>
</li>
+ <li>
+ <a href="/new">New organization</a>
+ </li>
{% endif %}
</ul>
<div class="clear-float"></div>
diff --git a/templates/zerver/portico-header-dropdown.html b/templates/zerver/portico-header-dropdown.html
index 0010d7be854..3906ad12a55 100644
--- a/templates/zerver/portico-header-dropdown.html
+++ b/templates/zerver/portico-header-dropdown.html
@@ -7,7 +7,7 @@
<li>
<a href="/">
<i class="fa fa-home"></i>
- Home
+ Go to app
</a>
</li>
<li class="logout">
diff --git a/templates/zerver/portico-header.html b/templates/zerver/portico-header.html
index 8bb315bd496..302a4800bdd 100644
--- a/templates/zerver/portico-header.html
+++ b/templates/zerver/portico-header.html
@@ -40,6 +40,16 @@
<a href="{{ url('register') }}">{{ _('Sign up') }}</a>
{% endif %}
{% endif %}
+
+ {% if find_team_link_disabled %}
+ {% else %}
+ <li>
+ <a href="{{ root_domain_uri }}/accounts/find/">Find accounts</a>
+ </li>
+ <li>
+ <a href="{{ root_domain_uri }}/new">New organization</a>
+ </li>
+ {% endif %}
</div>
</div>
</div>