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.

marketing_page: Clean up legacy portico header cruft.

Karl Stolley9d5f340c058e
diff --git a/web/src/bundles/legacy_portico_bundle.ts b/web/src/bundles/legacy_portico_bundle.ts
index c94210a91a3..8afd767572a 100644
--- a/web/src/bundles/legacy_portico_bundle.ts
+++ b/web/src/bundles/legacy_portico_bundle.ts
@@ -1,5 +1,5 @@
import "./common.ts";
-import "../portico/header.ts";
+import "../portico/legacy_header.ts";
import "../portico/google-analytics.ts";
import "../portico/portico_modals.ts";
import "../portico/tippyjs.ts";
diff --git a/web/src/portico/header.ts b/web/src/portico/header.ts
index 80440479d53..3874942456c 100644
--- a/web/src/portico/header.ts
+++ b/web/src/portico/header.ts
@@ -83,21 +83,4 @@ $(() => {
$(`#${CSS.escape(labelID)}`).trigger("click");
}
});
-
- /* Used by navbar of non-corporate URLs. */
- $(".portico-header li.logout").on("click", () => {
- $("#logout_form").trigger("submit");
- return false;
- });
-
- $(".portico-header .portico-header-dropdown").on("click", (e) => {
- const $user_dropdown = $(e.target).closest(".portico-header-dropdown");
- const dropdown_is_shown = $user_dropdown.hasClass("show");
-
- if (!dropdown_is_shown) {
- $user_dropdown.addClass("show");
- } else if (dropdown_is_shown) {
- $user_dropdown.removeClass("show");
- }
- });
});
diff --git a/web/src/portico/legacy_header.ts b/web/src/portico/legacy_header.ts
new file mode 100644
index 00000000000..59362d96756
--- /dev/null
+++ b/web/src/portico/legacy_header.ts
@@ -0,0 +1,20 @@
+import $ from "jquery";
+
+/* Used by pages that load the legacy navbar,
+ templates/zerver/portico-header.html */
+
+$(".portico-header li.logout").on("click", () => {
+ $("#logout_form").trigger("submit");
+ return false;
+});
+
+$(".portico-header .portico-header-dropdown").on("click", (e) => {
+ const $user_dropdown = $(e.target).closest(".portico-header-dropdown");
+ const dropdown_is_shown = $user_dropdown.hasClass("show");
+
+ if (!dropdown_is_shown) {
+ $user_dropdown.addClass("show");
+ } else if (dropdown_is_shown) {
+ $user_dropdown.removeClass("show");
+ }
+});
diff --git a/web/styles/portico/marketing_page.css b/web/styles/portico/marketing_page.css
index f402daa80e2..0707ef10493 100644
--- a/web/styles/portico/marketing_page.css
+++ b/web/styles/portico/marketing_page.css
@@ -65,12 +65,6 @@ html {
margin-bottom: 0;
}
-/* TODO: Remove this from the marketing-page templates instead
- of just hiding in CSS. */
-.header {
- display: none;
-}
-
.navbar.footer .nav {
> li {
line-height: 56px;
@@ -239,167 +233,11 @@ input.text-error {
display: block;
}
-.header-main {
- .logo {
- display: block;
- text-decoration: none;
- position: relative;
- line-height: 0.8;
-
- & svg {
- vertical-align: -5px;
- }
-
- & a,
- a:focus,
- a:hover {
- text-decoration: none;
- color: hsl(0deg 0% 20%);
- }
-
- .light {
- font-size: 1.2rem;
- font-weight: 400;
- color: hsl(0deg 0% 20%);
- opacity: 0.7;
- }
- }
-
- .portico-logo {
- height: 28px;
- width: auto;
- padding: 6px 0;
- }
-}
-
-.portico-header {
- .portico-header-dropdown {
- position: relative;
- display: inline-block;
-
- & ul {
- display: none;
- position: absolute;
- right: 0;
- margin: 10px 0 0;
- list-style-type: none;
- width: fit-content;
- background-color: hsl(0deg 0% 100%);
- padding: 5px 0;
- border-radius: 4px;
- border: 1px solid hsl(0deg 0% 87%);
- box-shadow: 0 2px 5px hsl(0deg 0% 0% / 10%);
-
- &::before {
- content: "\25B2";
- position: absolute;
- top: -4px;
- right: 9px;
- font-size: 0.5em;
- color: hsl(0deg 0% 87%);
- line-height: 0;
- transform: scale(1.8, 1);
- }
-
- & li {
- display: list-item;
- margin: 0;
- padding: 3px 10px;
- text-align: left;
- opacity: 1;
- cursor: pointer;
-
- &:hover {
- background-color: hsl(190deg 10% 90%);
- transition: none;
- }
-
- & a {
- display: block;
- margin: 2px 0;
- padding: 0;
- transition: none;
- font-size: 0.9em;
- font-weight: 400;
- color: hsl(0deg 0% 27%);
- }
-
- &:hover a {
- background-color: transparent;
- }
-
- & a i {
- margin-right: 5px;
- }
- }
-
- &.dropdown-list {
- margin-top: 3px;
- margin-right: 3px;
- }
- }
-
- &.show ul {
- display: block;
- }
- }
-
- .portico-header-dropdown-pill {
- border: 1px solid hsl(0deg 0% 0% / 20%);
- border-radius: 4px;
- margin-left: 10px;
- font-weight: 400;
- cursor: pointer;
-
- .realm-name {
- display: inline-block;
- vertical-align: top;
- margin: 0 5px 0 -4px;
- padding: 1px 0 1px 5px;
- font-size: 0.9em;
- font-weight: 600;
- line-height: 1.6;
- }
-
- .realm-name i.fa {
- position: relative;
- top: -2px;
- font-size: 0.6em;
- margin-left: 5px;
- opacity: 0.5;
- transition: opacity 0.2s ease;
- }
-
- &:hover .realm-name i.fa {
- opacity: 1;
- }
-
- .header-realm-icon {
- width: 26px;
- height: 26px;
- vertical-align: top;
- border-radius: 4px;
- }
- }
-}
-
-.portico-page-container .portico-header .dropdown-pill .realm-name {
- margin-left: -3px;
-}
-
.app {
width: 100%;
z-index: 99;
}
-.devlogin_subheader {
- margin-top: 10px;
- margin-bottom: 20px;
- padding-top: 0;
- text-align: center;
- font-size: 16px;
-}
-
.table.table-striped {
background-color: hsl(0deg 0% 100%);
box-shadow: 0 0 4px hsl(0deg 0% 0% / 10%);
@@ -591,22 +429,6 @@ input#terminal:checked ~ #tab-terminal {
}
}
-.login-page-header {
- width: 100%;
-}
-
-.login-page {
- text-align: center;
-
- .alert {
- width: 320px;
- margin: auto;
- margin-top: -30px;
- margin-bottom: 15px;
- text-align: center;
- }
-}
-
.register-form {
display: inline-block;
text-align: center;
@@ -954,12 +776,8 @@ input#terminal:checked ~ #tab-terminal {
}
}
- .app-main,
- .header-main {
- min-width: auto;
- }
-
.app-main {
+ min-width: auto;
padding: 0;
}
@@ -1059,15 +877,6 @@ input#terminal:checked ~ #tab-terminal {
display: block;
}
- .header {
- padding: 4px 0 6px;
- }
-
- .header-main {
- max-width: 100vw;
- padding: 0 10px;
- }
-
#skip-navigation {
left: 60px;
}
@@ -3176,33 +2985,6 @@ button {
}
}
- .portico-header .content > ul::before {
- content: "Zulip";
- display: block;
- margin-top: 25px;
- padding-top: 5px;
- margin-left: 10px;
-
- width: 100px;
- height: 40px;
-
- font-size: 1.5rem;
- line-height: 30px;
- text-align: right;
- color: hsl(0deg 0% 27%);
-
- background-size: 40px auto;
- background-image: url("../../images/zulip-logo.svg");
- background-repeat: no-repeat;
- }
-
- .portico-header .dropdown ul {
- width: 100%;
- height: auto;
- margin: 42px 0 0;
- font-size: 0.8em;
- }
-
.portico-landing.apps .main ul.sidebar {
display: block;
text-align: center;