- {{$index}} |
+ {{$index+1}} |
{{person.name}} {{person.surname}} <{{person.email}}>
{{person.job_title}} @ {{person.company}}
@@ -113,12 +113,12 @@
{{'Unregistered persons' | translate}}
-
+
{{'Person' | translate}} |
- {{'Add' | translate}} |
+ {{'Add' | translate}} |
@@ -128,7 +128,7 @@
{{person.email}}
-
+ |
|
diff --git a/angular_app/js/controllers.js b/angular_app/js/controllers.js
index 6baa80c..5b55814 100644
--- a/angular_app/js/controllers.js
+++ b/angular_app/js/controllers.js
@@ -228,11 +228,28 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', 'Event', 'Person',
eventManControllers.controller('PersonsListCtrl', ['$scope', 'Person', 'Setting',
function ($scope, Person, Setting) {
$scope.persons = Person.all();
- $scope.personsOrderProp = 'name';
- $scope.eventsOrderProp = '-begin-date';
+ $scope.personsOrder = ["name", "surname"];
$scope.customFields = Setting.query({setting: 'person_custom_field',
in_persons_list: true});
+ $scope.updateOrded = function(key) {
+ var new_order = [key];
+ var inv_key;
+ if (key && key[0] === '-') {
+ inv_key = key.substring(1);
+ } else {
+ inv_key = '-' + key;
+ }
+ angular.forEach($scope.personsOrder,
+ function(value, idx) {
+ if (value !== key && value !== inv_key) {
+ new_order.push(value)
+ }
+ }
+ );
+ $scope.personsOrder = new_order;
+ };
+
$scope.setAttribute = function(person, key, value) {
var data = {_id: person._id};
data[key] = value;
diff --git a/angular_app/persons-list.html b/angular_app/persons-list.html
index 4607c7e..2233bf5 100644
--- a/angular_app/persons-list.html
+++ b/angular_app/persons-list.html
@@ -30,34 +30,27 @@
-
-
-
-
- {{'Name' | translate}} |
-
- {{col.label | translate}}
+ | # |
+ {{'Person' | translate}} {{'Name' | translate}} {{'Surname' | translate}} |
+
+ {{col.label | translate}}
|
- {{'Delete' | translate}} |
+ {{'Delete' | translate}} |
-
+
+ {{$index+1}} |
{{person.name}} {{person.surname}} <{{person.email}}>
{{person.job_title}} @ {{person.company}}
|
-
+ |
@@ -65,7 +58,7 @@
{{person[col.key]}}
|
-
+ |
|
|