diff --git a/public/src/forum/footer.js b/public/src/forum/footer.js index b465b687c2..a479ae06e5 100644 --- a/public/src/forum/footer.js +++ b/public/src/forum/footer.js @@ -35,19 +35,12 @@ socket.on('api:updateHeader', function(data) { var rightMenu = $('#right-menu'); if (data.uid > 0) { - var userLabel = document.createElement('li'), - logoutEl = document.createElement('li'); - + var userLabel = rightMenu.find('#user_label'); + userLabel.attr('href','/users/'+data['username']); + + userLabel.find('img').attr('src',data['picture']+"?s=24&default=identicon"); + userLabel.find('span').html(data['username']); - - userLabel.innerHTML = '' + - '' + - '' + data['username'] + '' + - ''; - logoutEl.innerHTML = 'Log out'; - - rightMenu[0].appendChild(userLabel); - rightMenu[0].appendChild(logoutEl); } else { rightMenu.html(''); diff --git a/public/templates/header.tpl b/public/templates/header.tpl index a01e674241..0c8d800309 100644 --- a/public/templates/header.tpl +++ b/public/templates/header.tpl @@ -66,6 +66,15 @@