summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.html6
-rw-r--r--js/codeq/login.js8
2 files changed, 9 insertions, 5 deletions
diff --git a/index.html b/index.html
index 9dd8a7c..600b925 100644
--- a/index.html
+++ b/index.html
@@ -284,9 +284,9 @@
</div>
<ul class="list-group small">
<li class="list-group-item text-right"><span class="pull-left"><strong>Username</strong></span><span id="profileUsername">janezk</span></li>
- <li class="list-group-item text-right"><span class="pull-left"><strong>Real name</strong></span>Janez Kranjski</li>
- <li class="list-group-item text-right"><span class="pull-left"><strong>Joined</strong></span>Sep 29, 2015</li>
- <li class="list-group-item text-right"><span class="pull-left"><strong>Last seen</strong></span>1 hour ago</li>
+ <li class="list-group-item text-right"><span class="pull-left"><strong>Real name</strong></span><span id="profileName">Janez Kranjski</span></li>
+ <li class="list-group-item text-right"><span class="pull-left"><strong>Joined</strong></span><span id="profileJoined">Sep 29, 2015</span></li>
+ <li class="list-group-item text-right"><span class="pull-left"><strong>Last seen</strong></span><span id="profileLastLogin">1 hour ago</span></li>
</ul>
</div>
</div><!--/col-12-->
diff --git a/js/codeq/login.js b/js/codeq/login.js
index 538cd3d..0feaf01 100644
--- a/js/codeq/login.js
+++ b/js/codeq/login.js
@@ -15,8 +15,13 @@
$('#disabled').css('cursor', '');
if (data.code !== 0) throw new Error('Login failed, code: ' + data.code + ', message: ' + data.message);
- //merge profile
+ //nav signed in...
+ $('#signed-in-title').html('Signed in as '+(data.name||$('#username').val()));
+ //merge with profile page
$('#profileUsername').html($('#username').val());
+ $('#profileName').html(data.name||'undefined');
+ $('#profileJoined').html(new Date(data.joined).toLocaleString());
+ $('#profileLastLogin').html(new Date(data["last-login"]).toLocaleString());
//merge these settings into the already existing default settings
var sett = data.settings;
@@ -58,7 +63,6 @@
formInputs.off('keyup');
$('#modalLogIn').modal('hide');
//$("#screen_login").css('display', 'none');
- $('#signed-in-title').html('Signed in as '+$('#username').val());
$("#password").val('');
}
});