diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_conflicts.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_conflicts.html index 199e7001..0e3096fa 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_conflicts.html +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_conflicts.html @@ -1,28 +1,29 @@ -
+
Conflicts
No conflicts
- - - - - - - - - - - - - - - +
Related organizationTypePlace
{{sr.name}}
{{sr.id}}
{{sr.type}} {{sr.city || '-'}}, {{sr.country}}
+ + + + + + + + + + + + + +
#1{{org.name}} current {{org.city || '-'}}, {{org.country}}{{org.type}}
#{{$index+2}}{{sr.name}} {{sr.city || '-'}}, {{sr.country}}{{sr.type}}
- - \ No newline at end of file + + diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_metadata.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_metadata.html deleted file mode 100644 index f56d2b7f..00000000 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/forms/org_metadata.html +++ /dev/null @@ -1,297 +0,0 @@ -
-
- -
- This is a pending organization. Please evaluate it before approving. -
-
- This organization is managed by the system. You can not edit. -
- - -
- Official name and type - -
-
-
-
name
-
- -
-
type
-
- -
-
-
-
- Geographical location - -
-
-
-
city
-
- -
-
country
-
- - -
-
lat
-
- -
-
lng
-
- -
-
-
- -
- Other names and identifiers - -
-
-
-
Acronyms
- - - - - - - - - - - - - -
{{a}} - -
- -
-
-
-
- -
-
-
-
Aliases
- - - - - - - - - - - - - - - - - - - - - - -
namelanguage
{{n.name}}{{n.lang}} - -
- -
-
-
-
- -
-
-
-
Identifiers
- - - - - - - - - - - - - - - - - - - - - - -
idtype
{{id.id}}{{id.type}} - -
- -
-
-
-
- -
-
-
-
Urls
- - - - - - - - - - - - - -
{{u}} - -
- -
-
-
-
-
- -
- Relations -
-
-
-
Relations
- - - - - - - - - - - - - - - - - - - - - - - - - -
Related organizationType
No relations
{{r.relatedOrgName}}{{r.type}} - -
- - - - - - -
-
-
-
-
- - - -
-
- - diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/menu/org_tabs_menu.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/menu/org_tabs_menu.html deleted file mode 100644 index 8bde2804..00000000 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/menu/org_tabs_menu.html +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/pages/edit/edit.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/pages/edit/edit.html index df025590..77925069 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/pages/edit/edit.html +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/pages/edit/edit.html @@ -8,11 +8,33 @@

