aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/router.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-04-12 12:17:42 +0100
committerStruan Donald <struan@exo.org.uk>2013-04-12 15:18:37 +0100
commit82e9a55192524f8f30725acb83e2a1c21a19f55f (patch)
treeccbed736871e7cecc99dc1826658b19d235fe8eb /www/js/router.js
parentc9415aee71d3a6967de6cbb99d453c9a01c20025 (diff)
if no internet connection then allow the user to create an offline
report with a title, details and a photo Alter the checking for in progress reports not to require a location as offline reports might not have one Also add a holding page for a users reports
Diffstat (limited to 'www/js/router.js')
-rw-r--r--www/js/router.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/www/js/router.js b/www/js/router.js
index f220422..fe43d69 100644
--- a/www/js/router.js
+++ b/www/js/router.js
@@ -6,6 +6,7 @@
routes: {
'': 'home',
'home': 'home',
+ 'offline': 'offline',
'around': 'around',
'search': 'search',
'existing': 'existing',
@@ -15,7 +16,8 @@
'submit-email': 'submitEmail',
'submit-name': 'submitName',
'submit-password': 'submitPassword',
- 'sent': 'sent'
+ 'sent': 'sent',
+ 'reports': 'reports'
},
initialize: function() {
@@ -53,6 +55,11 @@
this.changeView(homeView);
},
+ offline: function() {
+ var offlineView = new FMS.OfflineView({ model: FMS.currentDraft });
+ this.changeView(offlineView);
+ },
+
photo: function(){
var photoView = new FMS.PhotoView({ model: FMS.currentDraft });
this.changeView(photoView);
@@ -88,6 +95,11 @@
this.changeView(sentView);
},
+ reports: function() {
+ var reportsView = new FMS.ReportsView({ model: FMS.currentDraft });
+ this.changeView(reportsView);
+ },
+
changeView: function(view) {
console.log( 'change View to ' + view.id );
$(view.el).attr('data-role', 'page');