aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--www/js/views/login.js13
-rw-r--r--www/templates/en/login.html33
2 files changed, 40 insertions, 6 deletions
diff --git a/www/js/views/login.js b/www/js/views/login.js
index 98ede73..312eda5 100644
--- a/www/js/views/login.js
+++ b/www/js/views/login.js
@@ -35,8 +35,8 @@
that.model.set('name', data.name);
that.model.save();
FMS.isLoggedIn = 1;
- $('#password_row').hide();
- $('#success_row').show();
+ that.$('#password_row').hide();
+ that.$('#success_row').show();
} else {
that.validationError('form_email', FMS.strings.login_error);
}
@@ -57,12 +57,13 @@
timeout: 30000,
success: function( data, status ) {
FMS.isLoggedIn = 0;
- $('#password_row').hide();
- $('#success_row').show();
that.model.set('password', '');
that.model.save();
- $('#signed_in_row').hide();
- $('#password_row').show();
+ that.$('#form_email').val('');
+ that.$('#form_password').val('');
+ that.$('#success_row').hide();
+ that.$('#signed_in_row').hide();
+ that.$('#password_row').show();
},
error: function() {
// TODO fix this
diff --git a/www/templates/en/login.html b/www/templates/en/login.html
new file mode 100644
index 0000000..9f478e3
--- /dev/null
+++ b/www/templates/en/login.html
@@ -0,0 +1,33 @@
+<div id="submit-header" data-role="header" data-position="fixed" data-id="locate">
+ <h1>Login</h1>
+ <a id="reports-next-btn" data-icon="arrow-r" data-iconpos="right" class="ui-btn-right">Home</a>
+</div>
+
+<div data-role="content">
+ <% if ( FMS.isLoggedIn ) { %>
+ <div id="signed_in_row">
+ <p>You are signed in as <%= email %></p>
+ <input type="button" id="logout" name="logout" value="Sign Out" data-theme="a">
+ </div>
+ <div id="password_row" class="gmailstyletest nodisplay">
+ <p>
+ Signed out!
+ </p>
+ <% } else { %>
+ <div id="password_row" class="gmailstyletest">
+ <% } %>
+ <div>
+ <input data-role="none" type="email" value="" name="email" id="form_email" placeholder="Your Email" required>
+ </div>
+ <div>
+ <input data-role="none" type="password" value="" name="password" id="form_password" placeholder="Your password" required>
+ </div>
+ <input type="button" id="login" name="login" value="Login" data-theme="a">
+ </div>
+ <div id="success_row" class="nodisplay">
+ <p>
+ Signed in!
+ </p>
+ <input type="button" id="logout" name="logout" value="Sign Out" data-theme="a">
+ </div>
+</div>