Skip to content
Snippets Groups Projects
Commit f28b00b2 authored by Axel Hahn's avatar Axel Hahn
Browse files

- added: skip dereferenced tags in git (tags ending ^{} )

- added: modal infobox in build page if you switch the branch
- added: git uses a cache for taglist and revision infos (ttl is 5 min)
- added client dubugging (axels ip)
- reactivated: menu project->actipons->cleanup to delete the cache
- changed: cut commit message a bit: do not show * [new branch]
parent 1e35274b
Branches
No related tags found
No related merge requests found
......@@ -177,9 +177,9 @@ function getTopArea() {
<ul class="dropdown-menu">
<!--
<li><a href="' . $sBaseUrl . $aParams["prj"] . '/build/">' . t("menu-project-build") . '</a></li>
<li><a href="' . $sBaseUrl . $aParams["prj"] . '/cleanup/">' . t("menu-project-cleanup") . '</a></li>
-->
<li><a href="' . $sBaseUrl . $aParams["prj"] . '/setup/">' . t("menu-project-settings") . '</a></li>
<li><a href="' . $sBaseUrl . $aParams["prj"] . '/cleanup/">' . t("menu-project-cleanup") . '</a></li>
<li><a href="' . $sBaseUrl . $aParams["prj"] . '/delete/">' . t("menu-project-delete") . '</a></li>
';
$sReturn.='</ul></li>';
......@@ -247,6 +247,145 @@ function getTopArea() {
return $sReturn;
}
/**
* auto generate upper part of the page with header and navigation
* @global type $aParams
* @return type
*/
function getTopArea__bs3() {
global $aParams, $sImageBase, $aImages, $aConfig;
$sReturn = '';
require_once("./classes/project.class.php");
require_once("./classes/user.class.php");
$oUser = new user();
$sMyPhase = "[phase]";
$sMyRev = " [no rev] ";
$sJsonfile = $_SERVER["DOCUMENT_ROOT"] . "ci-webgui.json";
if (file_exists($sJsonfile)) {
$aJson = json_decode(file_get_contents($sJsonfile), true);
if (array_key_exists("date", $aJson))
$sMyRev = $aJson["date"];
}
$sBaseUrl = '/deployment/';
$sWikiBaseUrl = 'https://secure.iml.unibe.ch/wiki/doku.php';
$sReturn = '
<span id="top"></span>
<nav class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><span class="brand">IML Deployment<br>GUI</span></li>
<li class="dropdown';
if (!array_key_exists("prj", $aParams))
$sReturn.=' active';
$sReturn.='">' . str_replace('</a>', ' <b class="caret"></b></a>', aHome("")) . '
<ul class="dropdown-menu" role="menu">
<li><a href="' . $sBaseUrl . 'all/setup/">' . t("menu-settings") . '</a></li>
<li><a href="' . $sBaseUrl . 'all/setup/actionlog/">' . t("menu-logs") . '</a></li>
<li><a href="' . $sBaseUrl . 'all/setup/new/">' . t("menu-new-project") . '</a></li>
</ul>
</li>
<!-- list of projects -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . t("menu-projects") . '<b class="caret"></b></a>
<ul class="dropdown-menu" role="menu">
';
$oPrj1 = new project();
foreach ($oPrj1->getProjects() as $sPrj) {
$oPrj = new project($sPrj);
$sReturn.='<li><a href="' . $sBaseUrl . $sPrj . '/">' . $oPrj->getLabel() . '</a></li>';
}
$sReturn.='
</ul>
</li>';
if (array_key_exists("prj", $aParams) && $aParams["prj"] <> "all") {
$oPrj = new project($aParams["prj"]);
$sReturn.='
<li class="active">' . aPrjHome(" ") . '</li>
';
if (array_key_exists("action", $aParams) and FALSE) {
$sReturn.='<li><a href="#">Aktion: ' . $aParams["action"] . '</a></li>';
} else {
$sReturn.='
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . t("menu-project-actions") . '<b class="caret"></b></a>
<ul class="dropdown-menu">
<!--
<li><a href="' . $sBaseUrl . $aParams["prj"] . '/build/">' . t("menu-project-build") . '</a></li>
<li><a href="' . $sBaseUrl . $aParams["prj"] . '/cleanup/">' . t("menu-project-cleanup") . '</a></li>
-->
<li><a href="' . $sBaseUrl . $aParams["prj"] . '/setup/">' . t("menu-project-settings") . '</a></li>
<li><a href="' . $sBaseUrl . $aParams["prj"] . '/delete/">' . t("menu-project-delete") . '</a></li>
';
$sReturn.='</ul></li>';
$aPhases = $oPrj->getActivePhases();
if (count($aPhases)) {
$sReturn.='<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">' . t("menu-project-phases") . '<b class="caret"></b></a>
<ul class="dropdown-menu">';
foreach ($aPhases as $sPhase) {
$sReturn.='<li><a href="' . $sBaseUrl . $aParams["prj"] . '/phase/' . $sPhase . '/">' . $sPhase . '</a></li>';
}
$sReturn.='</ul></li>';
}
}
}
$sReturn.='
<!--
<li>
<a href="#" >Irgend...</a>
</li>
-->
</ul>
<ul class="nav navbar-nav navbar-right">
<!-- userdata -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">user: ' . $oUser->getUsername() . '<b class="caret"></b></a>
<ul class="dropdown-menu" style="width: 300px;">
<li>groups: <pre>' . print_r($oUser->getUserGroups(), true) . '</pre></li>
<li>roles: <pre>' . print_r($oUser->getUserRoles(), true) . '</pre></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class=" icon-question-sign"></i> ' . t("menu-help") . '<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="' . $sWikiBaseUrl . '/it/entwicklung/continuous_deployment">WIKI: Übersicht Continous Deployment</a></li>
<li><a href="' . $sWikiBaseUrl . '/it/entwicklung/continuous_deployment#konventionen">WIKI: Konventionen für Entwickler</a></li>
<li><a href="' . $sWikiBaseUrl . '/it/infrastruktur/dienste/puppet/snippets#iml-deployment">WIKI (Admin): Puppet-Snippets für den Sysadmin</a></li>
<li><a href="' . $sWikiBaseUrl . '/it/infrastruktur/dienste/imldeployment">WIKI (Admin): Verzeichnisse und Dateien</a></li>
<li><a href="/deployment/all/doc/">' . t("menu-help-classes") . '</a></li>
</ul>
</li>
</ul>
</div>
<span class="version ">' . $sMyRev . ' @ ' . php_uname("n") . '</span>
</div></nav><div id="header2">';
if (!array_key_exists("prj", $aParams)) {
$sReturn.='<img src="' . $sImageBase . $aImages['overview'] . '" id="imgtop" alt="">'
. '<h1>' . t("overview-label") . '</h1><span class="description">' . t("overview-hint") . '</span>';
} else {
if ($aParams["prj"] <> "all") {
$oPrj = new project($aParams["prj"]);
$sReturn.='<img src="' . $sImageBase . $aImages['project'] . '" id="imgtop" alt="">
<h1>' . $oPrj->getLabel() . '</h1><span class="description">' . $oPrj->getDescription() . '</span>';
if (array_key_exists("action", $aParams)) {
// $sReturn.='<h2>Aktion: '.$aParams["action"].'</h2>';
}
}
}
$sReturn.='</div>';
return $sReturn;
}
/**
* get h2 headline with action
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment