summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Pušnik <marko.pusnik@guru.si>2015-10-12 14:26:40 +0200
committerMarko Pušnik <marko.pusnik@guru.si>2015-10-12 14:26:40 +0200
commit05fc111e65c93cc8f33051f0c0a8084a5c5debf1 (patch)
treea24f225102ab22eda0b427316b6e250f2f26df79
parent894df8afb3c70f2b17437d10d43a7b62402f59c3 (diff)
profile page
-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('');
}
});