- - - - - + + +
+ + + +
+ +
+ + +
+ +
+ +
-
diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_dedup_events.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_dedup_events.html deleted file mode 100644 index e35c6531..00000000 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_dedup_events.html +++ /dev/null @@ -1,11 +0,0 @@ -
- - - - - - - -
- - diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html new file mode 100644 index 00000000..f9dc3ca2 --- /dev/null +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/html/parts/org_metadata.form.html @@ -0,0 +1,296 @@ +
+ +
+ This is a pending organization. Please evaluate it before approving. +
+
+ This organization is managed by the system. You can not edit. +
+ + +
+ Official name and type + +
+
+
+
name
+
+ +
+
type
+
+ +
+
+
+
+ Geographical location + +
+
+
+
city
+
+ +
+
country
+
+ + +
+
lat
+
+ +
+
lng
+
+ +
+
+
+ +
+ Other names and identifiers + +
+
+
+
Acronyms
+ + + + + + + + + + + + + +
{{a}} + +
+ +
+
+
+
+ +
+
+
+
Aliases
+ + + + + + + + + + + + + + + + + + + + + + +
namelanguage
{{n.name}}{{n.lang}} + +
+ +
+
+
+
+ +
+
+
+
Identifiers
+ + + + + + + + + + + + + + + + + + + + + + +
idtype
{{id.id}}{{id.type}} + +
+ +
+
+
+
+ +
+
+
+
Urls
+ + + + + + + + + + + + + +
{{u}} + +
+ +
+
+
+
+
+ +
+ Relations +
+
+
+
Relations
+ + + + + + + + + + + + + + + + + + + + + + + + + +
Related organizationType
No relations
{{r.relatedOrgName}}{{r.type}} + +
+ + + + + + +
+
+
+
+
+ + + +
+ + + diff --git a/apps/dnet-orgs-database-application/src/main/resources/static/resources/js/organizations.js b/apps/dnet-orgs-database-application/src/main/resources/static/resources/js/organizations.js index b7b26cfc..6d476058 100644 --- a/apps/dnet-orgs-database-application/src/main/resources/static/resources/js/organizations.js +++ b/apps/dnet-orgs-database-application/src/main/resources/static/resources/js/organizations.js @@ -119,54 +119,6 @@ orgsModule.directive('resolveConflictsModal', function($http, $route) { } }); -orgsModule.directive('orgTabsMenu', function($http) { - return { - restrict: 'E', - scope: { - 'orgId' : '@', - 'info' : '=', - 'selected' : '=', - 'org' : '=', - 'events' : '=', - }, - templateUrl: 'resources/html/menu/org_tabs_menu.html', - link: function(scope, element, attrs, ctrl) { - - scope.loadOrg = function() { - scope.org = {}; - $http.get('api/organizations/get?id=' + scope.orgId).then(function successCallback(res) { - if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } - scope.org = res.data; - }, function errorCallback(res) { - alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); - }); - scope.selected = 1; - } - - scope.loadDedupEvents = function() { - scope.events = {}; - - $http.get('api/organizations/conflicts?id=' + scope.orgId).then(function successCallback(res) { - if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } - scope.events.conflicts = res.data; - $http.get('api/organizations/duplicates?id=' + scope.orgId).then(function successCallback(res) { - if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } - scope.events.duplicates = res.data; - }, function errorCallback(res) { - alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); - }); - }, function errorCallback(res) { - alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); - }); - scope.selected = 2; - }; - - scope.loadOrg(); - } - } -}); - - orgsModule.directive('orgFormMetadata', function($http, $location, $route, $routeParams) { return { restrict: 'E', @@ -177,7 +129,7 @@ orgsModule.directive('orgFormMetadata', function($http, $location, $route, $rout 'mode' : '@', // insert, update or approve 'infoMethod' : '&' }, - templateUrl: 'resources/html/forms/org_metadata.html', + templateUrl: 'resources/html/parts/org_metadata.form.html', link: function(scope, element, attrs, ctrl) { scope.newRelation = {}; @@ -213,47 +165,6 @@ orgsModule.directive('orgFormMetadata', function($http, $location, $route, $rout } }); -orgsModule.directive('orgDedupEvents', function($http, $location, $route) { - return { - restrict: 'E', - scope: { - 'orgId' : '@', - 'events' : '=', - 'vocabularies' : '=', - 'infoMethod' : '&' - }, - templateUrl: 'resources/html/parts/org_dedup_events.html', - link: function(scope, element, attrs, ctrl) { - - scope.currentOrgDetails = {}; - - $http.get('api/organizations/get?id=' + scope.orgId).then(function successCallback(res) { - if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } - scope.currentOrgDetails = res.data; - }, function errorCallback(res) { - alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); - }); - - scope.saveDuplicates = function() { - $http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"; - $http.post('api/organizations/duplicates', scope.events.duplicates).then(function successCallback(res) { - if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } - if (scope.infoMethod) { scope.infoMethod(); } - alert('Events updated !!!'); - scope.events.duplicates = res.data; - }, function errorCallback(res) { - alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); - }); - } - - scope.saveConflicts = function() { - alert('todo'); - } - } - } -}); - - orgsModule.directive('orgDetails', function($http, $location, $route) { return { restrict: 'E', @@ -310,7 +221,7 @@ orgsModule.directive('orgFormConflicts', function($http, $location, $route, $q) return { restrict: 'E', scope: { - 'orgId' : '@', + 'org' : '=', 'conflicts' : '=', 'showSaveButton' : '@', 'saveFunction' : '&' @@ -324,7 +235,7 @@ orgsModule.directive('orgFormConflicts', function($http, $location, $route, $q) scope.candidateConflicts = []; scope.selectedConflicts = []; - var gets = [ $http.get('api/organizations/get?id=' + scope.orgId) ]; + var gets = [ $http.get('api/organizations/get?id=' + scope.org.id) ]; angular.forEach(scope.conflicts, function(c) { gets.push($http.get('api/organizations/get?id=' + c.id)); }); $q.all(gets).then(function(responses) { @@ -508,8 +419,11 @@ orgsModule.controller('byTypeCtrl', function ($scope, $http, $routeParams, $loca orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $route, $location, $timeout, $window, vocabulariesService) { $scope.orgId = $routeParams.id; $scope.org = {}; - $scope.events = {}; + $scope.duplicates = []; + $scope.conflicts = []; $scope.info = {}; + $scope.currentTab = 1 + $scope.vocabularies = {}; $scope.getInfo = function() { $http.get('api/organizations/info?id=' + $scope.orgId).then(function successCallback(res) { @@ -520,11 +434,62 @@ orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $ro }); }; - $scope.getInfo(); + $scope.gotoTab = function(tab) { + $scope.org = {}; + $http.get('api/organizations/get?id=' + $scope.orgId).then(function successCallback(res) { + if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } + $scope.org = res.data; + }, function errorCallback(res) { + alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); + }); + + if (tab == 2) { + $scope.duplicates = []; + $http.get('api/organizations/duplicates?id=' + $scope.orgId).then(function successCallback(res) { + if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } + $scope.duplicates = res.data; + }, function errorCallback(res) { + alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); + }); + } else if (tab == 3) { + $scope.conflicts = []; + $http.get('api/organizations/conflicts?id=' + $scope.orgId).then(function successCallback(res) { + if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } + $scope.conflicts = res.data; + }, function errorCallback(res) { + alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); + }); + } + $scope.currentTab = tab; + } + + + + + $scope.saveDuplicates = function() { + $http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"; + $http.post('api/organizations/duplicates', $scope.duplicates).then(function successCallback(res) { + if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); } + $scope.getInfo(); + alert('Events updated !!!'); + $scope.duplicates = res.data; + }, function errorCallback(res) { + alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); + }); + } + + $scope.saveConflicts = function() { + alert('todo'); + } + + + + - $scope.vocabularies = {}; vocabulariesService.getVocs(function(vocs) { $scope.vocabularies = vocs; }); - + $scope.getInfo(); + $scope.gotoTab(1); + if ($routeParams.msg == 1) { $scope.message = 'New organization registered !!!'; } else if ($routeParams.msg == 2) { $scope.message = 'Organization updated !!!'; } else if ($routeParams.msg == 3) { $scope.message = 'Pending organization registered !!!'; } @@ -532,7 +497,7 @@ orgsModule.controller('showEditCtrl', function ($scope, $http, $routeParams, $ro $window.scrollTo(0, 0); $timeout(function() { $scope.message = ''; }, 3000) - + }); orgsModule.controller('pendingOrgsCtrl', function ($scope, $http, $routeParams, $location, suggestionInfo) {