Revision 58250
Added by Michele Artini about 4 years ago
organizations.js | ||
---|---|---|
47 | 47 |
return { |
48 | 48 |
restrict: 'E', |
49 | 49 |
scope: { |
50 |
'modalId' : '@', |
|
51 |
'orgs' : '=' |
|
50 |
'modalId' : '@', |
|
51 |
'orgs' : '=', |
|
52 |
'selectedOrgs': '=' |
|
52 | 53 |
}, |
53 | 54 |
templateUrl: 'resources/html/modals/resolve_conflicts.html', |
54 | 55 |
link: function(scope, element, attrs, ctrl) { |
56 |
scope.selectOrg = function(org) { |
|
57 |
var sel = angular.copy(org); |
|
58 |
if (scope.selectedOrgs.length == 0) { sel.show = 'success'; } |
|
59 |
else { sel.show = 'default'; } |
|
60 |
scope.selectedOrgs.push(sel); |
|
61 |
org.show = 'hidden'; |
|
62 |
} |
|
63 |
|
|
64 |
scope.reset = function() { |
|
65 |
scope.selectedOrgs = []; |
|
66 |
angular.forEach(scope.orgs, function(org) { org.show = 'default'; }); |
|
67 |
} |
|
55 | 68 |
|
56 |
|
|
57 |
scope.resolveConflicts = function() { |
|
69 |
scope.createGroup = function() { |
|
58 | 70 |
alert('todo'); |
59 | 71 |
} |
60 | 72 |
} |
... | ... | |
200 | 212 |
restrict: 'E', |
201 | 213 |
scope: { |
202 | 214 |
'org' : '=', |
203 |
'orgTitle' : '@' |
|
215 |
'orgTitle' : '@', |
|
216 |
'show' : '@' |
|
204 | 217 |
}, |
205 | 218 |
templateUrl: 'resources/html/parts/org_details.html', |
206 | 219 |
link: function(scope, element, attrs, ctrl) {} |
... | ... | |
243 | 256 |
|
244 | 257 |
scope.prepareConflictsModal = function(list) { |
245 | 258 |
scope.orgs = []; |
259 |
scope.selectedOrgs = []; |
|
246 | 260 |
|
247 | 261 |
var gets = list.map((o) => $http.get('api/organizations/get?id=' + o.id)); |
248 | 262 |
|
249 | 263 |
$q.all(gets).then(function(responses) { |
250 | 264 |
scope.orgs = responses.map((resp) => resp.data); |
265 |
angular.forEach(scope.orgs, function(org) { org.show = 'default'; }); |
|
251 | 266 |
}); |
252 |
|
|
253 |
scope.orgs = list; |
|
254 | 267 |
} |
255 | 268 |
|
256 | 269 |
} |
Also available in: Unified diff
partial implementation of merge orgs modal