Add rule for 'body' container and QLink property 'target'

QLinks can now define the target for their link. Additionally, the
targte 'body' is now always the <body> tag. This allows the
modulemanager to reload the whole page (with the navigation bar).

refs #4092
This commit is contained in:
Jannis Moßhammer 2013-06-20 14:02:58 +02:00 committed by Marius Hein
parent 0f8648dcb1
commit 81e27689bb
6 changed files with 49 additions and 50 deletions

View File

@ -12,14 +12,6 @@
</div> </div>
<div id="icinga-detail" class="icinga-container " container-id="icinga-detail"> <div id="icinga-detail" class="icinga-container " container-id="icinga-detail">
<div class="container-controls">
<a class="container-expand-link" title="expand" target="_self" href="/develop/monitoring/list/services">
<i class="icon-fullscreen"></i>
</a>
<a class="container-detach-link" title="detach" target="popup" href="/develop/develop/monitoring/list/services">
<i class="icon-share"></i>
</a>
</div>
</div> </div>
</div> </div>

View File

@ -21,7 +21,7 @@
ICINGA_DEBUG = true; ICINGA_DEBUG = true;
</script> </script>
<script src="<?php echo $this->baseUrl('js/vendor/modernizr-2.6.2.min.js') ?>"></script> <script src="<?php echo $this->baseUrl('js/vendor/modernizr-2.6.2.min.js') ?>"></script>
<link rel="stylesheet" href="<?php echo $this->baseUrl('css/icinga.css') ?>"> <link rel="stylesheet" href="<?php echo $this->baseUrl('css.php') ?>">
<link rel="stylesheet" href="<?php echo $this->baseUrl('css/vendor/bootstrap-responsive.min.css') ?>"> <link rel="stylesheet" href="<?php echo $this->baseUrl('css/vendor/bootstrap-responsive.min.css') ?>">
<script data-main="<?php echo $this->baseUrl('js/main.js')?>" src="<?php echo $this->baseUrl('js/vendor/require.js') ?>"></script> <script data-main="<?php echo $this->baseUrl('js/main.js')?>" src="<?php echo $this->baseUrl('js/vendor/require.js') ?>"></script>

View File

@ -5,7 +5,8 @@
$item = $this->navigation->listAll("menu"); $item = $this->navigation->listAll("menu");
?> ?>
<?php if ($this->auth()->isAuthenticated()): ?> <?php if (true || $this->auth()->isAuthenticated()): ?>
<ul class="nav nav-tabs icinga-navigation" > <ul class="nav nav-tabs icinga-navigation" >
<?php <?php
$activeSet = false; $activeSet = false;

View File

@ -36,6 +36,9 @@ class Zend_View_Helper_Qlink extends Zend_View_Helper_Abstract
$quote = $val; $quote = $val;
continue; continue;
} }
if ($key === 'target') {
$attibutes[] = 'target="'.$val.'"';
}
if ($key === 'style' && is_array($val)) { if ($key === 'style' && is_array($val)) {
if (empty($val)) { if (empty($val)) {
continue; continue;

View File

@ -41,20 +41,27 @@ define(['jquery','logging','icinga/util/async'],function($,log,async) {
if(typeof target === "undefined") { if(typeof target === "undefined") {
if(a.parents("#icinga-detail").length) { if(a.parents("#icinga-detail").length) {
log.debug("Parent is detail, loading into detail");
async.loadToTarget("icinga-detail",href); async.loadToTarget("icinga-detail",href);
} else { } else {
log.debug("Parent is not detail, loading into main");
async.loadToTarget("icinga-main",href); async.loadToTarget("icinga-main",href);
} }
} else { } else {
switch(target) { switch(target) {
case "body":
async.loadToTarget("body", href);
break;
case "main": case "main":
async.loadToTarget("icinga-main",href); async.loadToTarget("icinga-main",href);
collapseDetailView(); collapseDetailView();
break; break;
case "detail": case "detail":
log.debug("Target: detail");
async.loadToTarget("icinga-detail",href); async.loadToTarget("icinga-detail",href);
break; break;
case "popup": case "popup":
log.debug("No target");
async.loadToTarget(null,href); async.loadToTarget(null,href);
break; break;
default: default:
@ -88,7 +95,5 @@ define(['jquery','logging','icinga/util/async'],function($,log,async) {
} }
}; };
}; };
return new MainDetailBehaviour(); return new MainDetailBehaviour();
}); });

View File

@ -5,11 +5,9 @@
define(['icinga/container','logging','icinga/behaviour','jquery'],function(containerMgr,log,behaviour,$) { define(['icinga/container','logging','icinga/behaviour','jquery'],function(containerMgr,log,behaviour,$) {
var pending = { var pending = {
}; };
var getDOMForDestination = function(destination) { var getDOMForDestination = function(destination) {
var target = destination; var target = destination;
if(typeof destination === "string") { if(typeof destination === "string") {
@ -84,6 +82,7 @@
this.loadToTarget = function(destination,url,data) { this.loadToTarget = function(destination,url,data) {
if(destination) { if(destination) {
log.debug("Laoding to container", destination, url);
this.clearPendingRequestsFor(destination); this.clearPendingRequestsFor(destination);
} }
var req = this.createRequest(url,data); var req = this.createRequest(url,data);
@ -105,5 +104,4 @@
}; };
return new CallInterface(); return new CallInterface();
}); });
})(); })();