No more layout container handling outside of layout.phtml

* Also added a few base-targets to get rid of hard-coded JS rules
This commit is contained in:
Thomas Gelf 2014-03-04 10:52:37 +00:00
parent 34d9b27be9
commit 715cad86d5
4 changed files with 18 additions and 16 deletions

View File

@ -1,9 +1,8 @@
<?php if (Icinga\Authentication\Manager::getInstance()->isAuthenticated()): ?>
<div id="layout">
<div id="header">
<ul id="notifications"></ul>
<div id="logo"><a href="<?= $this->href('/dashboard') ?>"><img src="<?= $this->href('img/logo_icinga-inv.png') ?>" class="logo" /></a>
</div>
<div id="logo"><a href="<?= $this->href('/dashboard') ?>"><img src="<?= $this->href('img/logo_icinga-inv.png') ?>" class="logo" /></a>
</div>
</div>
<!--
<ul class="tabs" >
@ -35,8 +34,6 @@
<div id="col3" class="container">
</div>
</div><!-- END of main -->
</div><!-- END of layout -->
<?php else: ?>
<?= $this->render('inline.phtml') ?>
<?php endif ?>

View File

@ -41,7 +41,10 @@ $jsfiles = array(
</head>
<body id="body">
<pre id="responsive-debug"></pre>
<div id="layout" class="default-layout">
<?= $this->render('body.phtml') ?>
</div>
<?php foreach ($jsfiles as $file): ?>
<script type="text/javascript" src="<?= $this->href($file) ?>"></script>
<?php endforeach ?>

View File

@ -1,20 +1,24 @@
<?php
use Icinga\Web\Url;
use Icinga\Web\Menu;
// Don't render a menu for unauthenticated users unless menu is auth aware
if (! $this->auth()->isAuthenticated()) {
return;
}
// Current url
$url = Icinga\Web\Url::fromRequest()->getRelativeUrl();
$menu = Icinga\Web\Menu::fromConfig();
$url = Url::fromRequest()->remove('_render')->getRelativeUrl();
$menu = Menu::fromConfig();
?>
<div id="menu">
<form action="<?= $this->href('search') ?>" method="post"><input type="text" name="q" class="search" placeholder="Search..." autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" /></form>
<div id="menu" data-base-target="col1">
<form action="<?= $this->href('search') ?>" method="post">
<input type="text" name="q" class="search" placeholder="Search..." autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />
</form>
<?= $this->partial('parts/menu.phtml', array(
'items' => $menu->getChildren(),
'url' => $url
))
?>
)) ?>
<br /><a href="<?= Url::fromPath('authentication/logout') ?>" data-base-target="layout" style="display: block; padding-left: 2.5em; color: white; text-decoration: none; font-style: italic;">Temporary Logout</a>
</div>

View File

@ -1,11 +1,10 @@
<div class="layout fullscreen login">
<div class="main">
<div id="login">
<div class="logo">
<div class="image">
<img src="<?= $this->baseUrl('img/logo_icinga_big.png') ?>" >
</div>
</div>
<div class="form">
<div class="form" data-base-target="layout">
<h1>Icinga Users Login</h1>
<?php
/* TODO: remove this as soon as notifications and forms are ready */
@ -18,4 +17,3 @@
<div class="footer">Icinga Web 2 &copy; 2013-2014 Icinga Team</div>
</div>
</div>
</div>