mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
latest bits
This commit is contained in:
@ -61,18 +61,22 @@ angular.module('biomed', ['biomed.filters', 'biomed.services', 'biomed.directive
|
||||
templateUrl: '/partials/clients/edit.html',
|
||||
controller: "ClientEditCtrl"
|
||||
})
|
||||
.when('/devices', {
|
||||
templateUrl: '/partials/devices/index.html',
|
||||
controller: "DeviceIndexCtrl",
|
||||
.when('/deviceTypes', {
|
||||
templateUrl: '/partials/deviceTypes/index.html',
|
||||
controller: "DeviceTypeIndexCtrl",
|
||||
reloadOnSearch: false
|
||||
})
|
||||
.when('/devices/add', {
|
||||
templateUrl: '/partials/devices/add.html',
|
||||
controller: "DeviceAddCtrl"
|
||||
})
|
||||
.when('/devices/:id', {
|
||||
templateUrl: '/partials/devices/edit.html',
|
||||
controller: "DeviceEditCtrl"
|
||||
.when('/deviceTypes/add', {
|
||||
templateUrl: '/partials/deviceTypes/add.html',
|
||||
controller: "DeviceTypeAddCtrl"
|
||||
})
|
||||
.when('/deviceTypes/:id', {
|
||||
templateUrl: '/partials/deviceTypes/edit.html',
|
||||
controller: "DeviceTypeEditCtrl"
|
||||
})
|
||||
.when('/accounting', {
|
||||
templateUrl: '/partials/accounting/index.html',
|
||||
|
@ -588,9 +588,7 @@ angular.module('biomed')
|
||||
updatePms();
|
||||
});
|
||||
|
||||
$scope.tags = Clients.tags($routeParams, function() {
|
||||
|
||||
});
|
||||
$scope.devices = Clients.devices($routeParams);
|
||||
|
||||
$scope.identification = createController();
|
||||
$scope.address = createController();
|
||||
@ -705,256 +703,6 @@ angular.module('biomed')
|
||||
}
|
||||
})
|
||||
|
||||
.controller("DeviceIndexCtrl", function($scope, $filter, $routeParams, Devices, LocationBinder) {
|
||||
$scope.loading = true;
|
||||
|
||||
var allData = Devices.index(function() {
|
||||
$scope.loading = false;
|
||||
$scope.filter();
|
||||
});
|
||||
|
||||
var filteredData = [];
|
||||
var index = 0;
|
||||
var initialPageSize = 100;
|
||||
var pageSize = 5;
|
||||
|
||||
$scope.canLoad = true;
|
||||
|
||||
$scope.$watch('query', function() {
|
||||
$scope.filter();
|
||||
});
|
||||
|
||||
LocationBinder($scope, ['query']);
|
||||
|
||||
$scope.filter = function() {
|
||||
filteredData = $filter('orderBy')($filter('filter')(allData, $scope.query), $scope.sort.column, $scope.sort.descending);
|
||||
index = initialPageSize;
|
||||
$scope.canLoad = true;
|
||||
$scope.devices = filteredData.slice(0, initialPageSize);
|
||||
};
|
||||
|
||||
$scope.addItems = function() {
|
||||
$scope.devices = $scope.devices.concat(filteredData.slice(index, index + pageSize));
|
||||
index += pageSize;
|
||||
$scope.canLoad = index < filteredData.length;
|
||||
}
|
||||
|
||||
$scope.sort = {
|
||||
column: 'deviceType',
|
||||
descending: false
|
||||
};
|
||||
|
||||
$scope.selectedCls = function(column) {
|
||||
return column == $scope.sort.column && 'sort-' + $scope.sort.descending;
|
||||
}
|
||||
|
||||
$scope.changeSorting = function(column) {
|
||||
var sort = $scope.sort;
|
||||
if (sort.column == column) {
|
||||
sort.descending = !sort.descending;
|
||||
} else {
|
||||
sort.column = column;
|
||||
sort.descending = false;
|
||||
}
|
||||
|
||||
$scope.filter();
|
||||
};
|
||||
})
|
||||
|
||||
.controller("DeviceAddCtrl", function($scope, Devices, $location, $filter) {
|
||||
$scope.model = {};
|
||||
|
||||
$scope.deviceTypes = Devices.deviceTypes();
|
||||
$scope.deviceMakes = Devices.makes();
|
||||
|
||||
$scope.deviceTypeOpts = {
|
||||
containerCssClass: 'input-xxlarge',
|
||||
placeholder: 'Choose a Device Type',
|
||||
query: function(query) {
|
||||
var data = $filter('filter')($scope.deviceTypes, query.term);
|
||||
var results = [];
|
||||
data.forEach(function(item) {
|
||||
results.push({id: item, text: item});
|
||||
});
|
||||
query.callback({results: results });
|
||||
},
|
||||
createSearchChoice: function(term) {
|
||||
return { id: term, text: term };
|
||||
}
|
||||
};
|
||||
|
||||
$scope.makeOpts = {
|
||||
containerCssClass: 'input-xxlarge',
|
||||
placeholder: 'Choose a Device Make',
|
||||
query: function(query) {
|
||||
var data = $filter('filter')($scope.deviceMakes, query.term);
|
||||
var results = [];
|
||||
data.forEach(function(item) {
|
||||
results.push({id: item, text: item});
|
||||
});
|
||||
query.callback({results: results });
|
||||
},
|
||||
createSearchChoice: function(term) {
|
||||
return { id: term, text: term };
|
||||
}
|
||||
};
|
||||
|
||||
var images = {};
|
||||
|
||||
$scope.imageOpts = {
|
||||
options: {
|
||||
url: '/api/devices/images',
|
||||
addRemoveLinks: true
|
||||
},
|
||||
eventHandlers: {
|
||||
success: function(file, response) {
|
||||
file.filename = response.filename;
|
||||
|
||||
if (images[file.filename]) {
|
||||
images[file.filename]++;
|
||||
this.removeFile(file);
|
||||
} else {
|
||||
images[file.filename] = 1;
|
||||
}
|
||||
},
|
||||
removedfile: function(file) {
|
||||
images[file.filename]--;
|
||||
|
||||
if (images[file.filename] <= 0) {
|
||||
delete images[file.filename];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch('deviceTypePicker', function() {
|
||||
if ($scope.deviceTypePicker) {
|
||||
$scope.model.deviceType = $scope.deviceTypePicker.id;
|
||||
} else {
|
||||
$scope.model.deviceType = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('makePicker', function() {
|
||||
if ($scope.makePicker) {
|
||||
$scope.model.make = $scope.makePicker.id;
|
||||
} else {
|
||||
$scope.model.make = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.save = function() {
|
||||
$scope.model.images = Object.keys(images);
|
||||
|
||||
Devices.create($scope.model, function(result) {
|
||||
// $location.path("/devices/" + result._id);
|
||||
$location.path("/devices/");
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
.controller("DeviceEditCtrl", function($scope, Devices, $location, $filter, $routeParams) {
|
||||
var images = {};
|
||||
|
||||
$scope.model = Devices.get($routeParams, function() {
|
||||
$scope.loading = false;
|
||||
|
||||
$scope.existingImages = $scope.model.images;
|
||||
if ($scope.model.images) {
|
||||
for (var i = 0; i < $scope.model.images.length; i++) {
|
||||
images[$scope.model.images[i]] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.deviceTypePicker = {id: $scope.model.deviceType, text: $scope.model.deviceType};
|
||||
$scope.makePicker = {id: $scope.model.make, text: $scope.model.make};
|
||||
});
|
||||
|
||||
$scope.deviceTypes = Devices.deviceTypes();
|
||||
$scope.deviceMakes = Devices.makes();
|
||||
|
||||
$scope.deviceTypeOpts = {
|
||||
containerCssClass: 'input-xxlarge',
|
||||
placeholder: 'Choose a Device Type',
|
||||
query: function(query) {
|
||||
var data = $filter('filter')($scope.deviceTypes, query.term);
|
||||
var results = [];
|
||||
data.forEach(function(item) {
|
||||
results.push({id: item, text: item});
|
||||
});
|
||||
query.callback({results: results });
|
||||
},
|
||||
createSearchChoice: function(term) {
|
||||
return { id: term, text: term };
|
||||
}
|
||||
};
|
||||
|
||||
$scope.makeOpts = {
|
||||
containerCssClass: 'input-xxlarge',
|
||||
placeholder: 'Choose a Device Make',
|
||||
query: function(query) {
|
||||
var data = $filter('filter')($scope.deviceMakes, query.term);
|
||||
var results = [];
|
||||
data.forEach(function(item) {
|
||||
results.push({id: item, text: item});
|
||||
});
|
||||
query.callback({results: results });
|
||||
},
|
||||
createSearchChoice: function(term) {
|
||||
return { id: term, text: term };
|
||||
}
|
||||
};
|
||||
|
||||
$scope.imageOpts = {
|
||||
options: {
|
||||
url: '/api/devices/images',
|
||||
addRemoveLinks: true
|
||||
},
|
||||
eventHandlers: {
|
||||
success: function(file, response) {
|
||||
file.filename = response.filename;
|
||||
|
||||
if (images[file.filename]) {
|
||||
images[file.filename]++;
|
||||
this.removeFile(file);
|
||||
} else {
|
||||
images[file.filename] = 1;
|
||||
}
|
||||
},
|
||||
removedfile: function(file) {
|
||||
images[file.filename]--;
|
||||
|
||||
if (images[file.filename] <= 0) {
|
||||
delete images[file.filename];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch('deviceTypePicker', function() {
|
||||
if ($scope.deviceTypePicker) {
|
||||
$scope.model.deviceType = $scope.deviceTypePicker.id;
|
||||
} else {
|
||||
$scope.model.deviceType = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('makePicker', function() {
|
||||
if ($scope.makePicker) {
|
||||
$scope.model.make = $scope.makePicker.id;
|
||||
} else {
|
||||
$scope.model.make = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.save = function() {
|
||||
$scope.model.images = Object.keys(images);
|
||||
|
||||
Devices.update({id: $scope.model._id}, $scope.model, function(result) {
|
||||
$location.path("/devices/");
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
.controller("AccountingIndexCtrl", function($scope, $filter, $routeParams, Workorders, LocationBinder) {
|
||||
$scope.loading = true;
|
||||
|
251
public/js/controllers/deviceTypes.js
Normal file
251
public/js/controllers/deviceTypes.js
Normal file
@ -0,0 +1,251 @@
|
||||
angular.module('biomed')
|
||||
|
||||
.controller("DeviceTypeIndexCtrl", function($scope, $filter, $routeParams, DeviceTypes, LocationBinder) {
|
||||
$scope.loading = true;
|
||||
|
||||
var allData = DeviceTypes.index(function() {
|
||||
$scope.loading = false;
|
||||
$scope.filter();
|
||||
});
|
||||
|
||||
var filteredData = [];
|
||||
var index = 0;
|
||||
var initialPageSize = 100;
|
||||
var pageSize = 5;
|
||||
|
||||
$scope.canLoad = true;
|
||||
|
||||
$scope.$watch('query', function() {
|
||||
$scope.filter();
|
||||
});
|
||||
|
||||
LocationBinder($scope, ['query']);
|
||||
|
||||
$scope.filter = function() {
|
||||
filteredData = $filter('orderBy')($filter('filter')(allData, $scope.query), $scope.sort.column, $scope.sort.descending);
|
||||
index = initialPageSize;
|
||||
$scope.canLoad = true;
|
||||
$scope.devices = filteredData.slice(0, initialPageSize);
|
||||
};
|
||||
|
||||
$scope.addItems = function() {
|
||||
$scope.devices = $scope.devices.concat(filteredData.slice(index, index + pageSize));
|
||||
index += pageSize;
|
||||
$scope.canLoad = index < filteredData.length;
|
||||
}
|
||||
|
||||
$scope.sort = {
|
||||
column: 'category',
|
||||
descending: false
|
||||
};
|
||||
|
||||
$scope.selectedCls = function(column) {
|
||||
return column == $scope.sort.column && 'sort-' + $scope.sort.descending;
|
||||
}
|
||||
|
||||
$scope.changeSorting = function(column) {
|
||||
var sort = $scope.sort;
|
||||
if (sort.column == column) {
|
||||
sort.descending = !sort.descending;
|
||||
} else {
|
||||
sort.column = column;
|
||||
sort.descending = false;
|
||||
}
|
||||
|
||||
$scope.filter();
|
||||
};
|
||||
})
|
||||
|
||||
.controller("DeviceTypeAddCtrl", function($scope, DeviceTypes, $location, $filter) {
|
||||
$scope.model = {};
|
||||
|
||||
$scope.categories = DeviceTypes.categories();
|
||||
$scope.deviceMakes = DeviceTypes.makes();
|
||||
|
||||
$scope.categoryOpts = {
|
||||
containerCssClass: 'input-xxlarge',
|
||||
placeholder: 'Choose a Device Type',
|
||||
query: function(query) {
|
||||
var data = $filter('filter')($scope.categories, query.term);
|
||||
var results = [];
|
||||
data.forEach(function(item) {
|
||||
results.push({id: item, text: item});
|
||||
});
|
||||
query.callback({results: results });
|
||||
},
|
||||
createSearchChoice: function(term) {
|
||||
return { id: term, text: term };
|
||||
}
|
||||
};
|
||||
|
||||
$scope.makeOpts = {
|
||||
containerCssClass: 'input-xxlarge',
|
||||
placeholder: 'Choose a Device Make',
|
||||
query: function(query) {
|
||||
var data = $filter('filter')($scope.deviceMakes, query.term);
|
||||
var results = [];
|
||||
data.forEach(function(item) {
|
||||
results.push({id: item, text: item});
|
||||
});
|
||||
query.callback({results: results });
|
||||
},
|
||||
createSearchChoice: function(term) {
|
||||
return { id: term, text: term };
|
||||
}
|
||||
};
|
||||
|
||||
var images = {};
|
||||
|
||||
$scope.imageOpts = {
|
||||
options: {
|
||||
url: '/api/deviceTypes/images',
|
||||
addRemoveLinks: true
|
||||
},
|
||||
eventHandlers: {
|
||||
success: function(file, response) {
|
||||
file.filename = response.filename;
|
||||
|
||||
if (images[file.filename]) {
|
||||
images[file.filename]++;
|
||||
this.removeFile(file);
|
||||
} else {
|
||||
images[file.filename] = 1;
|
||||
}
|
||||
},
|
||||
removedfile: function(file) {
|
||||
images[file.filename]--;
|
||||
|
||||
if (images[file.filename] <= 0) {
|
||||
delete images[file.filename];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch('categoryPicker', function() {
|
||||
if ($scope.categoryPicker) {
|
||||
$scope.model.category = $scope.categoryPicker.id;
|
||||
} else {
|
||||
$scope.model.category = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('makePicker', function() {
|
||||
if ($scope.makePicker) {
|
||||
$scope.model.make = $scope.makePicker.id;
|
||||
} else {
|
||||
$scope.model.make = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.save = function() {
|
||||
$scope.model.images = Object.keys(images);
|
||||
|
||||
DeviceTypes.create($scope.model, function(result) {
|
||||
$location.path("/deviceTypes/");
|
||||
});
|
||||
};
|
||||
})
|
||||
|
||||
.controller("DeviceTypeEditCtrl", function($scope, DeviceTypes, $location, $filter, $routeParams) {
|
||||
var images = {};
|
||||
|
||||
$scope.model = DeviceTypes.get($routeParams, function() {
|
||||
$scope.loading = false;
|
||||
|
||||
$scope.existingImages = $scope.model.images;
|
||||
if ($scope.model.images) {
|
||||
for (var i = 0; i < $scope.model.images.length; i++) {
|
||||
images[$scope.model.images[i]] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$scope.categoryPicker = {id: $scope.model.category, text: $scope.model.category};
|
||||
$scope.makePicker = {id: $scope.model.make, text: $scope.model.make};
|
||||
});
|
||||
|
||||
$scope.categories = DeviceTypes.categories();
|
||||
$scope.deviceMakes = DeviceTypes.makes();
|
||||
|
||||
$scope.categoryOpts = {
|
||||
containerCssClass: 'input-xxlarge',
|
||||
placeholder: 'Choose a Device Type',
|
||||
query: function(query) {
|
||||
var data = $filter('filter')($scope.categories, query.term);
|
||||
var results = [];
|
||||
data.forEach(function(item) {
|
||||
results.push({id: item, text: item});
|
||||
});
|
||||
query.callback({results: results });
|
||||
},
|
||||
createSearchChoice: function(term) {
|
||||
return { id: term, text: term };
|
||||
}
|
||||
};
|
||||
|
||||
$scope.makeOpts = {
|
||||
containerCssClass: 'input-xxlarge',
|
||||
placeholder: 'Choose a Device Make',
|
||||
query: function(query) {
|
||||
var data = $filter('filter')($scope.deviceMakes, query.term);
|
||||
var results = [];
|
||||
data.forEach(function(item) {
|
||||
results.push({id: item, text: item});
|
||||
});
|
||||
query.callback({results: results });
|
||||
},
|
||||
createSearchChoice: function(term) {
|
||||
return { id: term, text: term };
|
||||
}
|
||||
};
|
||||
|
||||
$scope.imageOpts = {
|
||||
options: {
|
||||
url: '/api/deviceTypes/images',
|
||||
addRemoveLinks: true
|
||||
},
|
||||
eventHandlers: {
|
||||
success: function(file, response) {
|
||||
file.filename = response.filename;
|
||||
|
||||
if (images[file.filename]) {
|
||||
images[file.filename]++;
|
||||
this.removeFile(file);
|
||||
} else {
|
||||
images[file.filename] = 1;
|
||||
}
|
||||
},
|
||||
removedfile: function(file) {
|
||||
images[file.filename]--;
|
||||
|
||||
if (images[file.filename] <= 0) {
|
||||
delete images[file.filename];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$watch('categoryPicker', function() {
|
||||
if ($scope.categoryPicker) {
|
||||
$scope.model.category = $scope.categoryPicker.id;
|
||||
} else {
|
||||
$scope.model.category = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('makePicker', function() {
|
||||
if ($scope.makePicker) {
|
||||
$scope.model.make = $scope.makePicker.id;
|
||||
} else {
|
||||
$scope.model.make = null;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.save = function() {
|
||||
$scope.model.images = Object.keys(images);
|
||||
|
||||
DeviceTypes.update({id: $scope.model._id}, $scope.model, function(result) {
|
||||
$location.path("/deviceTypes/");
|
||||
});
|
||||
};
|
||||
})
|
1
public/js/controllers/devices.js
Normal file
1
public/js/controllers/devices.js
Normal file
@ -0,0 +1 @@
|
||||
|
@ -3,23 +3,24 @@ angular.module('biomed.services', [])
|
||||
return $resource('/api/clients/:id/:cmd',
|
||||
{ id: "@id", cmd: "@cmd" },
|
||||
{
|
||||
index: { method: 'GET', params: {}, isArray: true },
|
||||
index: { method: 'GET', params: {}, isArray: true },
|
||||
frequencies: { method: 'GET', params: { cmd: 'frequencies' }, isArray: true },
|
||||
get: { method: 'GET', params: { id: 0} },
|
||||
create: { method: 'POST', params: {} },
|
||||
update: { method: 'POST', params: { id: 0} },
|
||||
destroy: { method: 'DELETE', params: { id: 0 } },
|
||||
get: { method: 'GET', params: { id: 0} },
|
||||
create: { method: 'POST', params: {} },
|
||||
update: { method: 'POST', params: { id: 0} },
|
||||
destroy: { method: 'DELETE', params: { id: 0 } },
|
||||
workorders: { method: 'GET', params: { id: 0, cmd: 'workorders' }, isArray: true },
|
||||
devices: { method: 'GET', params: { id: 0, cmd: 'devices' }, isArray: true },
|
||||
tags: { method: 'GET', params: { id: 0, cmd: 'tags' }, isArray: true },
|
||||
isUnique: { method: 'GET', params: { cmd: 'isUnique' } },
|
||||
isUnique: { method: 'GET', params: { cmd: 'isUnique' } },
|
||||
});
|
||||
})
|
||||
.factory("Devices", function($resource) {
|
||||
return $resource('/api/devices/:id/:cmd',
|
||||
.factory("DeviceTypes", function($resource) {
|
||||
return $resource('/api/device_types/:id/:cmd',
|
||||
{ id: "@id", cmd: "@cmd" },
|
||||
{
|
||||
index: { method: 'GET', params: {}, isArray: true },
|
||||
deviceTypes: { method: 'GET', params: { cmd: 'deviceTypes' }, isArray: true },
|
||||
categories: { method: 'GET', params: { cmd: 'categories' }, isArray: true },
|
||||
makes: { method: 'GET', params: { cmd: 'makes' }, isArray: true },
|
||||
models: { method: 'GET', params: { cmd: 'models' }, isArray: true },
|
||||
get: { method: 'GET', params: { id: 0} },
|
||||
|
@ -8,6 +8,7 @@
|
||||
<p class="lead">{{master.identifier}}</p>
|
||||
<a class="btn btn-primary" href="/workorders/add?clientId={{master._id}}" ng-show="accountHasPermission('system.edit')">Work Order</a>
|
||||
<a class="btn" href="/workorders/add?workorderType=meeting&clientId={{master._id}}" ng-show="accountHasPermission('system.edit')">Meeting</a>
|
||||
<a class="btn" href="/devices/add?clientId={{master._id}}" ng-show="accountHasPermission('system.edit')">Device</a>
|
||||
</header>
|
||||
<div ng-hide="loading" class="tabbable">
|
||||
<div class="tab-content">
|
||||
@ -309,17 +310,17 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-hide="tags.length"><td colspan="11" class="table-message">There is no information to display.</td></tr>
|
||||
<tr ng-repeat="tag in tags">
|
||||
<td><a href="http://n.atlb.co/{{tag._id}}">{{tag.data.clientDeviceId}} - (Tag:{{tag._id}})</a></td>
|
||||
<td>{{tag.data.device}}</td>
|
||||
<td>{{tag.data.make}}</td>
|
||||
<td>{{tag.data.model}}</td>
|
||||
<td>{{tag.data.serialNumber}}</td>
|
||||
<td>{{tag.data.purchaseDate}}</td>
|
||||
<td>{{tag.data.deviceWarrantyExpiration}}</td>
|
||||
<td>{{tag.data.test}}</td>
|
||||
<td>{{tag.data.roomNumber}}</td>
|
||||
<tr ng-hide="devices.length"><td colspan="11" class="table-message">There is no information to display.</td></tr>
|
||||
<tr ng-repeat="device in devices">
|
||||
<td><a href="/devices/{{device._id}}">{{device.biomedId}}</a></td>
|
||||
<td></td>
|
||||
<td>{{device.deviceType.make}}</td>
|
||||
<td>{{device.deviceType.model}}</td>
|
||||
<td>{{device.serialNumber}}</td>
|
||||
<td>{{device.purchaseDate | date}}</td>
|
||||
<td>{{device.warrantyExpiration | date}}</td>
|
||||
<td></td>
|
||||
<td>{{device.location}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
80
public/partials/deviceTypes/add.html
Normal file
80
public/partials/deviceTypes/add.html
Normal file
@ -0,0 +1,80 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/devices"><i class="icon-briefcase"></i> Devices</a><span class="divider"></span><li>
|
||||
<li class="active">New Device<li>
|
||||
</ul>
|
||||
<header>
|
||||
<h1>New Device</h1>
|
||||
</header>
|
||||
|
||||
<form name="form" class="form">
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Identification</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Device Type</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="categoryPicker" ui-select2="categoryOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Make</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="makePicker" ui-select2="makeOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Model</label>
|
||||
<div class="controls">
|
||||
<input ng-model="model.model" type="text" class="input-xlarge">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Details</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Technical Data</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.technicalData" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Links</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.links" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Recommended Parts</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.partsRecommended" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Images</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Images</label>
|
||||
<div class="controls">
|
||||
<div class="dropzone" dropzone="imageOpts"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-section">
|
||||
<div class="section-label"> </div>
|
||||
<div class="section-container">
|
||||
<button ng-click="save()" ng-disabled="form.$invalid" type="button" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
80
public/partials/deviceTypes/edit.html
Normal file
80
public/partials/deviceTypes/edit.html
Normal file
@ -0,0 +1,80 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/devices"><i class="icon-briefcase"></i> Devices</a><span class="divider"></span><li>
|
||||
<li class="active">Edit Device<li>
|
||||
</ul>
|
||||
<header>
|
||||
<h1>Edit Device</h1>
|
||||
</header>
|
||||
|
||||
<form name="form" class="form">
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Identification</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Device Type</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="categoryPicker" ui-select2="categoryOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Make</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="makePicker" ui-select2="makeOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Model</label>
|
||||
<div class="controls">
|
||||
<input ng-model="model.model" type="text" class="input-xlarge">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Details</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Technical Data</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.technicalData" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Links</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.links" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Recommended Parts</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.partsRecommended" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Images</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Images</label>
|
||||
<div class="controls">
|
||||
<div class="dropzone" dropzone="imageOpts" existing="existingImages" prefix="devices/"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-section">
|
||||
<div class="section-label"> </div>
|
||||
<div class="section-container">
|
||||
<button ng-click="save()" ng-disabled="form.$invalid" type="button" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
41
public/partials/deviceTypes/index.html
Normal file
41
public/partials/deviceTypes/index.html
Normal file
@ -0,0 +1,41 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/devices"><i class="icon-briefcase"></i> Devices</a><li>
|
||||
</ul>
|
||||
<header>
|
||||
<h1>Devices</h1>
|
||||
</header>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="toolbelt">
|
||||
<a href="/deviceTypes/add" class="btn btn-primary" ng-show="accountHasPermission('system.edit')">Create new Device</a>
|
||||
<div class="pull-right">
|
||||
<span class="toolbelt-text">Search:</span>
|
||||
<div class="input-append">
|
||||
<input type="text" ng-model="query" class="input-large" placeholder="Search">
|
||||
<span class="add-on"><i class="icon-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="biomed-table" infinite-scroll="addItems()" can-load="canLoad" threshold="300">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 33%" ng-class="selectedCls('category')" ng-click="changeSorting('category')">Device Type</th>
|
||||
<th style="width: 33%" ng-class="selectedCls('make')" ng-click="changeSorting('make')">Make</th>
|
||||
<th style="width: 33%" ng-class="selectedCls('model')" ng-click="changeSorting('model')">Model</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-show="loading"><td colspan="4" class="table-loading"><i class="loader"></i></td></tr>
|
||||
<tr ng-hide="loading || devices.length"><td colspan="4" class="table-message">There is no information to display.</td></tr>
|
||||
<tr ng-hide="loading" ng-repeat="device in devices">
|
||||
<td>{{device.category}}</td>
|
||||
<td>{{device.make}}</td>
|
||||
<td>{{device.model}}</td>
|
||||
<td><a href="/deviceTypes/{{device._id}}">Edit</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
@ -1,80 +1,80 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/devices"><i class="icon-briefcase"></i> Devices</a><span class="divider"></span><li>
|
||||
<li class="active">New Device<li>
|
||||
<li><a href="/devices"><i class="icon-briefcase"></i> Devices</a><span class="divider"></span><li>
|
||||
<li class="active">New Device<li>
|
||||
</ul>
|
||||
<header>
|
||||
<h1>New Device</h1>
|
||||
<h1>New Device</h1>
|
||||
</header>
|
||||
|
||||
<form name="form" class="form">
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Identification</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Device Type</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="deviceTypePicker" ui-select2="deviceTypeOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Make</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="makePicker" ui-select2="makeOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Model</label>
|
||||
<div class="controls">
|
||||
<input ng-model="model.model" type="text" class="input-xlarge">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Details</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Technical Data</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.technicalData" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Links</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.links" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Recommended Parts</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.partsRecommended" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Images</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Images</label>
|
||||
<div class="controls">
|
||||
<div class="dropzone" dropzone="imageOpts"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Identifieion</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Device Type</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="categoryPicker" ui-select2="categoryOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Make</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="makePicker" ui-select2="makeOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Model</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="modelPicker" ui-select2="modelOpts">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Details</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Technical Data</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.technicalData" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Links</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.links" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Recommended Parts</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.partsRecommended" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Images</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Images</label>
|
||||
<div class="controls">
|
||||
<div class="dropzone" dropzone="imageOpts"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-section">
|
||||
<div class="section-label"> </div>
|
||||
<div class="section-container">
|
||||
<button ng-click="save()" ng-disabled="form.$invalid" type="button" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label"> </div>
|
||||
<div class="section-container">
|
||||
<button ng-click="save()" ng-disabled="form.$invalid" type="button" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1,80 +1,80 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/devices"><i class="icon-briefcase"></i> Devices</a><span class="divider"></span><li>
|
||||
<li class="active">Edit Device<li>
|
||||
<li><a href="/devices"><i class="icon-briefcase"></i> Devices</a><span class="divider"></span><li>
|
||||
<li class="active">Edit Device<li>
|
||||
</ul>
|
||||
<header>
|
||||
<h1>Edit Device</h1>
|
||||
<h1>Edit Device</h1>
|
||||
</header>
|
||||
|
||||
<form name="form" class="form">
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Identification</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Device Type</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="deviceTypePicker" ui-select2="deviceTypeOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Make</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="makePicker" ui-select2="makeOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Model</label>
|
||||
<div class="controls">
|
||||
<input ng-model="model.model" type="text" class="input-xlarge">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Details</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Technical Data</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.technicalData" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Links</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.links" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Recommended Parts</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.partsRecommended" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Images</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Images</label>
|
||||
<div class="controls">
|
||||
<div class="dropzone" dropzone="imageOpts" existing="existingImages" prefix="devices/"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Identification</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Device Type</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="categoryPicker" ui-select2="categoryOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Make</label>
|
||||
<div class="controls">
|
||||
<input type="hidden" ng-model="makePicker" ui-select2="makeOpts" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Model</label>
|
||||
<div class="controls">
|
||||
<input ng-model="model.model" type="text" class="input-xlarge">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Device Details</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Technical Data</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.technicalData" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Links</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.links" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Recommended Parts</label>
|
||||
<div class="controls">
|
||||
<textarea ng-model="model.partsRecommended" type="text" class="input-xxlarge"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label">Images</div>
|
||||
<div class="section-container">
|
||||
<div class="form-editor">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Images</label>
|
||||
<div class="controls">
|
||||
<div class="dropzone" dropzone="imageOpts" existing="existingImages" prefix="devices/"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-section">
|
||||
<div class="section-label"> </div>
|
||||
<div class="section-container">
|
||||
<button ng-click="save()" ng-disabled="form.$invalid" type="button" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-section">
|
||||
<div class="section-label"> </div>
|
||||
<div class="section-container">
|
||||
<button ng-click="save()" ng-disabled="form.$invalid" type="button" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1,41 +1,41 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="/devices"><i class="icon-briefcase"></i> Devices</a><li>
|
||||
<li><a href="/devices"><i class="icon-briefcase"></i> Devices</a><li>
|
||||
</ul>
|
||||
<header>
|
||||
<h1>Devices</h1>
|
||||
<h1>Devices</h1>
|
||||
</header>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<div class="toolbelt">
|
||||
<a href="/devices/add" class="btn btn-primary" ng-show="accountHasPermission('system.edit')">Create new Device</a>
|
||||
<div class="pull-right">
|
||||
<span class="toolbelt-text">Search:</span>
|
||||
<div class="input-append">
|
||||
<input type="text" ng-model="query" class="input-large" placeholder="Search">
|
||||
<span class="add-on"><i class="icon-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="biomed-table" infinite-scroll="addItems()" can-load="canLoad" threshold="300">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 33%" ng-class="selectedCls('deviceType')" ng-click="changeSorting('deviceType')">Device Type</th>
|
||||
<th style="width: 33%" ng-class="selectedCls('make')" ng-click="changeSorting('make')">Make</th>
|
||||
<th style="width: 33%" ng-class="selectedCls('model')" ng-click="changeSorting('model')">Model</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-show="loading"><td colspan="4" class="table-loading"><i class="loader"></i></td></tr>
|
||||
<tr ng-hide="loading || devices.length"><td colspan="4" class="table-message">There is no information to display.</td></tr>
|
||||
<tr ng-hide="loading" ng-repeat="device in devices">
|
||||
<td>{{device.deviceType}}</td>
|
||||
<td>{{device.make}}</td>
|
||||
<td>{{device.model}}</td>
|
||||
<td><a href="/devices/{{device._id}}">Edit</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="span12">
|
||||
<div class="toolbelt">
|
||||
<a href="/devices/add" class="btn btn-primary" ng-show="accountHasPermission('system.edit')">Create new Device</a>
|
||||
<div class="pull-right">
|
||||
<span class="toolbelt-text">Search:</span>
|
||||
<div class="input-append">
|
||||
<input type="text" ng-model="query" class="input-large" placeholder="Search">
|
||||
<span class="add-on"><i class="icon-search"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="biomed-table" infinite-scroll="addItems()" can-load="canLoad" threshold="300">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 33%" ng-class="selectedCls('category')" ng-click="changeSorting('category')">Device Type</th>
|
||||
<th style="width: 33%" ng-class="selectedCls('make')" ng-click="changeSorting('make')">Make</th>
|
||||
<th style="width: 33%" ng-class="selectedCls('model')" ng-click="changeSorting('model')">Model</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-show="loading"><td colspan="4" class="table-loading"><i class="loader"></i></td></tr>
|
||||
<tr ng-hide="loading || devices.length"><td colspan="4" class="table-message">There is no information to display.</td></tr>
|
||||
<tr ng-hide="loading" ng-repeat="device in devices">
|
||||
<td>{{device.category}}</td>
|
||||
<td>{{device.make}}</td>
|
||||
<td>{{device.model}}</td>
|
||||
<td><a href="/devices/{{device._id}}">Edit</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user