Skip to content

Commit

Permalink
PTDB-31 : Removing the references to content.niwa and replacing with …
Browse files Browse the repository at this point in the history
…file templates of the data
  • Loading branch information
AaronDCole committed May 29, 2018
1 parent 7794f81 commit e68fddf
Show file tree
Hide file tree
Showing 9 changed files with 2,068 additions and 13 deletions.
91 changes: 78 additions & 13 deletions app/components/app/page/PageView.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@ define([
'jquery', 'underscore', 'backbone',
'text!./page.html',
'text!./pageContent.html',
'text!templates/loading.html'
'text!templates/loading.html',
'text!templates/content_about.html',
'text!templates/content_usage.html',
'text!templates/content_contact.html',
'text!templates/content_attributes.html',
'text!templates/not_found.html',
'text!templates/content_palaeotsunami.html',
'text!templates/content_sources.html',
'text!templates/content_travel.html',
], function (
$, _, Backbone,
template,
templateContent,
templateLoading
templateLoading,
templateContentAbout,
templateContentUsage,
templateContentContact,
templateContentAttributes,
templateNotFound,
templateContentPalaeotsunami,
templateContentSources,
templateContentTravel,
) {

var PageView = Backbone.View.extend({
Expand Down Expand Up @@ -38,17 +54,66 @@ define([
t:this.model.getLabels()
}))
if (this.model.hasActivePage()) {
var that = this
page.getContent(function(content){
that.$('.page-outer').html(_.template(templateContent)({
t:that.model.getLabels(),
}))
that.$('.page-outer').removeClass('loading')
that.$('.placeholder-content').html(content)
if (that.model.getPageAnchor() === "") {
that.$el.scrollTop(0)
}
})
console.log('this should be trying to load a new page, all bow', this.model.attributes.pageId);
var that = this
switch (this.model.attributes.pageId) {
case "about":
that.$('.page-outer').html(_.template(templateContentAbout)({ }))
that.$('.page-outer').removeClass('loading')
if (that.model.getPageAnchor() === "") {
that.$el.scrollTop(0)
}
break;
case "attributes":
that.$('.page-outer').html(_.template(templateContentAttributes)({ }))
that.$('.page-outer').removeClass('loading')
if (that.model.getPageAnchor() === "") {
that.$el.scrollTop(0)
}
break;
case "usage":
that.$('.page-outer').html(_.template(templateContentUsage)({ }))
that.$('.page-outer').removeClass('loading')
if (that.model.getPageAnchor() === "") {
that.$el.scrollTop(0)
}
break;
case "contact":
that.$('.page-outer').html(_.template(templateContentContact)({ }))
that.$('.page-outer').removeClass('loading')
if (that.model.getPageAnchor() === "") {
that.$el.scrollTop(0)
}
break;
case "palaeotsunami":
that.$('.page-outer').html(_.template(templateContentPalaeotsunami)({}))
that.$('.page-outer').removeClass('loading')
if (that.model.getPageAnchor() === "") {
that.$el.scrollTop(0)
}
break;
case "sources":
that.$('.page-outer').html(_.template(templateContentSources)({}))
that.$('.page-outer').removeClass('loading')
if (that.model.getPageAnchor() === "") {
that.$el.scrollTop(0)
}
break;
case "travel":
that.$('.page-outer').html(_.template(templateContentTravel)({}))
that.$('.page-outer').removeClass('loading')
if (that.model.getPageAnchor() === "") {
that.$el.scrollTop(0)
}
break;
default:
that.$('.page-outer').html(_.template(templateNotFound)({ }))
that.$('.page-outer').removeClass('loading')
if (that.model.getPageAnchor() === "") {
that.$el.scrollTop(0)
}
break;
}

}
} else {
Expand Down
68 changes: 68 additions & 0 deletions app/templates/content_about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<a href="#" title="Close" class="close-page">
<span class="icon-icon_close"></span>
</a>
<div class="page-inner">
<div class="container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<div class="placeholder-content container-fluid">
<h1>New Zealand Palaeotsunami Database</h1>
<p class="lead">The
<strong>New Zealand Palaeotsunami Database</strong> (Database) brings together all known information about
tsunamis that occurred prior to written records.</p>
<p>The purpose of this Database is to increase awareness of New Zealand's tsunami hazard and facilitate
processing and analysis of palaeotsunami information. It consolidates a wide range of published and
unpublished research contributions from a range of institutions and science providers, both domestic
and overseas, on palaeotsunamis in Aotearoa-New Zealand. The Database is based on the work of former
NIWA earth scientist, Professor James Goff of the University of New South Wales, Australia; and is
provided by the National Institute of Water &amp; Atmospheric Research Ltd (NIWA) and the Ministry
for Civil Defence and Emergency Management (MCDEM) (together, the Providers)
<sup>
<a id="ref1" href="#fn1">1</a>
</sup>. This information is freely available to you.</p>
<p>Each line of data in the Database summarises the evidence related to one site under a series of headings
including physical evidence from geological and archaeological sources as well as cultural information
from anthropological and cross-disciplinary studies. The Database currently contains 429 line items
and most likely describes more than 50 palaeotsunami events. Data include: site information, nature
of the evidence, chronology and dating techniques, maximum water heights, horizontal inundation distances,
sources and supporting meta-data for specific locations. The Database is not intended to be complete
however, rather as research progresses iterations will be made to remove erroneous data and add new
data.</p>
<p>When quoting, citing or distributing data from the Database, please cite the following reference: New
Zealand Palaeotsunami Database. 2017.
<a href="https://ptdb.niwa.co.nz" target="_blank">https://ptdb.niwa.co.nz</a> [Access Date].</p>
<p>Website data updated 28 May 2018.</p>
<h2>Contributors</h2>
<p>The Providers acknowledge the contribution of the following to the Database:</p>
<ul>
<li>UNSW Australia:
<a href="https://www.unsw.edu.au/" target="_blank">https://www.unsw.edu.au/</a>
</li>
<li>Dumpark:
<a href="http://dumpark.com/" target="_blank">http://dumpark.com/</a>
</li>
<li>eCoast:
<a href="http://www.ecoast.co.nz/" target="_blank">http://www.ecoast.co.nz/</a>
</li>
<li>Environment Canterbury:
<a href="https://www.ecan.govt.nz/" target="_blank">https://www.ecan.govt.nz/</a>
</li>
</ul>
<p>
<img style="margin: 0px auto; display: block;" src="//content.niwa.co.nz/sites/default/files/ptdb-logos@2x.png"
alt="PTDB logos" class="img-responsive">
</p>
<hr>
<p>
<sup id="fn1">1. All proprietary rights (including all intellectual property rights) in, or associated with the
Information are, and shall remain, vested solely in the Providers (or any other relevant third
party who has contributed Information for which the Providers act as custodian).
<a title="Jump back to footnote 1 in the text."
href="#ref1"></a>
</sup>
</p>
</div>
</div>
</div>
</div>
</div>
Loading

0 comments on commit e68fddf

Please sign in to comment.