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

    // Show profile link instead of login if user is logged in
    var email = $.cookie(BotleaguesFrontend.cookie_login_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'));
    }
});