diff options
Diffstat (limited to 'app/Template/header')
-rw-r--r-- | app/Template/header/board_selector.php | 13 | ||||
-rw-r--r-- | app/Template/header/creation_dropdown.php | 21 | ||||
-rw-r--r-- | app/Template/header/title.php | 17 | ||||
-rw-r--r-- | app/Template/header/user_dropdown.php | 40 | ||||
-rw-r--r-- | app/Template/header/user_notifications.php | 5 |
5 files changed, 96 insertions, 0 deletions
diff --git a/app/Template/header/board_selector.php b/app/Template/header/board_selector.php new file mode 100644 index 00000000..6f87b0d1 --- /dev/null +++ b/app/Template/header/board_selector.php @@ -0,0 +1,13 @@ +<?= $this->app->component('select-dropdown-autocomplete', array( + 'name' => 'boardId', + 'placeholder' => t('Display another project'), + 'items' => $board_selector, + 'redirect' => array( + 'regex' => 'PROJECT_ID', + 'url' => $this->url->to('BoardViewController', 'show', array('project_id' => 'PROJECT_ID')), + ), + 'onFocus' => array( + 'board.selector.open', + ) +)) ?> + diff --git a/app/Template/header/creation_dropdown.php b/app/Template/header/creation_dropdown.php new file mode 100644 index 00000000..9bdf5ad2 --- /dev/null +++ b/app/Template/header/creation_dropdown.php @@ -0,0 +1,21 @@ +<?php $has_project_creation_access = $this->user->hasAccess('ProjectCreationController', 'create'); ?> +<?php $is_private_project_enabled = $this->app->config('disable_private_project', 0) == 0; ?> + +<?php if ($has_project_creation_access || (!$has_project_creation_access && $is_private_project_enabled)): ?> + <div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><i class="fa fa-plus fa-fw"></i><i class="fa fa-caret-down"></i></a> + <ul> + <?php if ($has_project_creation_access): ?> + <li> + <?= $this->modal->medium('plus', t('New project'), 'ProjectCreationController', 'create') ?> + </li> + <?php endif ?> + <?php if ($is_private_project_enabled): ?> + <li> + <?= $this->modal->medium('lock', t('New private project'), 'ProjectCreationController', 'createPrivate') ?> + </li> + <?php endif ?> + <?= $this->hook->render('template:header:creation-dropdown') ?> + </ul> + </div> +<?php endif ?> diff --git a/app/Template/header/title.php b/app/Template/header/title.php new file mode 100644 index 00000000..61c6ee9a --- /dev/null +++ b/app/Template/header/title.php @@ -0,0 +1,17 @@ +<h1> + <span class="logo"> + <?= $this->url->link('K<span>B</span>', 'DashboardController', 'show', array(), false, '', t('Dashboard')) ?> + </span> + <span class="title"> + <?php if (! empty($project) && ! empty($task)): ?> + <?= $this->url->link($this->text->e($project['name']), 'BoardViewController', 'show', array('project_id' => $project['id'])) ?> + <?php else: ?> + <?= $this->text->e($title) ?> + <?php endif ?> + </span> + <?php if (! empty($description)): ?> + <small class="tooltip" title="<?= $this->text->markdownAttribute($description) ?>"> + <i class="fa fa-info-circle"></i> + </small> + <?php endif ?> +</h1> diff --git a/app/Template/header/user_dropdown.php b/app/Template/header/user_dropdown.php new file mode 100644 index 00000000..a74bdd52 --- /dev/null +++ b/app/Template/header/user_dropdown.php @@ -0,0 +1,40 @@ +<div class="dropdown"> + <a href="#" class="dropdown-menu dropdown-menu-link-icon"><?= $this->avatar->currentUserSmall('avatar-inline') ?><i class="fa fa-caret-down"></i></a> + <ul> + <li class="no-hover"><strong><?= $this->text->e($this->user->getFullname()) ?></strong></li> + <li> + <?= $this->url->icon('tachometer', t('My dashboard'), 'DashboardController', 'show', array('user_id' => $this->user->getId())) ?> + </li> + <li> + <?= $this->url->icon('home', t('My profile'), 'UserViewController', 'show', array('user_id' => $this->user->getId())) ?> + </li> + <li> + <?= $this->url->icon('folder', t('Projects management'), 'ProjectListController', 'show') ?> + </li> + <?php if ($this->user->hasAccess('UserListController', 'show')): ?> + <li> + <?= $this->url->icon('user', t('Users management'), 'UserListController', 'show') ?> + </li> + <li> + <?= $this->url->icon('group', t('Groups management'), 'GroupListController', 'index') ?> + </li> + <li> + <?= $this->url->icon('cubes', t('Plugins'), 'PluginController', 'show') ?> + </li> + <li> + <?= $this->url->icon('cog', t('Settings'), 'ConfigController', 'index') ?> + </li> + <?php endif ?> + + <?= $this->hook->render('template:header:dropdown') ?> + + <li> + <?= $this->url->icon('life-ring', t('Documentation'), 'DocumentationController', 'show') ?> + </li> + <?php if (! DISABLE_LOGOUT): ?> + <li> + <?= $this->url->icon('sign-out', t('Logout'), 'AuthController', 'logout') ?> + </li> + <?php endif ?> + </ul> +</div> diff --git a/app/Template/header/user_notifications.php b/app/Template/header/user_notifications.php new file mode 100644 index 00000000..83c545d2 --- /dev/null +++ b/app/Template/header/user_notifications.php @@ -0,0 +1,5 @@ +<?php if ($this->user->hasNotifications()): ?> + <span class="notification"> + <?= $this->url->link('<i class="fa fa-bell web-notification-icon"></i>', 'DashboardController', 'notifications', array('user_id' => $this->user->getId()), false, '', t('Unread notifications')) ?> + </span> +<?php endif ?> |