summaryrefslogtreecommitdiffstats
path: root/modules-available/locations
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-07 17:07:15 +0100
committerSimon Rettberg2017-12-07 17:07:15 +0100
commita535a3904dad7333ea77213af591bc2bf1aeaba3 (patch)
tree8835f9c68bc538cecce3d071a7c57e4a9ab99b00 /modules-available/locations
parent[statistics] location filter: Support recursive matching by (ab)using ~ and !~ (diff)
downloadslx-admin-a535a3904dad7333ea77213af591bc2bf1aeaba3.tar.gz
slx-admin-a535a3904dad7333ea77213af591bc2bf1aeaba3.tar.xz
slx-admin-a535a3904dad7333ea77213af591bc2bf1aeaba3.zip
[locations] Redesign machine count column, make both counts clickable
Diffstat (limited to 'modules-available/locations')
-rw-r--r--modules-available/locations/page.inc.php1
-rw-r--r--modules-available/locations/templates/locations.html23
2 files changed, 12 insertions, 12 deletions
diff --git a/modules-available/locations/page.inc.php b/modules-available/locations/page.inc.php
index 511757fe..0cfa5b90 100644
--- a/modules-available/locations/page.inc.php
+++ b/modules-available/locations/page.inc.php
@@ -377,6 +377,7 @@ class Page_Locations extends Page
unset($loc);
foreach ($locs as $loc) {
foreach ($loc['parents'] as $pid) {
+ $locs[(int)$pid]['hasChild'] = true;
$locs[(int)$pid]['clientCountSum'] += $loc['clientCount'];
}
}
diff --git a/modules-available/locations/templates/locations.html b/modules-available/locations/templates/locations.html
index 02428323..be3d5115 100644
--- a/modules-available/locations/templates/locations.html
+++ b/modules-available/locations/templates/locations.html
@@ -41,12 +41,12 @@
<td class="text-nowrap" align="right">
{{^linkClass}}
{{#havestatistics}}
- {{clientCount}}
- <span class="text-muted">
- /
- <span style="display:inline-block;width:3ex">{{clientCountSum}}</span>
+ <a href="?do=Statistics&amp;show=list&amp;filters=location={{locationid}}">&nbsp;{{clientCount}}&nbsp;</a>
+ <span style="display:inline-block;width:5ex">
+ {{#hasChild}}
+ (<a href="?do=Statistics&amp;show=list&amp;filters=location~{{locationid}}">&downarrow;{{clientCountSum}}</a>)
+ {{/hasChild}}
</span>
- <a class="btn btn-default btn-xs" href="?do=Statistics&amp;show=list&amp;filters=location={{locationid}}"><span class="glyphicon glyphicon-eye-open"></span></a>
{{/havestatistics}}
{{/linkClass}}
</td>
@@ -87,9 +87,8 @@
<tr>
<td>{{lang_unassignedMachines}}</td>
<td class="text-nowrap" align="right">
- {{unassignedCount}}
- <a class="btn btn-default btn-xs" href="?do=Statistics&amp;show=list&amp;filters=location=0">
- <span class="glyphicon glyphicon-eye-open"></span>
+ <a href="?do=Statistics&amp;show=list&amp;filters=location=0">
+ &nbsp;{{unassignedCount}}&nbsp;
</a>
</td>
<td class="text-nowrap" align="right">
@@ -103,16 +102,16 @@
<form method="post" action="?do=Locations">
<input type="hidden" name="token" value="{{token}}">
<input type="hidden" name="action" value="addlocations">
- <table class="table table-condensed table-hover">
+ <table class="table table-condensed">
<tr id="lasttr">
<td width="60%">&emsp;</td>
<td class="text-right" colspan="2">
- <button id="saveLocationRows" type="submit" class="btn btn-primary" style="display: none">
- <span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}
- </button>
<button {{^addAllowed}}disabled{{/addAllowed}} class="btn btn-success" type="button" onclick="slxAddLocationRow()">
<span class="glyphicon glyphicon-plus"></span> {{lang_location}}
</button>
+ <button id="saveLocationRows" type="submit" class="btn btn-primary collapse">
+ <span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}
+ </button>
</td>
</tr>
</table>