Project

General

Profile

« Previous | Next » 

Revision 58243

partial implementation of merge orgs modal

View differences:

organizations.js
43 43
	}
44 44
});
45 45

  
46
orgsModule.directive('resolveConflictsModal', function($http) {
47
	return {
48
		restrict: 'E',
49
		scope: {
50
			'modalId' : '@',
51
			'orgs'    : '='
52
		},
53
		templateUrl: 'resources/html/modals/resolve_conflicts.html',
54
		link: function(scope, element, attrs, ctrl) {
55
			
56
			
57
			scope.resolveConflicts = function() {
58
				alert('todo');
59
			}		
60
		}
61
	}
62
});
46 63
		
47 64
orgsModule.directive('orgTabsMenu', function($http) {
48 65
	return {
......
182 199
	return {
183 200
		restrict: 'E',
184 201
		scope: {
185
			'org' : '='
202
			'org'      : '=',
203
			'orgTitle' : '@'
186 204
		},
187 205
		templateUrl: 'resources/html/parts/org_details.html',
188 206
		link: function(scope, element, attrs, ctrl) {}
......
210 228
});
211 229

  
212 230

  
213
orgsModule.directive('allConflicts', function($http, $location, $route) {
231
orgsModule.directive('allConflicts', function($http, $location, $route, $q) {
214 232
	return {
215 233
		restrict: 'E',
216 234
		scope: {
......
220 238
			'infoMethod'   : '&'
221 239
		},
222 240
		templateUrl: 'resources/html/forms/all_conflicts.html',
223
		link: function(scope, element, attrs, ctrl) {}
241
		link: function(scope, element, attrs, ctrl) {
242
			scope.orgs = [];
243
			
244
			scope.prepareConflictsModal = function(list) {
245
				scope.orgs = [];
246
				
247
				var gets = list.map((o) => $http.get('api/organizations/get?id=' + o.id));
248
				
249
				$q.all(gets).then(function(responses) {
250
					scope.orgs = responses.map((resp) => resp.data);
251
				});
252
				
253
				scope.orgs = list;
254
			}
255
			
256
		}
224 257
     }
225 258
});
226 259

  

Also available in: Unified diff