aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--www/js/views/around.js17
-rw-r--r--www/templates/en/around.html8
2 files changed, 23 insertions, 2 deletions
diff --git a/www/js/views/around.js b/www/js/views/around.js
index 6fcb426..ce4feab 100644
--- a/www/js/views/around.js
+++ b/www/js/views/around.js
@@ -9,7 +9,7 @@
'pagebeforeshow': 'beforeDisplay',
'pageshow': 'afterDisplay',
'click #locate_search': 'goSearch',
- 'click #login': 'goLogin',
+ 'click #login-options': 'goLogin',
'click #reports': 'goReports',
'click #search': 'goSearch',
'click #relocate': 'centerMapOnPosition',
@@ -18,6 +18,21 @@
'click #mark-here': 'onClickMark'
},
+ render: function(){
+ if ( !this.template ) {
+ console.log('no template to render');
+ return;
+ }
+ template = _.template( tpl.get( this.template ) );
+ if ( this.model ) {
+ this.$el.html(template({ model: this.model.toJSON(), user: FMS.currentUser.toJSON() }));
+ } else {
+ this.$el.html(template());
+ }
+ this.afterRender();
+ return this;
+ },
+
beforeDisplay: function() {
$('#cancel').hide();
},
diff --git a/www/templates/en/around.html b/www/templates/en/around.html
index 2529f09..6ae70d1 100644
--- a/www/templates/en/around.html
+++ b/www/templates/en/around.html
@@ -59,10 +59,16 @@
<strong>My Reports</strong>
<span class="draft_count">2</span> Draft Reports
</a>
+ <% if ( FMS.isLoggedIn ) { %>
<a id="login-options" class="nodisplay loggedin" data-role="button" href="#">
<strong class="signout">Sign Out</strong>
- (Signed in as <strong>Timothy Jones</strong>)
+ (Signed in as <strong><%= user.name %></strong>)
</a>
+ <% } else { %>
+ <a id="login-options" class="nodisplay loggedout" data-role="button" href="#">
+ <strong class="signin">Sign In</strong>
+ </a>
+ <% } %>
<a id="mark-here" data-role="button" data-theme="a" style="position:absolute;bottom:0;left:15px;right:15px;">
New Report Here