Commit 6e7347fa authored by Sebastian's avatar Sebastian

Erster Wurf zu "Befreundete Apps" in der Detail-Ansicht

parent cfccdca9
......@@ -310,6 +310,12 @@ export class OsmNode {
}
return null;
}
getTags(){
if(this.tags === null){
this.tags = new Array<KeyValuePair>();
}
return this.tags;
}
setTag(key:string,value:string,displayName?:string,source?:string){
let tag = this.getTag(key);
......
......@@ -300,7 +300,6 @@
<a href="http://www.openstreetmap.org/copyright" target="_blank"><i aria-hidden="true" class="listicon gp_osmlink"></i></a>
</div>
</div>
<div class="form-group row item-detail">
<label class="col-sm-4 col-form-label">
<strong>Homepage</strong>
......@@ -657,9 +656,8 @@
<div class="elementNutrition">
<div class="">
<div class="form-group ">
<div (click)="nutritionCollapsed = !nutritionCollapsed"
[attr.aria-expanded]="sharingCollapsed" aria-controls="collapseNutrition"
[attr.aria-expanded]="!nutritionCollapsed" aria-controls="collapseNutrition"
class="collapseNutrition">
<i class="listicon gp_food" aria-hidden="true">&nbsp;</i>Dieser Ort und nachhaltige Ernährung<i [ngClass]="{'fa':true,'fa-lg':true,'fa-angle-down':!nutritionCollapsed,'fa-angle-right':nutritionCollapsed, 'fa-right':true}"
aria-hidden="true">&nbsp;</i>
......@@ -698,6 +696,41 @@
</div>
</div>
</div>
<div class="elementApps">
<div class="">
<div class="form-group ">
<div (click)="elementAppsCollapsed = !elementAppsCollapsed"
[attr.aria-expanded]="elementAppsCollapsed" aria-controls="elementAppsCollapsed"
class="collapseSharing">
<i class="listicon gp_sharing" aria-hidden="true">&nbsp;</i>Dieser Ort in befreundeten Apps<i [ngClass]="{'fa':true,'fa-lg':true,'fa-angle-down':!elementAppsCollapsed,'fa-angle-right':elementAppsCollapsed, 'fa-right':true}"
aria-hidden="true">&nbsp;</i>
</div>
</div>
<div id="elementApps" [ngbCollapse]="elementAppsCollapsed">
<div class="card container">
<div *ngIf="showElementApps()" class="card-body detailbox">
<div *ngFor="let tag of getAppTags(nodeService.detailView)" class="form-group row item-detail">
<label for="elementKey" class="col-sm-4 col-form-label">
<strong>{{translateTagKey(tag.key)}}</strong>
</label>
<div class="col">
<span class="form-control-plaintext"
id="elementKey">{{tag.value}}</span>
</div>
</div>
</div>
<div *ngIf="!showElementApps()" class="card-body detailbox">
<label class="col-sm ">
Keine Angabe bisher.
</label>
</div>
</div>
</div>
</div>
</div>
<br>
......
......@@ -14,6 +14,7 @@ import { DataGroupFactory } from '../models/DataGroupFactory';
import { OsmNode } from '../models/OsmNode';
import { BliDimension } from '../models/BliDimension';
import { OsmNodeFactory } from '../models/OsmNodeFactory';
import { KeyValuePair } from '../models/KeyValuePair';
import { OsmNodeService } from '../services/osm-node.service';
import { BliComponent } from '../portal/bli/bli.component';
import { NominatimService } from '../services/nominatim.service'
......@@ -48,6 +49,8 @@ export class SearchComponent implements OnInit {
filterPipe = new NodeFilterPipe();
sharingCollapsed = true;
descCollapsed = true;
nutritionCollapsed = true;
elementAppsCollapsed = true;
constructor(
private nodeService : OsmNodeService,
private formBuilder : FormBuilder,
......@@ -157,10 +160,17 @@ export class SearchComponent implements OnInit {
}
}
}
translateAppDataTagKey(key:string):string{
let rawKey = key.replace('_gpd:app:','');
let parts = rawKey.split(':');
let appName = parts.shift();
return appName+": "+this.translateTagKey(parts.join(':'));
}
translateTagKey(key:string){
if(key.startsWith('_gpd:app:')){
return this.translateAppDataTagKey(key);
}
switch(key){
case 'contact:website':{
return 'Homepage';
}
......@@ -194,6 +204,9 @@ translateTagKey(key:string){
case '_gpd:hauptamtliche':{
return 'Hauptamtliche Mitarbeiter';
}
case 'url':{
return 'Website';
}
case 'source':{
return 'Website';
}
......@@ -249,7 +262,32 @@ showGoodLife(){
let desc = this.nodeService.detailView.getDescription();
return (desc != undefined && desc != null && desc != "" ) || (this.nodeService.detailView.dimensions.length > 0);
}
showElementApps():boolean{
let appTags = this.getAppTags(this.nodeService.detailView);
return appTags.length != 0;
}
getAppTags(node:OsmNode):Array<KeyValuePair>{
if(!node){
return new Array<KeyValuePair>();
}
let appTagPrefix = "_gpd:app:";
let tags = new Array<KeyValuePair>();
for(let tag of node.getTags()){
if(tag.key.startsWith(appTagPrefix)){
tags.push(tag);
}
}
/*
if(tags.length == 0){
let kvp = new KeyValuePair({
key:"_gpd:app:culture:url",
value:"https://www.team-culture-beispiel.de/"
});
tags.push(kvp);
}
*/
return tags;
}
showSustainableNutrtition(){
if(this.nodeService.detailView == null){
return false;
......
......@@ -33,7 +33,7 @@ export class GeoportalApiService {
//private apiURL = 'http://10.0.8.29:8080/geoportal';
private apiURL = 'http://entwicklungssystem.transformationsstadt.de:18080/geoportal';
private apiURL = 'https://entwicklungssystem.transformationsstadt.de:1443/geoportal';
//private apiURL = 'http://geoportal-api.transformationsstadt.de:8080/geoportal';
//private apiURL = 'http://127.0.0.1:8080/geoportal';
......
......@@ -69,12 +69,12 @@ export class OsmNodeService {
this.detailView = node;
if (node != null) {
this.overpass.getOsmTags(node);
} else {
this.debug("Warning: showDetails called with null");
if (!node.hasCoordinates()) {
this.fillNode(node);
}
this.updateElementFromServer(node);
} else {
this.debug("Warning: showDetails called with null");
}
this.showDetailsWidget();
}
......
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