Commit ddd53d31 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Show avatar in header after login.

parent 564af078
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ Ext.define('Docs.controller.Auth', {
    },

    setLoggedIn: function() {
        this.getAuthForm().showLoggedIn(Docs.Auth.getUser().userName);
        this.getAuthForm().showLoggedIn(Docs.Auth.getUser());
        this.getController("Tabs").showCommentsTab();
    },

+8 −4
Original line number Diff line number Diff line
@@ -4,7 +4,10 @@
Ext.define('Docs.view.auth.Form', {
    extend: 'Ext.container.Container',
    alias: 'widget.authForm',
    requires: ['Docs.Tip'],
    requires: [
        'Docs.Tip',
        'Docs.Comments'
    ],

    loginTplHtml: [
        '<form class="loginForm">',
@@ -83,10 +86,11 @@ Ext.define('Docs.view.auth.Form', {

    /**
     * Shows message about who's logged in.
     * @param {String} username
     * @param {Object} user
     */
    showLoggedIn: function(username) {
        this.update('Welcome, ' + username + ' | <a href="#" class="logout">Logout</a>');
    showLoggedIn: function(user) {
        var userSignature = Docs.Comments.avatar(user.emailHash) + ' ' + user.userName;
        this.update('<span>' + userSignature + '</span> | <a href="#" class="logout">Logout</a>');
    },

    /**
+7 −0
Original line number Diff line number Diff line
@@ -30,6 +30,13 @@
#loginContainer {
  text-align: right;
  color: #fff;
  span {
    position: relative;
    img.avatar {
      @include border-radius(2px);
      position: absolute;
      top: -5px;
      left: -35px; } }
  .register {
    font-weight: bold; }
  a {