<?php

/** @var \TdyPlayers\Model\Player $currentPlayer */
$currentPlayer = $this->currentPlayer();
$isLoggedIn = !is_null($currentPlayer) && isset($currentPlayer->id) && $currentPlayer->id > 0;
?>

<div class="navbar">
    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation" ng-controller="NavbarController">
        <div class="container">
            <div class="navbar-header">
                <?php if (!$isLoggedIn) : ?>
                    <span class="navbar-text navbar-text-rethink">Rethink Your Fantasy <img src="<?php echo $this->basePath(); ?>/assets/img/image-x-ray.png" width="16" height="16" style="margin-left: 0.35em"></span>
                <?php else : ?>
                    <button type="button" class="btn btn-default navbar-toggle" ng-click="isCollapsed = !isCollapsed">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="fa fa-bars"></span>
                    </button>
                    <a class="navbar-brand" href="<?php echo ($isLoggedIn ? $this->url('lobby') : $this->url('home')) ?>">
                        <img src="<?php echo $this->basePath(); ?>/assets/img/logo.png" height="30">
                    </a>
                <?php endif; ?>
            </div>
            <div class="collapse navbar-collapse" ng-class="!isCollapsed && 'in'">
                <?php if ($isLoggedIn) : ?>
                    <?php echo $this->navigation('navigation')->menu()->setUlClass('nav navbar-nav')->setPartial('partial/navigation.phtml'); ?>
                    <div class="navbar-right" uib-dropdown="">
                        <span class="navbar-text balance">Balance: US$ 7,340.00</span>
                        <span class="navbar-text-lhb signed-in">Signed in as <a href="#" class="navbar-link" uib-dropdown-toggle><?php echo $currentPlayer->nickname; ?></a> <img src="<?php echo $currentPlayer->getAvatar()->path; ?>" alt="" width="48" height="48">.</span>
                        <ul class="dropdown-menu dropdown-menu-right">
                            <li><a href="#">Profile</a></li>
                            <li><a href="<?php echo $this->url('logout'); ?>">Logout</a></li>
                        </ul>
                        <a class="btn btn-primary navbar-btn" href="#" role="button">Deposit</a>
                    </div>
                <?php endif; ?>
                <?php if (!$isLoggedIn) : ?>
                <div class="navbar-right">
                    <button class="btn btn-primary navbar-btn" ng-click="modalLoginActions.show()" role="button">Login</button>
                </div>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>


<div class="content">
