Commit 25d2eb66 authored by Elena Grassi's avatar Elena Grassi
Browse files

[WGN] LF Initiatives can be shown as children of Places

parent da39e2d3
......@@ -159,6 +159,14 @@
"label": "REL_GROUP_OF_LABEL",
"childrenLabel": "REL_GROUP_OF_CHILD_LABEL",
"bounded": true
},
"LF_INITIATIVES": {
"slug": "location",
"field": "parent_id",
"relation": "located",
"label": "REL_LOCATION_LABEL",
"childrenLabel": "REL_LOCATION_CHILD_LABEL",
"bounded": true
}
}
},
......@@ -671,10 +679,9 @@
},
"valid_from":{ "key": "valid_from", "label": "STARTDATE_LABEL","placeholder":"STARTDATE_PLACEHOLDER", "default":null,"advanced":true,"is_editable":true},
"valid_to":{ "key": "valid_to", "label": "ENDDATE_LABEL","placeholder":"ENDDATE_PLACEHOLDER", "default":null,"advanced":true,"is_editable":true}
},
"relations": {}
}
"relations": {}
}
],
"categories":[
{
......
......@@ -99,16 +99,17 @@ angular.module('firstlife.directives').directive('entityChildren',['$log','$filt
for(key in parentsRelations) {
var parentRel = parentsRelations[key];
// $log.debug('parent rel',parentRel, ban);
// evito i duplicati
if(!ban[parentRel.field]){
ban[parentRel.field] = true;
//$log.log('looking for parents', parentRel, scope.marker);
var id = scope.marker[parentRel.field];
// $log.debug('id', parentRel.field, scope.marker, scope.marker[parentRel.field], id);
if(id){
ThingsService.get(id).then(
function (parent) {
// $log.debug('got parent',parent);
//$log.log('got parent',parent);
if(parent){
var type = parent.entity_type;
var entry = angular.extend({},parentsRelations[type]);
......@@ -116,9 +117,7 @@ angular.module('firstlife.directives').directive('entityChildren',['$log','$filt
scope.relations.parents.push(entry);
// qualcosa da leggere
scope.ok = true;
$log.log('parent',parent);
//$log.log('parent',parent);
scope.$emit('updateParent',{parent:scope.relations.parents[0]});
}
scope.loading = false;
......
......@@ -1114,7 +1114,6 @@ angular.module('firstlife.directives').directive('thingCard', function () {
scope.parent = {};
scope.$on('updateParent', function (event, args) {
if (event.defaultPrevented)
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment