Convert application header to grid system

This commit is contained in:
Frederic Guillot 2016-08-07 12:51:03 -04:00
parent 590d2c2396
commit 69c6271c6e
No known key found for this signature in database
GPG Key ID: 92D77191BA7FBC99
15 changed files with 165 additions and 157 deletions

View File

@ -1,119 +1,35 @@
<?php $_title = $this->render('header/title', array(
'project' => isset($project) ? $project : null,
'task' => isset($task) ? $task : null,
'description' => isset($description) ? $description : null,
'title' => $title,
)) ?>
<?php $_top_right_corner = implode('&nbsp;', array(
$this->render('header/user_notifications'),
$this->render('header/creation_dropdown'),
$this->render('header/user_dropdown')
)) ?>
<header>
<nav>
<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>
<ul>
<?php if (isset($board_selector) && ! empty($board_selector)): ?>
<li>
<select id="board-selector"
class="chosen-select select-auto-redirect"
tabindex="-1"
data-search-threshold="0"
data-notfound="<?= t('No results match:') ?>"
data-placeholder="<?= t('Display another project') ?>"
data-redirect-regex="PROJECT_ID"
data-redirect-url="<?= $this->url->href('BoardViewController', 'show', array('project_id' => 'PROJECT_ID')) ?>">
<option value=""></option>
<?php foreach ($board_selector as $board_id => $board_name): ?>
<option value="<?= $board_id ?>"><?= $this->text->e($board_name) ?></option>
<?php endforeach ?>
</select>
</li>
<?php endif ?>
<li class="user-links">
<?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 ?>
<?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><i class="fa fa-plus fa-fw"></i>
<?= $this->url->link(t('New project'), 'ProjectCreationController', 'create', array(), false, 'popover') ?></li>
<?php endif ?>
<?php if ($is_private_project_enabled): ?>
<li>
<i class="fa fa-lock fa-fw"></i>
<?= $this->url->link(t('New private project'), 'ProjectCreationController', 'createPrivate', array(), false, 'popover') ?>
</li>
<?php endif ?>
<?= $this->hook->render('template:header:creation-dropdown') ?>
</ul>
</div>
<?php endif ?>
<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>
<i class="fa fa-tachometer fa-fw"></i>
<?= $this->url->link(t('My dashboard'), 'DashboardController', 'show', array('user_id' => $this->user->getId())) ?>
</li>
<li>
<i class="fa fa-home fa-fw"></i>
<?= $this->url->link(t('My profile'), 'UserViewController', 'show', array('user_id' => $this->user->getId())) ?>
</li>
<li>
<i class="fa fa-folder fa-fw"></i>
<?= $this->url->link(t('Projects management'), 'ProjectListController', 'show') ?>
</li>
<?php if ($this->user->hasAccess('UserListController', 'show')): ?>
<li>
<i class="fa fa-user fa-fw"></i>
<?= $this->url->link(t('Users management'), 'UserListController', 'show') ?>
</li>
<li>
<i class="fa fa-group fa-fw"></i>
<?= $this->url->link(t('Groups management'), 'GroupListController', 'index') ?>
</li>
<li>
<i class="fa fa-cubes" aria-hidden="true"></i>
<?= $this->url->link(t('Plugins'), 'PluginController', 'show') ?>
</li>
<li>
<i class="fa fa-cog fa-fw"></i>
<?= $this->url->link(t('Settings'), 'ConfigController', 'index') ?>
</li>
<?php endif ?>
<?= $this->hook->render('template:header:dropdown') ?>
<li>
<i class="fa fa-life-ring fa-fw"></i>
<?= $this->url->link(t('Documentation'), 'DocumentationController', 'show') ?>
</li>
<?php if (! DISABLE_LOGOUT): ?>
<li>
<i class="fa fa-sign-out fa-fw"></i>
<?= $this->url->link(t('Logout'), 'AuthController', 'logout') ?>
</li>
<?php endif ?>
</ul>
</div>
</li>
</ul>
</nav>
<div class="grid grid-reverse grid-noGutter">
<?php if (! empty($board_selector)): ?>
<div class="col-1 col_xs-4 col_sm-3 col_md-3 col_lg-2 pull-right">
<?= $_top_right_corner ?>
</div>
<div class="col-2 col_xs-8 col_sm-9 col_md-1 col_lg-1">
<?= $this->render('header/board_selector', array('board_selector' => $board_selector)) ?>
</div>
<div class="col-9 col_xs-12 col_sm-12 col_md-8 col_lg-9">
<?= $_title ?>
</div>
<?php else: ?>
<div class="col-2 col_xs-12 pull-right">
<?= $_top_right_corner ?>
</div>
<div class="col-10 col_xs-12">
<?= $_title ?>
</div>
<?php endif ?>
</div>
</header>

View File

