Skip to content

Commit

Permalink
add link to javascript guide on read the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
biyeun committed Jan 23, 2024
1 parent 06091de commit 4e139e7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions corehq/apps/styleguide/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def get_navigation_context(current_page):
Page("Introduction", 'styleguide_home_b5'),
Page("Code Guidelines", 'styleguide_code_guidelines_b5'),
Page("Bootstrap Migration Guide", 'styleguide_migration_guide_b5'),
Page("Javascript Guide", 'styleguide_javascript_guide_b5'),
],
),
NavigationGroup(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% extends 'styleguide/bootstrap5/base.html' %}

{% block intro %}
<h1 class="sg-title mb-0" id="content">Javascript Guide</h1>
<p class="sg-lead">
How to use javascript on HQ.
</p>
{% endblock intro %}

{% block toc %}
<h5 class="my-2 ms-3">On this page</h5>
<hr class="my-2 ms-3">
<nav id="TableOfContents">
<ul>
<li>
<a href="#overview">Overview</a></li>
</ul>
</nav>
{% endblock toc %}

{% block content %}
<h2 id="overview">
Overview
</h2>
<p>
This Style Guide aims to be a good review of the visual components of our front-end, which includes CSS and javascript
from various libraries. For a more in-depth review of our JavaScript structure, organization, and processes,
please refer to the
<a href="https://commcare-hq.readthedocs.io/js-guide/README.html" target="_blank">Dimagi JavaScript Guide</a>.
</p>
{% endblock content %}
2 changes: 2 additions & 0 deletions corehq/apps/styleguide/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
name="styleguide_code_guidelines_b5"),
url(r'^b5/migration/$', bootstrap5.styleguide_migration_guide,
name="styleguide_migration_guide_b5"),
url(r'^b5/javascript/$', bootstrap5.styleguide_javascript_guide,
name="styleguide_javascript_guide_b5"),
url(r'^b5/atoms/accessibility/$', bootstrap5.styleguide_atoms_accessibility,
name="styleguide_atoms_accessibility_b5"),
url(r'^b5/atoms/typography/$', bootstrap5.styleguide_atoms_typography,
Expand Down
6 changes: 6 additions & 0 deletions corehq/apps/styleguide/views/bootstrap5.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ def styleguide_migration_guide(request):
get_navigation_context("styleguide_migration_guide_b5"))


@use_bootstrap5
def styleguide_javascript_guide(request):
return render(request, 'styleguide/bootstrap5/javascript_guide.html',
get_navigation_context("styleguide_javascript_guide_b5"))


@use_bootstrap5
def styleguide_atoms_accessibility(request):
return render(request, 'styleguide/bootstrap5/atoms/accessibility.html',
Expand Down

0 comments on commit 4e139e7

Please sign in to comment.