Skip to content

Commit

Permalink
(refactor) port remaining flavors to static site build
Browse files Browse the repository at this point in the history
- convert index.html templates to Handlebars
- merge language_picker.html template into index.html
- convert en locale code to en-us in configs
- remove duplicate config keys
  • Loading branch information
goldpbear committed Aug 22, 2017
1 parent a8d2297 commit 9639435
Show file tree
Hide file tree
Showing 39 changed files with 194 additions and 401 deletions.
5 changes: 1 addition & 4 deletions src/flavors/bogtobay/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ languages:
- code: es
label: Hablo Español

- code: en
- code: en-us
label: I Speak English


Expand All @@ -48,13 +48,11 @@ map:
# map layer loading

- id: osm
type: basemap
url: //api.tiles.mapbox.com/v4/heyduwamishcore.3fd2d9aa/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiaGV5ZHV3YW1pc2hjb3JlIiwiYSI6ImNpaTEyNDNtdjAwMG10OW0wYzFtYmlsZXgifQ.yfrIdudUO9j_lKNtTZQU-g
attribution: '<a href="/page/terms">Terms and conditions</a> &copy; OpenStreetMap contributors, CC-BY-SA. <a href="//mapbox.com/about/maps" target="_blank">Mapbox</a>. Geocoding Courtesy of <a href="//www.mapquest.com/" target="_blank">MapQuest</a> <img src="//developer.mapquest.com/content/osm/mq_logo.png">.'
type: basemap

