Skip to content

Commit

Permalink
Update header and footer
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Nov 17, 2023
1 parent a388ab5 commit 48cc0be
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 28 deletions.
76 changes: 76 additions & 0 deletions daras_ai_v2/footer_widget.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import gooey_ui as st

DISCORD_LOGO = """
<svg stroke="currentColor" fill="currentColor" stroke-width="2" viewBox="0 0 640 512"
style="width: 18px; height: 16px; margin-bottom: 1px; padding-bottom: 1px;"
xmlns="http://www.w3.org/2000/svg">
<path d="M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"></path>
</svg>
"""

FOOTER_CONTENT = {
"GET STARTED": [
("Home", "/"),
("Explore Workflows", "/explore/"),
("Sign In / Your Account", "/account/"),
("Pricing", "/pricing"),
],
"LEARN": [
("Docs", "/docs"),
("Blog", "/blog/"),
("FAQ", "/faq/"),
("Videos", "https://www.youtube.com/@gooeyAI"),
],
"DEVELOPERS": [
("How to Guides", "/docs/"),
("Get a Gooey.AI Key", "/docs/developer-resources/api-reference"),
("GitHub", "https://github.com/GooeyAI"),
("API Endpoints", "https://api.gooey.ai/docs#operation"),
],
"SOCIAL": [
("LinkedIn", "https://in.linkedin.com/company/gooeyai"),
("Twitter/X", "https://twitter.com/GooeyAI"),
("Insta", "https://www.instagram.com/gooeyai/"),
],
"CONNECT": [
("[email protected]", "mailto:[email protected]"),
(f"{DISCORD_LOGO} Discord", "https://discord.com/invite/7C84UyzVDg"),
("Book a Demo", "https://www.help.gooey.ai/contact#book-demo"),
],
"EXTRAS": [
("Team", "/team"),
("Jobs", "/jobs"),
("Privacy", "/privacy"),
("Terms", "/terms"),
],
}


def footer():
with st.div(className="w-100 mt-5 pt-5 bg-light gui-footer"):
with st.div(className="container"):
columns = st.columns(len(FOOTER_CONTENT))
for (title, links), st_col in zip(FOOTER_CONTENT.items(), columns):
with st_col:
render_column(title, links)

with center(className="mt-5"):
st.caption("©2023 by Gooey.AI / Dara.network Inc")


def render_column(title, links):
st.write(f"###### {title}")
for content, to in links:
target = "_blank" if to.startswith("http") else False
with st.link(to=to, target=target):
custom_caption(content)


def custom_caption(content):
with st.tag("p", className="text-muted mb-0"):
st.html(content)


def center(**props):
className = props.pop("className", "") + " text-center"
return st.div(className=className, **props)
3 changes: 2 additions & 1 deletion routers/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
)
from daras_ai_v2.copy_to_clipboard_button_widget import copy_to_clipboard_scripts
from daras_ai_v2.db import FIREBASE_SESSION_COOKIE
from daras_ai_v2.footer_widget import footer
from daras_ai_v2.meta_content import build_meta_tags, raw_build_meta_tags
from daras_ai_v2.query_params_util import extract_query_params
from daras_ai_v2.settings import templates
Expand Down Expand Up @@ -334,5 +335,5 @@ def page_wrapper(request: Request, render_fn: typing.Callable, **kwargs):
with st.div(id="main-content", className="container"):
render_fn(**kwargs)

st.html(templates.get_template("footer.html").render(**context))
footer()
st.html(templates.get_template("login_scripts.html").render(**context))
15 changes: 0 additions & 15 deletions templates/footer.html

This file was deleted.

17 changes: 5 additions & 12 deletions templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,15 @@
class="img-fluid logo" alt="img">
</a>
<div class="mt-2 gap-2 d-flex justify-content-md-end flex-grow-1 justify-content-evenly flex-wrap align-items-center">
<a class="pe-2" href="/">Home</a>
<a data-internal-link class="pe-2" href="/explore/">Explore</a>
<a class="pe-2" href="/docs/">Docs</a>
<a class="pe-2" href="/blog/">Blog</a>
{% if not request.user %}
<a href="https://help.gooey.ai/pricing/">Pricing</a>
<a class="pe-2" href="https://help.gooey.ai/pricing/">Pricing</a>
{% endif %}
<a class="pe-2" href="https://help.gooey.ai/learn">Learn</a>
<span class="pe-2">
<svg stroke="currentColor" fill="currentColor" stroke-width="2" viewBox="0 0 640 512"
style="width: 18px; height: 16px; margin-bottom: 1px; padding-bottom: 1px;"
xmlns="http://www.w3.org/2000/svg">
<path d="M524.531,69.836a1.5,1.5,0,0,0-.764-.7A485.065,485.065,0,0,0,404.081,32.03a1.816,1.816,0,0,0-1.923.91,337.461,337.461,0,0,0-14.9,30.6,447.848,447.848,0,0,0-134.426,0,309.541,309.541,0,0,0-15.135-30.6,1.89,1.89,0,0,0-1.924-.91A483.689,483.689,0,0,0,116.085,69.137a1.712,1.712,0,0,0-.788.676C39.068,183.651,18.186,294.69,28.43,404.354a2.016,2.016,0,0,0,.765,1.375A487.666,487.666,0,0,0,176.02,479.918a1.9,1.9,0,0,0,2.063-.676A348.2,348.2,0,0,0,208.12,430.4a1.86,1.86,0,0,0-1.019-2.588,321.173,321.173,0,0,1-45.868-21.853,1.885,1.885,0,0,1-.185-3.126c3.082-2.309,6.166-4.711,9.109-7.137a1.819,1.819,0,0,1,1.9-.256c96.229,43.917,200.41,43.917,295.5,0a1.812,1.812,0,0,1,1.924.233c2.944,2.426,6.027,4.851,9.132,7.16a1.884,1.884,0,0,1-.162,3.126,301.407,301.407,0,0,1-45.89,21.83,1.875,1.875,0,0,0-1,2.611,391.055,391.055,0,0,0,30.014,48.815,1.864,1.864,0,0,0,2.063.7A486.048,486.048,0,0,0,610.7,405.729a1.882,1.882,0,0,0,.765-1.352C623.729,277.594,590.933,167.465,524.531,69.836ZM222.491,337.58c-28.972,0-52.844-26.587-52.844-59.239S193.056,219.1,222.491,219.1c29.665,0,53.306,26.82,52.843,59.239C275.334,310.993,251.924,337.58,222.491,337.58Zm195.38,0c-28.971,0-52.843-26.587-52.843-59.239S388.437,219.1,417.871,219.1c29.667,0,53.307,26.82,52.844,59.239C470.715,310.993,447.538,337.58,417.871,337.58Z"></path>
</svg>
<a href="{{ settings.DISCORD_INVITE_URL }}" target="_blank">Connect</a>
</span>
<a class="pe-2" href="https://help.gooey.ai/contact/">Contact</a>
{% include 'login_container.html' %}
</div>
</div>
</nav>
</div>
</div>

0 comments on commit 48cc0be

Please sign in to comment.