@ -0,0 +1,13 @@
<select id="board-selector"
class="chosen-select select-auto-redirect"
tabindex="-1"
data-search-threshold="0"
data-notfound="<?= t('No results match:') ?>"
data-placeholder="<?= t('Display another project') ?>"
data-redirect-regex="PROJECT_ID"
data-redirect-url="<?= $this->url->href('BoardViewController', 'show', array('project_id' => 'PROJECT_ID')) ?>">
<option value=""></option>
<?php foreach ($board_selector as $board_id => $board_name): ?>
<option value="<?= $board_id ?>"><?= $this->text->e($board_name) ?></option>
<?php endforeach ?>
</select>

View File

@ -0,0 +1,22 @@
<?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><i class="fa fa-plus fa-fw"></i>
<?= $this->url->link(t('New project'), 'ProjectCreationController', 'create', array(), false, 'popover') ?>
</li>
<?php endif ?>
<?php if ($is_private_project_enabled): ?>
<li>
<i class="fa fa-lock fa-fw"></i>
<?= $this->url->link(t('New private project'), 'ProjectCreationController', 'createPrivate', array(), false, 'popover') ?>
</li>
<?php endif ?>
<?= $this->hook->render('template:header:creation-dropdown') ?>
</ul>
</div>
<?php endif ?>

View File

@ -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>

View File

@ -0,0 +1,49 @@
<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>
<i class="fa fa-tachometer fa-fw"></i>
<?= $this->url->link(t('My dashboard'), 'DashboardController', 'show', array('user_id' => $this->user->getId())) ?>
</li>
<li>
<i class="fa fa-home fa-fw"></i>
<?= $this->url->link(t('My profile'), 'UserViewController', 'show', array('user_id' => $this->user->getId())) ?>
</li>
<li>
<i class="fa fa-folder fa-fw"></i>
<?= $this->url->link(t('Projects management'), 'ProjectListController', 'show') ?>
</li>
<?php if ($this->user->hasAccess('UserListController', 'show')): ?>
<li>
<i class="fa fa-user fa-fw"></i>
<?= $this->url->link(t('Users management'), 'UserListController', 'show') ?>
</li>
<li>
<i class="fa fa-group fa-fw"></i>
<?= $this->url->link(t('Groups management'), 'GroupListController', 'index') ?>
</li>
<li>
<i class="fa fa-cubes" aria-hidden="true"></i>
<?= $this->url->link(t('Plugins'), 'PluginController', 'show') ?>
</li>
<li>
<i class="fa fa-cog fa-fw"></i>
<?= $this->url->link(t('Settings'), 'ConfigController', 'index') ?>
</li>
<?php endif ?>
<?= $this->hook->render('template:header:dropdown') ?>
<li>
<i class="fa fa-life-ring fa-fw"></i>
<?= $this->url->link(t('Documentation'), 'DocumentationController', 'show') ?>
</li>
<?php if (! DISABLE_LOGOUT): ?>
<li>
<i class="fa fa-sign-out fa-fw"></i>
<?= $this->url->link(t('Logout'), 'AuthController', 'logout') ?>
</li>
<?php endif ?>
</ul>
</div>

View File

@ -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 ?>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -13,10 +13,5 @@ ul.no-bullet li
right: 3px
bottom: 3px
.web-notification-icon
color: #3366CC
&:focus, &:hover
color: #000
.assign-me
vertical-align: bottom

View File

@ -1,37 +1,14 @@
header
margin-top: 10px
padding-bottom: 10px
margin-top: 5px
margin-bottom: 5px
border-bottom: 1px solid #dedede
h1
margin: 0
padding: 0
overflow: hidden
text-overflow: ellipsis
white-space: nowrap
max-width: 70%
float: left
font-size: $page-title-size
.tooltip
font-size: $text-tiny
opacity: 0.3
ul
text-align: right
li
display: inline
padding-left: 30px
a
color: #333
text-decoration: none
&:hover
color: #666
.user-links .dropdown
margin-left: 15px
font-size: $text-tiny
nav .active a
color: #333
font-weight: bold
.menu-inline
margin-bottom: 5px
li
display: inline
padding-right: 15px
.web-notification-icon
color: #3366CC
&:focus, &:hover
color: #000

View File

@ -2,6 +2,7 @@
a
opacity: 0.5
color: #d40000
text-decoration: none
span
color: #333
a

View File

@ -25,3 +25,9 @@
font-weight: bold
&:hover, &:focus
text-decoration: underline
.menu-inline
margin-bottom: 5px
li
display: inline
padding-right: 15px

View File

@ -1,3 +1,4 @@
h1,
li,
ul,
ol,

View File

@ -20,6 +20,7 @@
"font-awesome": "fontawesome#^4.6.3",
"d3": "~3.5.0",
"isMobile": "0.4.0",
"select2": "4.0.1"
"select2": "4.0.1",
"gridlex": "^2.1.1"
}
}

View File

@ -22,7 +22,8 @@ var vendor = {
'bower_components/fullcalendar/dist/fullcalendar.min.css',
'bower_components/simplemde/dist/simplemde.min.css',
'bower_components/font-awesome/css/font-awesome.min.css',
'bower_components/c3/c3.min.css'
'bower_components/c3/c3.min.css',
'bower_components/gridlex/dist/gridlex.min.css'
],
js: [
'bower_components/jquery/dist/jquery.min.js',