summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/index.php
diff options
context:
space:
mode:
authorJared Dillard <jdillard@netgate.com>2015-12-01 11:29:37 -0600
committerJared Dillard <jdillard@netgate.com>2015-12-01 11:29:42 -0600
commit477db9337939aa606c76edba77394b39a03467a9 (patch)
treee9ba159b78499333300867df0f58265e240ebd76 /src/usr/local/www/index.php
parente226c360099cd3f412d9780f35e685f6461ec4b0 (diff)
downloadpfsense-477db9337939aa606c76edba77394b39a03467a9.zip
pfsense-477db9337939aa606c76edba77394b39a03467a9.tar.gz
add option to choose number of dashboard columns
Diffstat (limited to 'src/usr/local/www/index.php')
-rw-r--r--src/usr/local/www/index.php22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/usr/local/www/index.php b/src/usr/local/www/index.php
index 43846fe..b98e0d3 100644
--- a/src/usr/local/www/index.php
+++ b/src/usr/local/www/index.php
@@ -370,8 +370,13 @@ foreach ($widgets as $widgetname => $widgetconfig)
?>
<div class="row">
+ <?php
+ $columnWidth = 12 / $numColumns;
+ $columnCounter = 0;
+ //TODO: account for user stepping # of columns down
+ ?>
<?php foreach ($widgetColumns as $column => $columnWidgets):?>
- <div class="col-md-6" id="widgets-<?=$column?>">
+ <div class="col-md-<?=$columnWidth?>" id="widgets-<?=$column?>">
<?php foreach ($columnWidgets as $widgetname => $widgetconfig):?>
<div class="panel panel-default" id="widget-<?=$widgetname?>">
<div class="panel-heading">
@@ -393,9 +398,16 @@ foreach ($widgets as $widgetname => $widgetconfig)
<?php include('/usr/local/www/widgets/widgets/'. $widgetname.'.widget.php'); ?>
</div>
</div>
-<?php endforeach; ?>
+<?php endforeach;
+ $columnCounter++;
+?>
</div>
<?php endforeach; ?>
+<?php
+ for($n = 1; $n <= ($numColumns - $columnCounter); $n++) {
+ echo '<div class="col-md-' . $columnWidth . '" id="widgets-col' . ($n + $columnCounter) . '"></div>';
+ }
+?>
</div>
<script type="text/javascript">
@@ -404,7 +416,7 @@ function updateWidgets(newWidget)
{
var sequence = '';
- $('.container .col-md-6').each(function(idx, col){
+ $('.container .col-md-<?=$columnWidth?>').each(function(idx, col){
$('.panel', col).each(function(idx, widget){
var isOpen = $('.panel-body', widget).hasClass('in');
@@ -430,10 +442,10 @@ events.push(function() {
});
// Make panels sortable
- $('.container .col-md-6').sortable({
+ $('.container .col-md-<?=$columnWidth?>').sortable({
handle: '.panel-heading',
cursor: 'grabbing',
- connectWith: '.container .col-md-6',
+ connectWith: '.container .col-md-<?=$columnWidth?>',
update: updateWidgets
});
OpenPOWER on IntegriCloud