aboutsummaryrefslogtreecommitdiff
path: root/src/js/main.js
blob: 04b5c6f3ca33f226d38929970d49613a3103ca97 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$(document).ready(function(){

    // Show profile link instead of login if user is logged in
    var email = $.cookie(BotleaguesFrontend.cookie_login_email);
    console.log(email);
    if (typeof email != 'undefined' && $.cookie(BotleaguesFrontend.cookie_login_valid_till) > (new Date()).getTime()) {
        $('#nav .login-link').remove();
        $('<li>').append(
            $('<a>')
                .attr('role', 'presentation')
                .attr('title', 'User profile')
                .attr('href', '/profile')
                .text(email))
            .appendTo($('#nav'));
    }
});