diff options
author | Simon Rettberg | 2016-07-29 17:17:10 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-07-29 17:17:10 +0200 |
commit | 24d5858aa33b57f7d7fbac77461709760be35338 (patch) | |
tree | 5522af02545767b9ab38da71aceca2b6ebcd7e6b /modules-available/statistics | |
parent | [statistics] Make filtering more dynamic, remove hard cutoff from summary (diff) | |
download | slx-admin-24d5858aa33b57f7d7fbac77461709760be35338.tar.gz slx-admin-24d5858aa33b57f7d7fbac77461709760be35338.tar.xz slx-admin-24d5858aa33b57f7d7fbac77461709760be35338.zip |
[statistics] Fix minor layout issues
Diffstat (limited to 'modules-available/statistics')
-rw-r--r-- | modules-available/statistics/page.inc.php | 17 | ||||
-rw-r--r-- | modules-available/statistics/templates/filterbox.html | 59 |
2 files changed, 40 insertions, 36 deletions
diff --git a/modules-available/statistics/page.inc.php b/modules-available/statistics/page.inc.php index 7ffe2562..561c52b9 100644 --- a/modules-available/statistics/page.inc.php +++ b/modules-available/statistics/page.inc.php @@ -162,7 +162,9 @@ class Page_Statistics extends Page $show = Request::get('show', 'stat', 'string'); if ($show == 'list') { + Render::openTag('div', array('class' => 'row')); $this->showFilter('list', $filterSet); + Render::closeTag('div'); $this->showMachineList($filterSet); return; } @@ -189,9 +191,15 @@ class Page_Statistics extends Page 'sortDirection' => $filterSet->getSortDirection(), 'sortColumn' => $filterSet->getSortColumn(), 'columns' => json_encode(Page_Statistics::$columns), - 'showList' => 1); + ); - $data['showList'] = ($show == 'list'); + if ($show === 'list') { + $data['listButtonClass'] = 'btn-primary'; + $data['statButtonClass'] = 'btn-default'; + } else { + $data['listButtonClass'] = 'btn-default'; + $data['statButtonClass'] = 'btn-primary'; + } $locsFlat = array(); @@ -205,11 +213,6 @@ class Page_Statistics extends Page } $data['locations'] = json_encode($locsFlat); - // if($show == 'list') { - // $data['showList'] = true; - // } else { - // $data['showList'] = false; - // } Render::addTemplate('filterbox', $data); diff --git a/modules-available/statistics/templates/filterbox.html b/modules-available/statistics/templates/filterbox.html index a8a36adb..a5370a0b 100644 --- a/modules-available/statistics/templates/filterbox.html +++ b/modules-available/statistics/templates/filterbox.html @@ -1,12 +1,14 @@ -<div id="modal-add-filter" class="modal modal-sm fade" role="dialog" style="position:absolute; min-width:600px; min-height: 400px;margin:auto"> +<div id="modal-add-filter" class="modal modal-sm fade" role="dialog" + style="position:absolute; min-width:600px; min-height: 400px;margin:auto"> <div class="modal-content"> <div class="modal-header"> - <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button> + <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span + class="sr-only">Close</span></button> {{lang_add_filter}} </div> <form class="modal-body form-inline center"> <div class="form-group"> - <select id="columnSelect" name="column" class="form-control col-4-xs"> </select> + <select id="columnSelect" name="column" class="form-control col-4-xs"> </select> </div> <div class="form-group"> <select id="operatorSelect" name="operator" class="form-control col-4-xs"> </select> @@ -15,42 +17,41 @@ <input name="argument" id="argumentInput" class="form-control col-4-xs"> </input> <select name="argument" id="argumentSelect" class="form-control col-4-xs"> </select> </div> - <button type="button" class="btn btn-primary" onclick="addFilterFromForm()" > + <button type="button" class="btn btn-primary" onclick="addFilterFromForm()"> <span class="glyphicon glyphicon-plus"></span> - {{lang_add}}</button> + {{lang_add}} + </button> </form> </div> </div> -<div style="height:120px"> +<div style="height:120px" class="col-xs-12"> <!-- use GET here, to avoid the "resend form?" confirmation, and anyway this is stateless, so GET makes more sense --> <form id="queryForm" method="GET" action="?do=Statistics" class="" role="form"> - <input type="hidden" name="do" value="Statistics"/> - <label for="filters">{{lang_labelFilter}}</label> - <input type="text" name="filters" class="" id="filterInput"/> - <input type="hidden" name="sortColumn" id="sortColumn" value="{{sortColumn}}"/> - <input type="hidden" name="sortDirection" id="sortDirection" value="{{sortDirection}}"/> - - <button type="button" class="btn btn-success" onclick="popupFilter(null)"> - <span class="glyphicon glyphicon-plus"></span> - {{lang_add_filter}}</button> - <button class="btn btn-primary pull-right" type="submit" name="show" value="{{show}}"> - <span class="glyphicon glyphicon-refresh"></span> - {{lang_refresh}}</button> - {{#showList}} - <button class="btn btn-secondary pull-right" type="submit" name="show" value="stat"> + <input type="hidden" name="do" value="Statistics"/> + <label for="filterInput">{{lang_labelFilter}}</label> + <input type="text" name="filters" class="" id="filterInput"/> + <input type="hidden" name="sortColumn" id="sortColumn" value="{{sortColumn}}"/> + <input type="hidden" name="sortDirection" id="sortDirection" value="{{sortDirection}}"/> + + <button type="button" class="btn btn-success pull-left" onclick="popupFilter(null)"> + <span class="glyphicon glyphicon-plus"></span> + {{lang_add_filter}} + </button> + <div class="btn-group pull-right"> + <button class="btn {{statButtonClass}}" type="submit" name="show" value="stat"> <span class="glyphicon glyphicon-stats"></span> - {{lang_showVisualization}}</button> - {{/showList}} - {{^showList}} - <button class="btn btn-secondary pull-right" type="submit" name="show" value="list"> + {{lang_showVisualization}} + </button> + <button class="btn {{listButtonClass}}" type="submit" name="show" value="list"> <span class="glyphicon glyphicon-list"></span> - {{lang_showList}}</button> - {{/showList}} -</form> -<br/> -<br/> + {{lang_showList}} + </button> + </div> + </form> + <br/> + <br/> </div> <script type="application/javascript"><!-- |