aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--www/js/views/sent.js11
-rw-r--r--www/js/views/submit.js6
-rw-r--r--www/templates/en/sent.html21
3 files changed, 30 insertions, 8 deletions
diff --git a/www/js/views/sent.js b/www/js/views/sent.js
index 03ec7a7..179d9f7 100644
--- a/www/js/views/sent.js
+++ b/www/js/views/sent.js
@@ -10,6 +10,17 @@
'pagebeforeshow': 'beforeDisplay',
'pageshow': 'afterDisplay',
'vclick .ui-btn-left': 'onClickButtonPrev'
+ },
+
+ render: function(){
+ if ( !this.template ) {
+ console.log('no template to render');
+ return;
+ }
+ template = _.template( tpl.get( this.template ) );
+ this.$el.html(template(FMS.createdReport.toJSON()));
+ this.afterRender();
+ return this;
}
})
});
diff --git a/www/js/views/submit.js b/www/js/views/submit.js
index bab9396..f3214db 100644
--- a/www/js/views/submit.js
+++ b/www/js/views/submit.js
@@ -55,6 +55,12 @@
if ( FMS.currentUser ) {
FMS.currentUser.save();
}
+ if (resp.report) {
+ this.report.set('site_id', resp.report);
+ this.report.set('site_url', CONFIG.FMS_URL + '/report/' + resp.report);
+ } else {
+ this.report.set('email_confirm', 1);
+ }
var reset = FMS.removeDraft( model.id, true);
var that = this;
reset.done( function() { that.onRemoveDraft(); } );
diff --git a/www/templates/en/sent.html b/www/templates/en/sent.html
index 512015a..7b3dd98 100644
--- a/www/templates/en/sent.html
+++ b/www/templates/en/sent.html
@@ -2,12 +2,17 @@
<a class="ui-btn-left">Locate</a>
<h1>Report Created</h1>
</div>
-<div class="table-cell">
- <div class="container" data-role="content">
- <div class="content" role="main">
- <h1>Your report has been created</h1>
+<div data-role="content">
+ <% if ( typeof email_confirm != 'undefined' && email_confirm === 1 ) { %>
+ <h3>Confirmation email sent</h3>
- <p>You can view it on the site at <span id="report_url"></span></p>
- </div><!-- .content role=main -->
- </div><!-- .container -->
-</div><!-- .table-cell -->
+ <p>
+ We've sent you a confirmation email which may take a few minutes to arrive. Once it arrives
+ click the link in the email to confirm your report.
+ </p>
+ <% } else { %>
+ <h3>Your report has been created</h3>
+
+ <p>You can view it on the site at <a onclick="FMS.openExternal(event); return false;" href="<%= site_url %>"><%= site_url %></a></p>
+ <% } %>
+</div>