Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
[#671] support_url setting for top navigation.
Browse files Browse the repository at this point in the history
The link used for the Support navigation item can be customised in a
site's settings file by adding a row for `support_url` with a url as
value. If absent, the Support link will default to the instance-wide
`discussion_forum` value.
  • Loading branch information
brew committed Jul 20, 2016
1 parent f11e13d commit 277fc73
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion census/views/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
{% if site.settings.tutorial_page %}
<li><a href="/tutorial/">{{gettext("Tutorial")}}</a></li>
{% endif %}
{% if discussionForum %}
{% if site.settings.support_url %}
<li><a target="_blank" href="{{ site.settings.support_url }}">{{ gettext("Support") }}</a></li>
{% elif discussionForum %}
<li><a target="_blank" href="{{ discussionForum }}">{{ gettext("Support") }}</a></li>
{% endif %}
</ul>
Expand Down
3 changes: 2 additions & 1 deletion fixtures/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ var objects = [
reviewers: ['email1@example.com', 'email3@example.com'],
'custom_footer': '<span style="display: none;">Custom footer</span>',
'custom_css': '/* Custom CSS rules */',
'navbar_logo': '<span style="display: none;">Custom navbar logo</span>'
'navbar_logo': '<span style="display: none;">Custom navbar logo</span>',
'support_url': 'https://discuss.okfn.org/c/open-data-index/australia-index'
}
}
},
Expand Down
3 changes: 2 additions & 1 deletion tests/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ describe('Basics', function() {
this.browser.visit('/', () => {
assert.ok(this.browser.success);
var html = this.browser.html();
_.forEach(['custom_css', 'navbar_logo', 'custom_footer'],
_.forEach(['custom_css', 'navbar_logo',
'custom_footer', 'support_url'],
settingName => {
var textToCheck = site.settings[settingName];
assert.include(html, textToCheck);
Expand Down

0 comments on commit 277fc73

Please sign in to comment.