Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[No QA] DRY up LHN for HelpDot #12310

Merged
merged 10 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/_data/hubs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- href: send-money
title: Send money
stages:
- href: workspaces
title: Workspaces
articles:
- href: The-Free-Plan
title: The Free Plan
- href: request-money
title: Request money
- href: other
title: Other
stages:
- href: Account-Management
title: Account-Management
roryabraham marked this conversation as resolved.
Show resolved Hide resolved
23 changes: 0 additions & 23 deletions docs/_includes/home-lhn.html

This file was deleted.

44 changes: 44 additions & 0 deletions docs/_includes/lhn-template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<ul class="lhn-items">
roryabraham marked this conversation as resolved.
Show resolved Hide resolved
<li class="home-link">
<div class="selected">Home</div>
roryabraham marked this conversation as resolved.
Show resolved Hide resolved
</li>

{% for hub in site.data.hubs %}
{% if hub.href == include.activeHub %}
<li>
<div class="icon-with-link selected">
<i class="fa-solid fa-angle-down icon"></i>
<span>{{ hub.title }}</span>
</div>
<ul class="nested-treeview">
{% for stage in hub.stages %}
<li>
<!-- Stages may have nested articles, or they may be just a single article. -->
{% if stage.articles %}
<a href="#{{ stage.href }}">{{ stage.title }}</a>
<ul>
{% for article in stage.articles %}
<li>
<a href="/articles/{{ hub.href }}/{{ article.href }}">
{{ article.title }}
</a>
</li>
{% endfor %}
</ul>
{% else %}
<a href="/articles/{{ hub.href }}/{{ stage.href }}">{{ stage.title }}</a>
{% endif %}
</li>
{% endfor %}
</ul>
</li>
{% else %}
<li>
<a href="/hubs/{{ hub.href }}" class="icon-with-link">
<i class="fa-solid fa-angle-right icon"></i>
{{ hub.title }}
</a>
</li>
{% endif %}
{% endfor %}
</ul>
34 changes: 0 additions & 34 deletions docs/_includes/other-lhn.html

This file was deleted.

31 changes: 0 additions & 31 deletions docs/_includes/request-money-lhn.html

This file was deleted.

40 changes: 0 additions & 40 deletions docs/_includes/send-money-lhn.html

This file was deleted.

118 changes: 56 additions & 62 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<!doctype html>
<html>

<head>
<meta charset="utf-8">
<title>Expensify Help</title>
Expand All @@ -16,82 +15,77 @@
<!-- SEO tags -->
{% seo %}
</head>

<body>

<!-- Show temporarily the "Coming Soon" page until the Expensify Help site is ready -->
{% if page.lhn_content == 'coming_soon' %}
{{ content }}
{% else %}
<div id="lhn">

<div id="lhn">
<div class="lhn-header">
<div id="header-button">
<i id="angle-up-icon" class="fa-solid fa-angle-up icon hide"></i>
<i id="bars-icon" class="fa-solid fa-bars icon"></i>
</div>
<img src="/assets/images/expensify-help.svg" class="logo" />
</div>

<div class="lhn-header">
<div id="header-button">
<i id="angle-up-icon" class="fa-solid fa-angle-up icon hide"></i>
<i id="bars-icon" class="fa-solid fa-bars icon"></i>
<!-- LHN content (Main navigation tree or Article TOC) -->
<div id="lhn-content">
{% case page.lhn_content %}
{% when "homepage" %}
{% include lhn-template.html %}
{% when "request-money" %}
{% include lhn-template.html activeHub="request-money" %}
{% when "send-money" %}
{% include lhn-template.html activeHub="send-money" %}
{% when "other" %}
{% include lhn-template.html activeHub="other" %}
{% else %}
<div id="back-button" class="icon-with-link">
<i class="fa-solid fa-angle-left icon"></i>
<div class="link">Back</div>
</div>
{% if page.lhn_content == nil %}
<span class="in-this-article">In this article</span>
<div class="article-toc"></div>
{% endif %}
{% endcase %}
</div>
<img src="/assets/images/expensify-help.svg" class="logo" />
</div>

<!-- LHN content (Main navigation tree or Article TOC) -->
<div id="lhn-content">
{% case page.lhn_content %}
{% when "homepage" %}
{% include home-lhn.html %}
{% when "request-money" %}
{% include request-money-lhn.html %}
{% when "send-money" %}
{% include send-money-lhn.html %}
{% when "other" %}
{% include other-lhn.html %}
{% else %}
<div id="back-button" class="icon-with-link">
<i class="fa-solid fa-angle-left icon"></i>
<div class="link">Back</div>
</div>
{% if page.lhn_content == nil %}
<span class="in-this-article">In this article</span>
<div class="article-toc"></div>
{% endif %}
{% endcase %}
<!-- Concierge button anchored at the bottom of the LHN (rendered on wider screens) -->
{% include floating-concierge-button.html id="floating-concierge-button-lhn" %}
</div>

<div id="content-area">

<!-- Concierge button anchored at the bottom of the LHN (rendered on wider screens) -->
{% include floating-concierge-button.html id="floating-concierge-button-lhn" %}
</div>

<div id="content-area">

<!-- Article title (only shown in article pages) -->
{% if page.lhn_content == nil %}
<h1 class="title">
{{ page.name | remove: '.md' | split: "-" | join: " " }}
</h1>
<!-- Article title (only shown in article pages) -->
{% if page.lhn_content == nil %}
<h1 class="title">
{{ page.name | remove: '.md' | split: "-" | join: " " }}
</h1>

<div class="article-toc-content article">
{{ content }}
</div>
{% else %}
<div class="article-toc-content lhn">
{{ content }}
</div>
{% endif %}
<div class="article-toc-content article">
{{ content }}
</div>
{% else %}
<div class="article-toc-content lhn">
{{ content }}
</div>
{% endif %}

<!-- Concierge button at the bottom of the page -->
<a class="card get-help" href="{{ CONCIERGE_CHAT_URL }}" target="_blank">
<div class="body">
<h3 class="title">Didn't find what you were looking for?</h3>
<p class="description">Concierge is here to answer all your questions.</p>
</div>
<div class="submit-button">
<button class="success">Send a message</button>
</div>
</a>
</div>
<!-- Concierge button at the bottom of the page -->
<a class="card get-help" href="{{ CONCIERGE_CHAT_URL }}" target="_blank">
<div class="body">
<h3 class="title">Didn't find what you were looking for?</h3>
<p class="description">Concierge is here to answer all your questions.</p>
</div>
<div class="submit-button">
<button class="success">Send a message</button>
</div>
</a>
</div>
{% endif %}

</body>

</html>