diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-01-21 20:58:12 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-01-21 20:58:12 -0500 |
commit | fcdfdeabfa174900f393414297da45635d88f4c0 (patch) | |
tree | f808217483e94dd10a4d756092303f43f59ad9cd /app | |
parent | f3e5fdb137e12a927b6b29d6a80411170bfa3c19 (diff) |
Replace logout link by a dropdown menu
Diffstat (limited to 'app')
-rw-r--r-- | app/Helper/User.php | 16 | ||||
-rw-r--r-- | app/Template/header.php | 23 |
2 files changed, 19 insertions, 20 deletions
diff --git a/app/Helper/User.php b/app/Helper/User.php index 101d8dbe..29844dfb 100644 --- a/app/Helper/User.php +++ b/app/Helper/User.php @@ -51,22 +51,6 @@ class User extends \Kanboard\Core\Base } /** - * Get user profile - * - * @access public - * @return string - */ - public function getProfileLink() - { - return $this->helper->url->link( - $this->helper->e($this->getFullname()), - 'user', - 'show', - array('user_id' => $this->userSession->getId()) - ); - } - - /** * Check if the given user_id is the connected user * * @param integer $user_id User id diff --git a/app/Template/header.php b/app/Template/header.php index e8fd90c7..817051b4 100644 --- a/app/Template/header.php +++ b/app/Template/header.php @@ -1,6 +1,12 @@ <header> <nav> - <h1><?= $this->url->link('K<span>B</span>', 'app', 'index', array(), false, 'logo', t('Dashboard')).' '.$this->e($title) ?> + <h1> + <span class="logo"> + <?= $this->url->link('K<span>B</span>', 'app', 'index', array(), false, '', t('Dashboard')) ?> + </span> + <span class="title"> + <?= $this->e($title) ?> + </span> <?php if (! empty($description)): ?> <span class="tooltip" title='<?= $this->e($this->text->markdown($description)) ?>'> <i class="fa fa-info-circle"></i> @@ -26,11 +32,20 @@ <?php endif ?> <li> <?php if ($this->user->hasNotifications()): ?> - <?= $this->url->link('<i class="fa fa-bell web-notification-icon"></i>', 'app', 'notifications', array('user_id' => $this->user->getId()), false, '', t('Unread notifications')) ?> + <span class="notification"> + <?= $this->url->link('<i class="fa fa-bell web-notification-icon"></i>', 'app', 'notifications', array('user_id' => $this->user->getId()), false, '', t('Unread notifications')) ?> + </span> <?php endif ?> - <?= $this->url->link(t('Logout'), 'auth', 'logout') ?> - <span class="username hide-tablet">(<?= $this->user->getProfileLink() ?>)</span> + <span class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-user fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <li class="no-hover"><strong><?= $this->e($this->user->getFullname()) ?></strong></li> + <li><?= $this->url->link(t('My dashboard'), 'app', 'index', array('user_id' => $this->user->getId())) ?></li> + <li><?= $this->url->link(t('My profile'), 'user', 'show', array('user_id' => $this->user->getId())) ?></li> + <li><?= $this->url->link(t('Logout'), 'auth', 'logout') ?></li> + </ul> + </span> </li> </ul> </nav> |