Skip to content

Commit 68aff5e

Browse files
Dan new footer (#1148)
1 parent 785815d commit 68aff5e

File tree

13 files changed

+238
-48
lines changed

13 files changed

+238
-48
lines changed

pgml-dashboard/src/api/docs.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,12 @@ async fn render<'a>(
237237
if user.is_some() {
238238
layout.user(&user.unwrap());
239239
}
240+
240241
let layout = layout
241242
.nav_title(nav_title)
242243
.nav_links(&nav_links)
243-
.toc_links(&toc_links);
244+
.toc_links(&toc_links)
245+
.footer(cluster.context.marketing_footer.to_string());
244246

245247
Ok(ResponseOk(
246248
layout.render(crate::templates::Article { content: html }),

pgml-dashboard/src/components/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ pub use postgres_logo::PostgresLogo;
5858
pub mod profile_icon;
5959
pub use profile_icon::ProfileIcon;
6060

61+
// src/components/sections
62+
pub mod sections;
63+
6164
// src/components/star
6265
pub mod star;
6366
pub use star::Star;
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
div[data-controller="sections-footers-marketing-footer"] {
2+
3+
font-size: 18px;
4+
line-height: 24px; /* 133.333% */
5+
6+
.main-container {
7+
padding: 1rem 0rem;
8+
@include media-breakpoint-up(md) {
9+
padding: 3.5rem 6rem;
10+
}
11+
}
12+
13+
.footer-title {
14+
color: #{$gray-500};
15+
text-transform: uppercase;
16+
min-width: 18rem;
17+
}
18+
19+
.nav-link {
20+
color: #{$gray-100};
21+
border-bottom: 1px solid transparent;
22+
padding: 0px;
23+
width: fit-content;
24+
25+
&:hover {
26+
color: #{$slate-shade-100};
27+
border-bottom: 1px solid #{$slate-shade-100};
28+
path.alt-fill {
29+
fill: #{$slate-shade-100};
30+
}
31+
}
32+
33+
&:active {
34+
@include bold_by_shadow(#{$slate-tint-700});
35+
color: #{$slate-tint-700};
36+
border-bottom: 1px solid transparent;
37+
path.alt-fill {
38+
@include bold_by_shadow(#{$slate-tint-700});
39+
fill: #{$slate-tint-700};
40+
}
41+
}
42+
43+
&.disabled, &:disabled:hover, &:disabled:focus, &:disabled, &:disabled:active {
44+
color: #{$gray-300};
45+
border-bottom: 1px solid transparent;
46+
}
47+
}
48+
49+
.coming-soon {
50+
color: #{$gray-300};
51+
font-size: 12px;
52+
line-height: 24px;
53+
}
54+
55+
.rights {
56+
color: #{$gray-100};
57+
font-size: 14px;
58+
line-height: 150%; /* 21px */
59+
}
60+
61+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
use crate::components::static_nav_link::StaticNavLink;
2+
use pgml_components::component;
3+
use pgml_components::Component;
4+
use sailfish::TemplateOnce;
5+
6+
#[derive(TemplateOnce, Default)]
7+
#[template(path = "sections/footers/marketing_footer/template.html")]
8+
pub struct MarketingFooter {
9+
solutions: Vec<StaticNavLink>,
10+
resources: Vec<StaticNavLink>,
11+
company: Vec<StaticNavLink>,
12+
}
13+
14+
impl MarketingFooter {
15+
pub fn new() -> MarketingFooter {
16+
MarketingFooter {
17+
solutions: vec![
18+
StaticNavLink::new("Overview".into(), "/docs/guides/".into()),
19+
StaticNavLink::new("Chatbot".into(), "/chatbot".into()),
20+
StaticNavLink::new("Site Search".into(), "/search".into()).disabled(true),
21+
StaticNavLink::new("Fraud Detection".into(), "/fraud".into()).disabled(true),
22+
StaticNavLink::new("Forecasting".into(), "/forecasting".into()).disabled(true),
23+
],
24+
resources: vec![
25+
StaticNavLink::new("Documentation".into(), "/docs/guides/".into()),
26+
StaticNavLink::new(
27+
"Blog".into(),
28+
"/blog/speeding-up-vector-recall-by-5x-with-hnsw".into(),
29+
),
30+
],
31+
company: vec![StaticNavLink::new(
32+
"Contact".into(),
33+
"mailto:team@postgresml.org".into(),
34+
)],
35+
}
36+
}
37+
38+
pub fn solutions(mut self, solutions: Vec<StaticNavLink>) -> MarketingFooter {
39+
self.solutions = solutions;
40+
self
41+
}
42+
43+
pub fn resources(mut self, resources: Vec<StaticNavLink>) -> MarketingFooter {
44+
self.resources = resources;
45+
self
46+
}
47+
48+
pub fn company(mut self, company: Vec<StaticNavLink>) -> MarketingFooter {
49+
self.company = company;
50+
self
51+
}
52+
}
53+
54+
component!(MarketingFooter);
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<div data-controller="sections-footers-marketing-footer">
2+
<div class="container-fluid main-container">
3+
<div class="container mb-5">
4+
<h5 class="h5 d-flex align-items-center gap-2 mb-5">
5+
<img src="/dashboard/static/images/owl_gradient.svg" alt="PostgresML Logo" height="30" width="21">
6+
<span>Postgres<span class="fw-semibold">ML</span></span>
7+
</h5>
8+
9+
<div class="d-flex flex-wrap w-100 row-gap-4">
10+
<% if solutions.len() > 0 || resources.len() > 0 {%>
11+
<div class="d-flex flex-wrap flex-grow-1 justify-content-around nav row-gap-4">
12+
<% if solutions.len() > 0 { %>
13+
<div class="d-flex flex-column flex-grow-1 gap-3">
14+
<p class="footer-title fw-semibold m-0">solutions</p>
15+
<% for link in solutions { %>
16+
<a class="nav-link <% if link.disabled {%> disabled<% } %>" <% if !link.disabled {%> href="<%- link.href %>" <% } %>><%- link.name %> <%if link.disabled {%><span class="coming-soon">(coming soon!)</span><% } %></a>
17+
<% } %>
18+
</div>
19+
<% } %>
20+
21+
<% if resources.len() > 0 { %>
22+
<div class="d-flex flex-column flex-grow-1 gap-3">
23+
<p class="footer-title fw-semibold m-0">Resources</p>
24+
<% for link in resources { %>
25+
<div>
26+
<a class="nav-link" href="<%- link.href %>"><%- link.name %></a>
27+
</div>
28+
<% } %>
29+
</div>
30+
<% } %>
31+
</div>
32+
<% } %>
33+
34+
<div class="d-flex flex-wrap flex-grow-1 justify-content-around nav row-gap-4">
35+
<% if company.len() > 0 { %>
36+
<div class="d-flex flex-column flex-grow-1 gap-3">
37+
<p class="footer-title fw-semibold m-0 m-0">Company</p>
38+
<% for link in company { %>
39+
<a class="nav-link" href="<%- link.href %>"><%- link.name %></a>
40+
<% } %>
41+
</div>
42+
<% } %>
43+
44+
<div class="d-flex flex-column flex-grow-1 gap-3">
45+
<p class="footer-title fw-semibold m-0">Community</p>
46+
<a class="nav-link d-flex gap-2 align-items-center" href="https://github.com/postgresml/postgresml">
47+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
48+
<path class="alt-fill" fill-rule="evenodd" clip-rule="evenodd" d="M9.00745 0C4.02656 0 0 4.12498 0 9.22815C0 13.3074 2.57996 16.7604 6.15904 17.9825C6.60652 18.0744 6.77043 17.7839 6.77043 17.5396C6.77043 17.3257 6.75568 16.5924 6.75568 15.8283C4.25002 16.3784 3.72824 14.7283 3.72824 14.7283C3.32557 13.6588 2.72893 13.3839 2.72893 13.3839C1.90883 12.8186 2.78867 12.8186 2.78867 12.8186C3.69837 12.8797 4.17572 13.7658 4.17572 13.7658C4.98089 15.1713 6.27833 14.7742 6.8003 14.5297C6.87478 13.9338 7.11355 13.5213 7.36706 13.2922C5.36863 13.0783 3.26602 12.2838 3.26602 8.73915C3.26602 7.73078 3.6237 6.90578 4.19047 6.26416C4.10105 6.03504 3.7878 5.0876 4.28008 3.81955C4.28008 3.81955 5.04062 3.57505 6.75549 4.76679C7.48969 4.56479 8.24686 4.46203 9.00745 4.46117C9.76799 4.46117 10.5433 4.56823 11.2592 4.76679C12.9743 3.57505 13.7348 3.81955 13.7348 3.81955C14.2271 5.0876 13.9137 6.03504 13.8242 6.26416C14.4059 6.90578 14.7489 7.73078 14.7489 8.73915C14.7489 12.2838 12.6463 13.0629 10.6329 13.2922C10.9611 13.5824 11.2443 14.1324 11.2443 15.0033C11.2443 16.2408 11.2295 17.234 11.2295 17.5394C11.2295 17.7839 11.3936 18.0744 11.8409 17.9827C15.42 16.7602 18 13.3074 18 9.22815C18.0147 4.12498 13.9734 0 9.00745 0Z" fill="white"/>
49+
</svg>
50+
GitHub
51+
</a>
52+
<a class="nav-link d-flex gap-2 align-items-center" href="https://discord.gg/DmyJP3qJ7U">
53+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="16" viewBox="0 0 18 16" fill="none">
54+
<path class="alt-fill" d="M15.2477 1.96647C14.0651 1.3912 12.8166 0.983085 11.5342 0.752548C11.3587 1.08587 11.1999 1.42882 11.0585 1.77995C9.69244 1.56123 8.30325 1.56123 6.93721 1.77995C6.79571 1.42885 6.63693 1.08591 6.46151 0.752548C5.17825 0.985032 3.92895 1.39412 2.74514 1.96948C0.394983 5.66391 -0.242108 9.26657 0.0764374 12.8181C1.45275 13.8985 2.99324 14.7202 4.63094 15.2474C4.9997 14.7205 5.326 14.1614 5.60639 13.5762C5.07383 13.3649 4.55982 13.1042 4.07029 12.797C4.19913 12.6978 4.32513 12.5955 4.44689 12.4962C5.87128 13.2079 7.42593 13.5769 8.99997 13.5769C10.574 13.5769 12.1287 13.2079 13.5531 12.4962C13.6762 12.603 13.8022 12.7053 13.9296 12.797C13.4392 13.1047 12.9242 13.3659 12.3907 13.5777C12.6708 14.1627 12.9971 14.7212 13.3662 15.2474C15.0053 14.7223 16.5469 13.901 17.9235 12.8196C18.2973 8.70097 17.285 5.1314 15.2477 1.96647ZM6.00988 10.6339C5.1222 10.6339 4.38884 9.77801 4.38884 8.72504C4.38884 7.67207 5.09672 6.80863 6.00705 6.80863C6.91739 6.80863 7.64509 7.67207 7.62951 8.72504C7.61394 9.77801 6.91456 10.6339 6.00988 10.6339ZM11.9901 10.6339C11.101 10.6339 10.3704 9.77801 10.3704 8.72504C10.3704 7.67207 11.0783 6.80863 11.9901 6.80863C12.9018 6.80863 13.6238 7.67207 13.6083 8.72504C13.5927 9.77801 12.8947 10.6339 11.9901 10.6339Z" fill="white"/>
55+
</svg>
56+
Discord
57+
</a>
58+
<a class="nav-link d-flex gap-2 align-items-center" href="https://twitter.com/postgresml">
59+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="20" viewBox="0 0 18 20" fill="none">
60+
<g clip-path="url(#clip0_625_83)">
61+
<path class="alt-fill" d="M10.7124 8.58676L17.4133 0.797501H15.8254L10.0071 7.56081L5.35992 0.797501H0L7.02738 11.0248L0 19.1931H1.58799L7.73237 12.0508L12.6401 19.1931H18L10.7121 8.58676H10.7124ZM8.53747 11.1149L7.82546 10.0965L2.16017 1.99292H4.59922L9.17118 8.53278L9.8832 9.55118L15.8262 18.052H13.3871L8.53747 11.1153V11.1149Z" fill="white"/>
62+
</g>
63+
<defs>
64+
<clipPath id="clip0_625_83">
65+
<rect width="18" height="18.405" fill="white" transform="translate(0 0.797501)"/>
66+
</clipPath>
67+
</defs>
68+
</svg>
69+
70+
</a>
71+
<a class="nav-link d-flex gap-2 align-items-center" href="https://www.youtube.com/@postgresml">
72+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="14" viewBox="0 0 18 14" fill="none">
73+
<path class="alt-fill" d="M17.6236 2.66743C17.4162 1.89249 16.8072 1.2835 16.0323 1.07606C14.6291 0.699701 9 0.699701 9 0.699701C9 0.699701 3.37093 0.699701 1.96773 1.07606C1.19279 1.2835 0.5838 1.89249 0.376358 2.66743C1.41308e-07 4.07063 0 7 0 7C0 7 1.41308e-07 9.92937 0.376358 11.3326C0.5838 12.1075 1.19279 12.7165 1.96773 12.9239C3.37093 13.3003 9 13.3003 9 13.3003C9 13.3003 14.6291 13.3003 16.0323 12.9239C16.8072 12.7165 17.4162 12.1075 17.6236 11.3326C18 9.92937 18 7 18 7C18 7 17.9985 4.07063 17.6236 2.66743Z" fill="white"/>
74+
<path d="M7.19819 9.69985V4.30044L11.8745 7.00014L7.19819 9.69985Z" fill="#282828"/>
75+
</svg>
76+
YouTube
77+
</a>
78+
<a class="nav-link d-flex gap-2 align-items-center" href="https://www.linkedin.com/company/postgresml">
79+
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
80+
<path class="alt-fill" fill-rule="evenodd" clip-rule="evenodd" d="M2 0H16C17.1046 0 18 0.89543 18 2V16C18 17.1046 17.1046 18 16 18H2C0.89543 18 0 17.1046 0 16V2C0 0.89543 0.89543 0 2 0ZM4.99995 14.9999C5.2761 14.9999 5.49995 14.7761 5.49995 14.4999V7.49994C5.49995 7.2238 5.2761 6.99994 4.99995 6.99994H3.49995C3.22381 6.99994 2.99995 7.2238 2.99995 7.49994V14.4999C2.99995 14.7761 3.22381 14.9999 3.49995 14.9999H4.99995ZM4.25002 5.99995C3.42159 5.99995 2.75002 5.32838 2.75002 4.49995C2.75002 3.67153 3.42159 2.99995 4.25002 2.99995C5.07844 2.99995 5.75002 3.67153 5.75002 4.49995C5.75002 5.32838 5.07844 5.99995 4.25002 5.99995ZM14.4999 15C14.7761 15 14.9999 14.7761 14.9999 14.5V9.9C15.0324 8.31078 13.8575 6.95452 12.2799 6.76C11.177 6.65925 10.1082 7.17441 9.49994 8.1V7.5C9.49994 7.22386 9.27608 7 8.99994 7H7.49994C7.2238 7 6.99994 7.22386 6.99994 7.5V14.5C6.99994 14.7761 7.2238 15 7.49994 15H8.99994C9.27608 15 9.49994 14.7761 9.49994 14.5V10.75C9.49994 9.92158 10.1715 9.25 10.9999 9.25C11.8284 9.25 12.4999 9.92158 12.4999 10.75V14.5C12.4999 14.7761 12.7238 15 12.9999 15H14.4999Z" fill="#FBFBFB"/>
81+
</svg>
82+
LinkedIn
83+
</a>
84+
</div>
85+
</div>
86+
</div>
87+
</div>
88+
89+
<div class="container">
90+
<p class="rights d-flex justify-content-center justify-content-sm-start">PostgresML 2023 Ⓒ All rights reserved.</p>
91+
</div>
92+
</div>
93+
</div>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// This file is automatically generated.
2+
// You shouldn't modify it manually.
3+
4+
// src/components/sections/footers/marketing_footer
5+
pub mod marketing_footer;
6+
pub use marketing_footer::MarketingFooter;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// This file is automatically generated.
2+
// You shouldn't modify it manually.
3+
4+
// src/components/sections/footers
5+
pub mod footers;

pgml-dashboard/src/guards.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
use std::env::var;
22

3+
use crate::components::sections::footers::marketing_footer::MarketingFooter;
34
use crate::templates::components::{StaticNav, StaticNavLink};
45
use once_cell::sync::OnceCell;
56
use rocket::http::Status;
67
use rocket::request::{self, FromRequest, Request};
8+
use sailfish::TemplateOnce;
79
use sqlx::{postgres::PgPoolOptions, Executor, PgPool};
810

911
static POOL: OnceCell<PgPool> = OnceCell::new();
@@ -138,6 +140,7 @@ impl Cluster {
138140
],
139141
},
140142
lower_left_nav: StaticNav::default(),
143+
marketing_footer: MarketingFooter::new().render_once().unwrap(),
141144
},
142145
}
143146
}

pgml-dashboard/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub mod types;
2121
pub mod utils;
2222

2323
use guards::{Cluster, ConnectedCluster};
24+
use pgml_components::Component;
2425
use responses::{BadRequest, Error, ResponseOk};
2526
use templates::{
2627
components::{NavLink, StaticNav},
@@ -47,6 +48,7 @@ pub struct Context {
4748
pub account_management_nav: StaticNav,
4849
pub upper_left_nav: StaticNav,
4950
pub lower_left_nav: StaticNav,
51+
pub marketing_footer: String,
5052
}
5153

5254
#[get("/projects")]

pgml-dashboard/src/templates/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ pub struct Layout {
3535
pub nav_title: Option<String>,
3636
pub nav_links: Vec<docs::NavLink>,
3737
pub toc_links: Vec<docs::TocLink>,
38+
pub footer: String,
3839
}
3940

4041
impl Layout {
@@ -87,6 +88,11 @@ impl Layout {
8788
self.content = Some(template.render_once().unwrap());
8889
(*self).clone().into()
8990
}
91+
92+
pub fn footer(&mut self, footer: String) -> &mut Self {
93+
self.footer = footer;
94+
self
95+
}
9096
}
9197

9298
impl From<Layout> for String {

pgml-dashboard/static/css/modules.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
@import "../../src/components/navigation/tabs/tab/tab.scss";
2020
@import "../../src/components/navigation/tabs/tabs/tabs.scss";
2121
@import "../../src/components/postgres_logo/postgres_logo.scss";
22+
@import "../../src/components/sections/footers/marketing_footer/marketing_footer.scss";
2223
@import "../../src/components/star/star.scss";
2324
@import "../../src/components/static_nav/static_nav.scss";
2425
@import "../../src/components/tables/large/row/row.scss";

pgml-dashboard/templates/layout/base.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
<% include!("nav/toc.html"); %>
2323
</div>
2424
</div>
25+
<%- footer %>
2526
</div>
2627

27-
<% include!("footer.html"); %>
2828
</main>
2929

3030
<div id="toast-container" class="toast-container position-fixed top-0 end-0 p-3"></div>

pgml-dashboard/templates/layout/footer.html

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)