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

View File

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

View File

@ -1,20 +1,24 @@
<?php <?php
use Icinga\Web\Url;
use Icinga\Web\Menu;
// Don't render a menu for unauthenticated users unless menu is auth aware // Don't render a menu for unauthenticated users unless menu is auth aware
if (! $this->auth()->isAuthenticated()) { if (! $this->auth()->isAuthenticated()) {
return; return;
} }
// Current url // Current url
$url = Icinga\Web\Url::fromRequest()->getRelativeUrl(); $url = Url::fromRequest()->remove('_render')->getRelativeUrl();
$menu = Icinga\Web\Menu::fromConfig(); $menu = Menu::fromConfig();
?> ?>
<div id="menu"> <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> <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( <?= $this->partial('parts/menu.phtml', array(
'items' => $menu->getChildren(), 'items' => $menu->getChildren(),
'url' => $url '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> </div>

View File

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