- id: satellite
type: basemap
url: //api.tiles.mapbox.com/v4/smartercleanup.pe3o4gdn/{z}/{x}/{y}.png?access_token=pk.eyJ1Ijoic21hcnRlcmNsZWFudXAiLCJhIjoiTnFhUWc2cyJ9.CqPJH-9yspIMudowQJx2Uw
attribution: '&copy; OpenStreetMap contributors, CC-BY-SA. <a href="//mapbox.com/about/maps" target="_blank">Terms &amp; Feedback</a>. Geocoding Courtesy of <a href="//www.mapquest.com/" target="_blank">MapQuest</a> <img src="//developer.mapquest.com/content/osm/mq_logo.png">.'
type: basemap
Expand Down Expand Up @@ -678,7 +676,6 @@ place:
# Labels for the buttons that toggle the map and list views
show_list_button_label: _(See All Reports)
show_map_button_label: _(Show the Map)
action_text: _(added)
title: _(New post)
action_text: _(created)
anonymous_name: _(Someone)
Expand Down
43 changes: 28 additions & 15 deletions src/flavors/bogtobay/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,41 @@
{% extends 'base.html' %}
{% load i18n %}
{{#extends "../../../base/templates/base"}}

{% block site-title %}
{{#block "site-title"}}
<a href="/">
<img src="{{STATIC_URL}}css/images/bogtobay-logo-large.png" />
<img src="{{STATIC_URL}}css/images/bogtobay-logo-large.png" alt="{{ config.app.name }}" />
</a>
{% endblock %}
{{/block}}

<!--
This will place content at the top of the side bar
-->
{% block sidebar %}
{% endblock %}
{{#block "language_picker"}}
<div id="language-picker">
<nav class="access" role="article">
<ul class="menu">
<li class="menu-item">
<a class="current-language {{ LANGUAGE_CODE }} btn btn-block">Español</a>
<ul class="menu">
{{#each config.languages}}
<li class="menu-item">
<a href="/{{this.code}}/index.html" class="{{ this.code }} btn btn-block">{{ this.label }}</a>
</li>
{{/each}}
</ul>
</li>
</ul>
</nav>
</div>
{{/block}}

<!--
This will place content in the colophon below the map
-->
{% block colophon %}
{{#block "colophon"}}
<p id="powered-by">{% blocktrans %}Powered by{% endblocktrans %} <a href="//shareabouts.org/" class="shareabouts-logo" target="_blank">Shareabouts</a>, <span class="nobreak">a project of <a href="//openplans.org/" class="openplans-logo" target="_blank">OpenPlans</a></span></p>
{% endblock %}
{{/block}}

<!--
Analytics, custom JS, and such go here
-->

{% block includes %}
{{#block "includes"}}
<!--<script src="{{STATIC_URL}}js/views/commitment-view.js"></script>-->
<script>
(function(S) {
Expand All @@ -35,4 +46,6 @@
})
}(Shareabouts));
</script>
{% endblock %}
{{/block}}

{{/extends}}
25 changes: 0 additions & 25 deletions src/flavors/bogtobay/templates/language_picker.html

This file was deleted.

2 changes: 1 addition & 1 deletion src/flavors/central-puget-sound/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ languages:
- code: es
label: Hablo Español

- code: en
- code: en-us
label: I Speak English

# - code: vi
Expand Down
34 changes: 22 additions & 12 deletions src/flavors/central-puget-sound/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
{{#extends "../../../base/templates/base.hbs"}}
<!--
{{#load i18n }}
-->
{{#block site-title}}
{{#extends "../../../base/templates/base"}}

{{#block "site-title"}}
<a href="/page/about" rel="internal">{{ config.app.name }}</a>
{{/block}}

<!--
This will place content at the top of the side bar
-->
{{#block sidebar}}
{{#block "language_picker"}}
<div id="language-picker">
<nav class="access" role="article">
<ul class="menu">
<li class="menu-item">
<a class="current-language {{ LANGUAGE_CODE }} btn btn-block">Español</a>
<ul class="menu">
{{#each config.languages}}
<li class="menu-item">
<a href="/{{this.code}}/index.html" class="{{ this.code }} btn btn-block">{{ this.label }}</a>
</li>
{{/each}}
</ul>
</li>
</ul>
</nav>
</div>
{{/block}}

<!--
This will place content in the colophon below the map
-->
{{#block colophon}}
{{#block "colophon"}}
<p id="powered-by">{{#_}}Powered by{{/_}} <a href="//shareabouts.org/" class="shareabouts-logo" target="_blank">Shareabouts</a>, <span class="nobreak">a project of <a href="//openplans.org/" class="openplans-logo" target="_blank">OpenPlans</a></span></p>
{{/block}}

<!--
Analytics, custom JS, and such go here
-->

{{#block includes}}
<!--<script src="{{STATIC_URL}}js/views/commitment-view.js"></script>-->
{{#block "includes"}}
<script>
(function(S) {
// ========================================
Expand Down
25 changes: 0 additions & 25 deletions src/flavors/central-puget-sound/templates/language_picker.html

This file was deleted.

2 changes: 1 addition & 1 deletion src/flavors/defaultflavor/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ app:
# list_enabled: false

# languages:
# - code: en
# - code: en-us
# label: I Speak English

# - code: es
Expand Down
26 changes: 15 additions & 11 deletions src/flavors/defaultflavor/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
{% extends 'base.html' %}
{% load i18n %}
{{#extends "../../../base/templates/base"}}

{% block site-title %}
{{#block "site-title"}}
<a href="/">{{ config.app.name }}</a>
{% endblock %}
{{/block}}

<!--
This will place content at the top of the side bar
-->
{% block sidebar %}
{% endblock %}
{{#block "sidebar"}}
{{/block}}

{{#block "language_picker"}}
{{/block}}

<!--
This will place content in the colophon below the map
-->
{% block colophon %}
<p id="powered-by">{% blocktrans %}Powered by{% endblocktrans %} <a href="http://shareabouts.org/" class="shareabouts-logo" target="_blank">Shareabouts</a>, <span class="nobreak">a project of <a href="http://openplans.org/" class="openplans-logo" target="_blank">OpenPlans</a></span></p>
{% endblock %}
{{#block "colophon"}}
<p id="powered-by">{{#_}}Powered by{{/_}} <a href="http://shareabouts.org/" class="shareabouts-logo" target="_blank">Shareabouts</a>, <span class="nobreak">a project of <a href="http://openplans.org/" class="openplans-logo" target="_blank">OpenPlans</a></span></p>
{{/block}}

<!--
Analytics, custom JS, and such go here
-->
{% block includes %}
{% endblock %}
{{#block "includes"}}
{{/block}}

{{/extends}}
3 changes: 1 addition & 2 deletions src/flavors/duwamish-watershed/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ app:
list_enabled: false

languages:
- code: en
- code: en-us
label: I Speak English

- code: es
Expand Down Expand Up @@ -575,7 +575,6 @@ place:
# Labels for the buttons that toggle the map and list views
show_list_button_label: _(See All Reports)
show_map_button_label: _(Show the Map)
action_text: _(added)
title: _(Tell us more...)
action_text: _(created)
anonymous_name: _(Someone)
Expand Down
25 changes: 10 additions & 15 deletions src/flavors/duwamish-watershed/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
{% extends 'base.html' %}
{% load i18n %}
{{#extends "../../../base/templates/base"}}

{% block site-title %}
{{#block "site-title"}}
<a href="/">
The Green-Duwamish Watershed
</a>
{% endblock %}

<!--
This will place content at the top of the side bar
-->
{% block sidebar %}
{% endblock %}
{{/block}}

<!--
This will place content in the colophon below the map
-->
{% block colophon %}
<p id="powered-by">{% blocktrans %}Powered by{% endblocktrans %} <a href="//shareabouts.org/" class="shareabouts-logo" target="_blank">Shareabouts</a>, <span class="nobreak">a project of <a href="//openplans.org/" class="openplans-logo" target="_blank">OpenPlans</a></span></p>
{% endblock %}
{{#block "colophon"}}
<p id="powered-by">{{#_}}Powered by{{/_}}<a href="//shareabouts.org/" class="shareabouts-logo" target="_blank">Shareabouts</a>, <span class="nobreak">a project of <a href="//openplans.org/" class="openplans-logo" target="_blank">OpenPlans</a></span></p>
{{/block}}

<!--
Analytics, custom JS, and such go here
-->

{% block includes %}
{{#block "includes"}}
<!--<script src="{{STATIC_URL}}js/views/commitment-view.js"></script>-->
<script>
(function(S) {
Expand All @@ -35,4 +28,6 @@
})
}(Shareabouts));
</script>
{% endblock %}
{{/block}}

{{/extends}}
3 changes: 1 addition & 2 deletions src/flavors/duwamish_flavor/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ app:
# list_enabled: false

languages:
- code: en
- code: en-us
label: I Speak English

- code: es
Expand Down Expand Up @@ -1114,7 +1114,6 @@ place:
# Labels for the buttons that toggle the map and list views
show_list_button_label: _(See All Reports)
show_map_button_label: _(Show the Map)
action_text: _(added)
title: _(Tell us more...)
action_text: _(created)
anonymous_name: _(Someone)
Expand Down
27 changes: 10 additions & 17 deletions src/flavors/duwamish_flavor/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
{% extends 'base.html' %}
{% load i18n %}
{{#extends "../../../base/templates/base"}}

{% block site-title %}
{{#block "site-title"}}
<a href="/">
<img id="site-title-image" src="{{STATIC_URL}}css/images/site-title_hey-duwamish.png" alt="{{ config.app.name }}"></img>
<img id="site-title-image" src="/css/images/site-title_hey-duwamish.png" alt="{{ config.app.name }}"></img>
</a>
{% endblock %}

<!--
This will place content at the top of the side bar
-->
{% block sidebar %}
{% endblock %}
{{/block}}

<!--
This will place content in the colophon below the map
-->
{% block colophon %}
<p id="powered-by">{% blocktrans %}Powered by{% endblocktrans %} <a href="//shareabouts.org/" class="shareabouts-logo" target="_blank">Shareabouts</a>, <span class="nobreak">a project of <a href="//openplans.org/" class="openplans-logo" target="_blank">OpenPlans</a></span></p>
{% endblock %}
{{#block "colophon"}}
<p id="powered-by">{{#_}}Powered by{{/_}} <a href="//shareabouts.org/" class="shareabouts-logo" target="_blank">Shareabouts</a>, <span class="nobreak">a project of <a href="//openplans.org/" class="openplans-logo" target="_blank">OpenPlans</a></span></p>
{{/block}}

<!--
Analytics, custom JS, and such go here
-->

{% block includes %}
<!--<script src="{{STATIC_URL}}js/views/commitment-view.js"></script>-->
{{#block "includes"}}
<script>
(function(S) {
// ========================================
Expand All @@ -35,5 +27,6 @@
})
}(Shareabouts));
</script>
{{/block}}

{% endblock %}
{{/extends}}
2 changes: 1 addition & 1 deletion src/flavors/greensboropb/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ app:
tagline: _(How would YOU spend $100K?)

# languages:
# - code: en
# - code: en-us
# label: English

# - code: es
Expand Down
Loading

0 comments on commit 9639435

Please sign in to comment.