aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-07-25 17:47:50 +0500
committerAbyss777 <abyss@fox5.ru>2016-07-25 17:47:50 +0500
commitfb0a1689fda9a06ecf5e6a9a97ba8b2b704cacb9 (patch)
tree0a9e69d6139e19a830a979a45b76f82ccbe27bb4 /web/app/view
parent7e20896334f4f6927cf14c5272cf7d893efc3a05 (diff)
downloadtrackermap-server-fb0a1689fda9a06ecf5e6a9a97ba8b2b704cacb9.tar.gz
trackermap-server-fb0a1689fda9a06ecf5e6a9a97ba8b2b704cacb9.tar.bz2
trackermap-server-fb0a1689fda9a06ecf5e6a9a97ba8b2b704cacb9.zip
Added group and server attributes
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/BaseEditDialog.js5
-rw-r--r--web/app/view/BaseEditDialogController.js14
-rw-r--r--web/app/view/DeviceDialog.js19
-rw-r--r--web/app/view/DeviceDialogController.js38
-rw-r--r--web/app/view/ServerDialog.js2
-rw-r--r--web/app/view/UserDialog.js13
-rw-r--r--web/app/view/UserDialogController.js20
7 files changed, 24 insertions, 87 deletions
diff --git a/web/app/view/BaseEditDialog.js b/web/app/view/BaseEditDialog.js
index 051dfbe93..1af095c98 100644
--- a/web/app/view/BaseEditDialog.js
+++ b/web/app/view/BaseEditDialog.js
@@ -18,6 +18,11 @@ Ext.define('Traccar.view.BaseEditDialog', {
extend: 'Traccar.view.BaseDialog',
buttons: [{
+ text: Strings.sharedAttributes,
+ handler: 'showAttributesView'
+ }, {
+ xtype: 'tbfill'
+ }, {
text: Strings.sharedSave,
handler: 'onSaveClick'
}, {
diff --git a/web/app/view/BaseEditDialogController.js b/web/app/view/BaseEditDialogController.js
index 33bd01bd8..511309650 100644
--- a/web/app/view/BaseEditDialogController.js
+++ b/web/app/view/BaseEditDialogController.js
@@ -38,5 +38,19 @@ Ext.define('Traccar.view.BaseEditDialogController', {
record.save();
}
button.up('window').close();
+ },
+
+ showAttributesView: function (button) {
+ var dialog, record;
+ dialog = button.up('window').down('form');
+ record = dialog.getRecord();
+ Ext.create('Traccar.view.BaseWindow', {
+ title: Strings.sharedAttributes,
+ modal: false,
+ items: {
+ xtype: 'attributesView',
+ record: record
+ }
+ }).show();
}
});
diff --git a/web/app/view/DeviceDialog.js b/web/app/view/DeviceDialog.js
index 2938d5dc3..e88618fc5 100644
--- a/web/app/view/DeviceDialog.js
+++ b/web/app/view/DeviceDialog.js
@@ -18,10 +18,10 @@ Ext.define('Traccar.view.DeviceDialog', {
extend: 'Traccar.view.BaseEditDialog',
requires: [
- 'Traccar.view.DeviceDialogController'
+ 'Traccar.view.BaseEditDialog'
],
- controller: 'deviceDialog',
+ controller: 'baseEditDialog',
title: Strings.deviceDialog,
items: {
@@ -45,18 +45,5 @@ Ext.define('Traccar.view.DeviceDialog', {
displayField: 'name',
valueField: 'id'
}]
- },
-
- buttons: [{
- text : Strings.sharedAttributes,
- handler: 'showAttributesView'
- }, {
- xtype: 'tbfill'
- }, {
- text: Strings.sharedSave,
- handler: 'onSaveClick'
- }, {
- text: Strings.sharedCancel,
- handler: 'closeView'
- }]
+ }
});
diff --git a/web/app/view/DeviceDialogController.js b/web/app/view/DeviceDialogController.js
deleted file mode 100644
index 0a0f86883..000000000
--- a/web/app/view/DeviceDialogController.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2016 Anton Tananaev (anton.tananaev@gmail.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-Ext.define('Traccar.view.DeviceDialogController', {
- extend: 'Traccar.view.BaseEditDialogController',
- alias: 'controller.deviceDialog',
-
- requires: [
- 'Traccar.view.Attributes'
- ],
-
- showAttributesView: function (button) {
- var dialog, record;
- dialog = button.up('window').down('form');
- record = dialog.getRecord();
- Ext.create('Traccar.view.BaseWindow', {
- title: Strings.sharedAttributes,
- modal: false,
- items: {
- xtype: 'attributesView',
- record: record
- }
- }).show();
- }
-});
diff --git a/web/app/view/ServerDialog.js b/web/app/view/ServerDialog.js
index 67f3a7ab2..1af000042 100644
--- a/web/app/view/ServerDialog.js
+++ b/web/app/view/ServerDialog.js
@@ -31,7 +31,7 @@ Ext.define('Traccar.view.ServerDialog', {
name: 'registration',
fieldLabel: Strings.serverRegistration,
allowBlank: false
- },{
+ }, {
xtype: 'checkboxfield',
name: 'readonly',
fieldLabel: Strings.serverReadonly,
diff --git a/web/app/view/UserDialog.js b/web/app/view/UserDialog.js
index 378cc0681..df8a26e7e 100644
--- a/web/app/view/UserDialog.js
+++ b/web/app/view/UserDialog.js
@@ -89,18 +89,5 @@ Ext.define('Traccar.view.UserDialog', {
fieldLabel: Strings.settingsTwelveHourFormat,
allowBlank: false
}]
- }],
-
- buttons: [{
- text : Strings.sharedAttributes,
- handler: 'showAttributesView'
- }, {
- xtype: 'tbfill'
- }, {
- text: Strings.sharedSave,
- handler: 'onSaveClick'
- }, {
- text: Strings.sharedCancel,
- handler: 'closeView'
}]
});
diff --git a/web/app/view/UserDialogController.js b/web/app/view/UserDialogController.js
index 49dfd9d70..c3a4ca62d 100644
--- a/web/app/view/UserDialogController.js
+++ b/web/app/view/UserDialogController.js
@@ -15,13 +15,9 @@
*/
Ext.define('Traccar.view.UserDialogController', {
- extend: 'Ext.app.ViewController',
+ extend: 'Traccar.view.BaseEditDialogController',
alias: 'controller.userDialog',
- requires: [
- 'Traccar.view.Attributes'
- ],
-
init: function () {
if (Traccar.app.getUser().get('admin')) {
this.lookupReference('adminField').setDisabled(false);
@@ -48,19 +44,5 @@ Ext.define('Traccar.view.UserDialogController', {
});
}
button.up('window').close();
- },
-
- showAttributesView: function (button) {
- var dialog, record;
- dialog = button.up('window').down('form');
- record = dialog.getRecord();
- Ext.create('Traccar.view.BaseWindow', {
- title: Strings.sharedAttributes,
- modal: false,
- items: {
- xtype: 'attributesView',
- record: record
- }
- }).show();
}
});