Skip to content
This repository has been archived by the owner on May 23, 2019. It is now read-only.

New dashboard experimental options: mobile mode, row height #199

Merged
merged 1 commit into from
Jul 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions web/app/dashboard/dashboard.edit.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ angular.module('app')
margins: $scope.dashboard.widget_margin ?
[$scope.dashboard.widget_margin, $scope.dashboard.widget_margin] : [5, 5],
columns: $scope.dashboard.columns || 12,
rowHeight: $scope.dashboard.row_height || 'match',
pushing: false,
floating: false,
mobileModeEnabled: false,
Expand Down
4 changes: 3 additions & 1 deletion web/app/dashboard/dashboard.view.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
margins: (vm.dashboard.widget_margin) ?
[vm.dashboard.widget_margin, vm.dashboard.widget_margin] : [5, 5],
columns: vm.dashboard.columns || 12,
rowHeight: vm.dashboard.row_height || 'match',
pushing: false,
floating: false,
mobileModeEnabled: false,
mobileModeEnabled: (vm.dashboard.mobile_mode_enabled || false),
mobileBreakpoint: (vm.dashboard.mobile_mode_enabled && vm.dashboard.mobile_breakpoint || undefined),
draggable: { enabled: false },
resizable: { enabled: false }
};
Expand Down
3 changes: 3 additions & 0 deletions web/app/menu/menu.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@
col: dashboard.col,
row: dashboard.row,
columns: dashboard.columns,
row_height: dashboard.row_height,
widget_margin: dashboard.widget_margin,
font_scale: dashboard.font_scale,
mobile_breakpoint: dashboard.mobile_breakpoint,
mobile_mode_enabled: dashboard.mobile_mode_enabled,
tile: {
background_image: dashboard.tile.background_image,
backdrop_iconset: dashboard.tile.backdrop_iconset,
Expand Down
29 changes: 26 additions & 3 deletions web/app/menu/menu.settings.tpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,25 +73,48 @@ <h3>Dashboard Settings</h3>
<br />
<div class="alert alert-warning">These options are currently experimental, unstable or targeted at advanced users! Use at your own risk.</div>
<br />
<div class="form-group" ng-class="{error: _form.tile.background_image.$error && _form.submitted}">
<div class="form-group" ng-class="{error: _form.columns.$error && _form.submitted}">
<label class="control-label col-lg-3 col-md-3">Nb. of columns (default 12)</label>
<div class="col-lg-3 col-md-3">
<input name="name" type="number" ng-model="form.columns" class="form-control" />
</div>
</div>
<div class="form-group" ng-class="{error: _form.tile.background_image.$error && _form.submitted}">
<div class="form-group" ng-class="{error: _form.row_height.$error && _form.submitted}">
<label class="control-label col-lg-3 col-md-3">Row height (%)</label>
<div class="col-lg-3 col-md-3">
<input name="name" type="number" ng-model="form.row_height" class="form-control" />
<small>Leave blank to match the column width (square grid)</small>
</div>
</div>
<div class="form-group" ng-class="{error: _form.widget_margin.$error && _form.submitted}">
<label class="control-label col-lg-3 col-md-3">Margin between widgets (default 5)</label>
<div class="col-lg-3 col-md-3">
<input name="name" type="number" ng-model="form.widget_margin" class="form-control" />
</div>
</div>
<div class="form-group" ng-class="{error: _form.tile.background_image.$error && _form.submitted}">
<div class="form-group" ng-class="{error: _form.font_scale.$error && _form.submitted}">
<label class="control-label col-lg-3 col-md-3">Font scaling (%)</label>
<div class="col-lg-3 col-md-3">
<input name="name" type="number" ng-model="form.font_scale" class="form-control" />
<small>This will increase font sizes unless they are explicitely defined in pixels</small>
</div>
</div>
<div class="form-group" ng-class="{error: _form.mobile_mode_enabled.$error && _form.submitted}">
<label class="control-label col-lg-3 col-md-3">Allow mobile mode</label>
<div class="col-lg-9 col-md-9">
<div class="checkbox">
<label>
<input type="checkbox" name="vertical" ng-model="form.mobile_mode_enabled" /> Stack widgets when screen width is below breakpoint
</label>
</div>
</div>
</div>
<div class="form-group" ng-if="form.mobile_mode_enabled" ng-class="{error: _form.mobile_breakpoint.$error && _form.submitted}">
<label class="control-label col-lg-3 col-md-3">Mobile breakpoint (px)</label>
<div class="col-lg-3 col-md-3">
<input name="name" type="number" ng-model="form.mobile_breakpoint" class="form-control" />
</div>
</div>
</uib-tab>
</uib-tabset>

Expand Down