From 4cea305676e2922f7766da92bcb64b17060ba146 Mon Sep 17 00:00:00 2001 From: hahn <axel.hahn@iml.unibe.ch> Date: Tue, 26 Nov 2013 11:11:11 +0100 Subject: [PATCH] =?UTF-8?q?-=20filter:=20in=20der=20=C3=9Cbersicht=20in=20?= =?UTF-8?q?lokalen=20Variablen=20merken=20-=20filter:=20reset=20button=20z?= =?UTF-8?q?eigen,=20wenn=20ein=20Filter=20aktiv=20ist=20-=20Projekt-=C3=9C?= =?UTF-8?q?bersicht=20mit=20Tabs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public_html/deployment/act_overview.php | 113 ++++++++++-------- .../deployment/classes/projectlist.class.php | 80 +++++++++++-- public_html/deployment/main.css | 6 +- 3 files changed, 135 insertions(+), 64 deletions(-) diff --git a/public_html/deployment/act_overview.php b/public_html/deployment/act_overview.php index daf7d8a2..bffae03e 100644 --- a/public_html/deployment/act_overview.php +++ b/public_html/deployment/act_overview.php @@ -1,50 +1,63 @@ -<?php -/* ###################################################################### - - IML DEPLOYMENT - - webgui - overview - * for all projects - * for a single project - - --------------------------------------------------------------------- - 2013-11-08 Axel <axel.hahn@iml.unibe.ch> - ###################################################################### */ - -require_once("./config/inc_projects_config.php"); - -if (!array_key_exists("prj", $aParams)) { - - // overview over all projects - require_once("./classes/projectlist.class.php"); - $oPrjList = new projectlist(); - - $sPhpOut = $oPrjList->renderOverview(); -} else { - require_once("./classes/project.class.php"); - $oPrj = new project($aParams["prj"]); - $sPhpOut = ' - <div class="infobox" style="float: right;"> - <h3>Steckbrief</h3> - ' . $oPrj->renderProjektInfos() . ' - </div> - <h3>Phasen</h3>'; - - if ($oPrj->getActivePhases()) { - $sPhpOut.=' - <p> - Für das Projekt sind folgende Phasen konfiguriert: - </p> - ' . $oPrj->renderPhaseInfo() . '<br> - ' . $oPrj->renderLink("build") . '<br><br> - - <h3>Build-Versionen</h3> - ' . $oPrj->renderVersionUsage(); - } else { - $sPhpOut.=getBox("info", "Es wurde noch keine URL in keiner der Phasen definiert") . - $oPrj->renderLink("setup"); - } - $sPhpOut .= '<div style="clear: both"></div>'; -} -?> - +<?php +/* ###################################################################### + + IML DEPLOYMENT + + webgui - overview + * for all projects + * for a single project + + --------------------------------------------------------------------- + 2013-11-08 Axel <axel.hahn@iml.unibe.ch> + ###################################################################### */ + +require_once("./config/inc_projects_config.php"); + +if (!array_key_exists("prj", $aParams)) { + + // overview over all projects + require_once("./classes/projectlist.class.php"); + $oPrjList = new projectlist(); + + $sPhpOut = $oPrjList->renderOverview(); +} else { + require_once("./classes/project.class.php"); + $oPrj = new project($aParams["prj"]); + $sPhpOut = ' + <div class="infobox" style="float: right;"> + <h3>Steckbrief</h3> + ' . $oPrj->renderProjektInfos() . ' + </div> + + + <h3>Phasen</h3>'; + + if ($oPrj->getActivePhases()) { + $sPhpOut.=' + <div class="tabbable"> + <ul class="nav nav-tabs" style="float: left; width: 50%;"> + <li class="active"><a href="#tab1" data-toggle="tab">Phasen</a></li> + <li><a href="#tab2" data-toggle="tab">Builds</a></li> + </ul> + <div class="tab-content" style="clear: left;"> + <div class="tab-pane active" id="tab1"> + <p> + Für das Projekt sind folgende Phasen konfiguriert: + </p> + ' . $oPrj->renderPhaseInfo() . '<br> + ' . $oPrj->renderLink("build") . '<br><br> + + </div> + <div class="tab-pane" id="tab2"> + ' . $oPrj->renderVersionUsage().' + </div> + </div> + </div>'; + } else { + $sPhpOut.=getBox("info", "Es wurde noch keine URL in keiner der Phasen definiert") . + $oPrj->renderLink("setup"); + } + $sPhpOut .= '<div style="clear: both"></div>'; +} +?> + diff --git a/public_html/deployment/classes/projectlist.class.php b/public_html/deployment/classes/projectlist.class.php index 37f2aea6..0af9a416 100644 --- a/public_html/deployment/classes/projectlist.class.php +++ b/public_html/deployment/classes/projectlist.class.php @@ -116,15 +116,25 @@ class projectlist { $sOut = ' <script> + /** + * filter table by chosen select values for project and phase + */ function filterOverviewTable(){ var sPrj=$("#prjfilter").val(); var sPhase=$("#phasefilter").val(); + localStorage.setItem("selectedPrj", sPrj); + localStorage.setItem("selectedPhase", sPhase); $(\'.'.$sTrClass.'\').hide(); $(\'.\' + sPrj).show(); $(\'.'.$sColClass.'\').hide(); $(\'.\' + sPhase).show(); + showResetbtn(); } + /** + * filter table and tiles by filtertext + */ function filterTable(){ var sSearch=$("#efilter").val(); + localStorage.setItem("efilter", sSearch); var Regex = new RegExp(sSearch, "i"); $(".trproject").each(function() { sVisible="none"; @@ -133,9 +143,13 @@ class projectlist { } $(this).css("display", sVisible); }); - + showResetbtn(); + return false; } + /** + * switch view between tiles and table + */ function setview(sMode){ $(\'.view\').hide(); $(\'.view\'+sMode).show(); @@ -143,9 +157,48 @@ class projectlist { return false; } + /** + * set default view; it gets the last values for filter text, + * and selected values in dropdowns and restores the + * last view + */ function setDefaultView(){ + + var sPrj=$("#prjfilter").val(localStorage.getItem("selectedPrj")); + var sPhase=$("#phasefilter").val(localStorage.getItem("selectedPhase")); + window.setTimeout("filterOverviewTable();", 50); + + $("#efilter").val(localStorage.getItem("efilter")); + // filterTable(); + window.setTimeout("filterTable();", 50); + var sMode=localStorage.getItem("mode"); if (sMode)setview(sMode); + + } + + /** + * Button zum Filter reset anzeigen/ verbergen + */ + function showResetbtn(){ + sVisible=($("#efilter").val())?"visible":"hidden"; + if ($("#prjfilter").val()!="'.$sTrClass.'")sVisible="visible"; + if ($("#phasefilter").val()!="'.$sColClass.'")sVisible="visible"; + $("#btnresetfilter").css("visibility", sVisible); + return false; + } + + /** + * Aktion des Filter reset: Filter zurücksetzen + */ + function resetFilter(){ + $("#prjfilter").val(""); + $("#phasefilter").val(""); + filterOverviewTable(); + $("#efilter").val(""); + window.setTimeout("filterTable();", 10); + showResetbtn(); + return false; } </script> <div class="filterbar"> @@ -163,17 +216,22 @@ class projectlist { onKeyup="filterTable(); " > <span class="view viewextended"> - - Projekt-Filter: - <select id="prjfilter" onchange="filterOverviewTable(); return false;"> - '.$sPrjFilter.' - </select> - - Phasen: - <select id="phasefilter" onchange="filterOverviewTable(); return false;"> - '.$sPhaseFilter.' - </select> + + Projekt-Filter: + <select id="prjfilter" onchange="filterOverviewTable(); return false;"> + '.$sPrjFilter.' + </select> + + Phasen: + <select id="phasefilter" onchange="filterOverviewTable(); return false;"> + '.$sPhaseFilter.' + </select> + + <a href="#" class="btn" id="btnresetfilter" + title="Filter zurücksetzen" + onclick="resetFilter();">Reset</a> </span> + </div> diff --git a/public_html/deployment/main.css b/public_html/deployment/main.css index 193eabb1..0d929e63 100644 --- a/public_html/deployment/main.css +++ b/public_html/deployment/main.css @@ -87,9 +87,9 @@ thead{font-size: 130%;} #tbloverview td{} th.prj{background:#f8f8f8;} th.versioncontrol{background: #ccc;} -th.preview{background:#358; color:#eee;} -th.stage{background:#388; color:#eee;} -th.live{background:#3a3; color: #eee; } +th.preview{background:#358; background: linear-gradient(#ddd,#358,#358); color:#eee; } +th.stage{background:#388; background: linear-gradient(#ddd,#388,#388); color:#eee; } +th.live{background:#3a3; background: linear-gradient(#ddd,#3a3,#3a3); color:#eee; } tr{background: linear-gradient(#fff,#fff,#fff,#fff,#eee);} tr:hover{background:#ddd; background: linear-gradient(#ddd,#eee,#ddd);} -- GitLab