Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.

Commit 0cf10d7

Browse files
authored
Merge pull request #358 from grtjn/ui-themes
Fixing infoWindow, and improving display of random json in it
2 parents f41395d + 2296253 commit 0cf10d7

File tree

4 files changed

+39
-16
lines changed

4 files changed

+39
-16
lines changed

app/templates/rest-api/config/options/all.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@
126126
-->
127127

128128
<!-- This will extract the latitude and longitude from the search. -->
129-
<extract-document-data>
130-
<extract-path>//location</extract-path>
129+
<extract-document-data selected="all">
131130
</extract-document-data>
132131

133-
134132
</options>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<dl class="dl-horizontal">
2+
<span ng-repeat="(key,val) in parameter track by $index" ng-hide="key.startsWith('_')">
3+
<dt>{{key}}</dt>
4+
<!-- simple value -->
5+
<dd ng-if="!(val | isObject)">{{ val !== '' ? val : '&#160;' }}</dd>
6+
<!-- array or object -->
7+
<span ng-if="(val | isObject)">
8+
<!-- array with simple values -->
9+
<dd ng-if="(val | isArray) && !(val[0] | isObject)">{{ val.join(', ') }}</dd>
10+
<!-- add nbsp for better alignment of values -->
11+
<dd ng-if="!(val | isArray) || (val[0] | isObject)">&#160;</dd>
12+
<!-- object, recurse -->
13+
<dd ng-if="!(val | isArray)" ng-init="parameter = val" ng-include="'app/map/infoWindow-details.html'"></dd>
14+
<!-- array of object, repeat recurse -->
15+
<dd ng-if="(val | isArray) && (val[0] | isObject)" ng-repeat="parameter in val track by $index" ng-include="'app/map/infoWindow-details.html'"></dd>
16+
</span>
17+
</span>
18+
</dl>
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
<div class="map-info-window" ng-class="{ isShown: parameter.showMe }">
2-
<section class="heading">
3-
<h4 class="window-title">{{ parameter.name || parameter.label }}</h4>
4-
</section>
5-
<section class="window-content">
6-
<div class="photo" ng-if="parameter.photo"><img ng-src="images/photos/{{parameter.photo}}" ng-attr-alt="{{parameter.name}}"></div>
7-
<div class="details">
8-
<dl class="dl-horizontal">
9-
<span ng-repeat="(key,val) in parameter"><dt>{{key}}</dt><dd>{{ val }}</dd>
10-
</dl>
11-
</div>
12-
</section>
1+
<div class="map-info-window" ng-class="{ isShown: parameter.showMe }">
2+
<section class="heading">
3+
<h4 class="window-title">{{ parameter.name || parameter.label }}</h4>
4+
</section>
5+
<section class="window-content">
6+
<div class="image" ng-if="parameter.picture || parameter.image || parameter.photo"><img ng-src="{{parameter.picture || parameter.image || parameter.photo}}" ng-attr-alt="{{parameter.name || parameter.label}}"></div>
7+
<div class="details" ng-include="'app/map/infoWindow-details.html'"></div>
8+
</section>
9+
</div>

app/themes/map/ui/app/root/root.controller.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@
33

44
angular.module('app.root')
55
.factory('rootUtils', RootUtilsFactory)
6-
.controller('RootCtrl', RootCtrl);
6+
.controller('RootCtrl', RootCtrl)
7+
.filter('isObject', function() {
8+
return function(val) {
9+
return angular.isObject(val);
10+
};
11+
})
12+
.filter('isArray', function() {
13+
return function(val) {
14+
return angular.isArray(val);
15+
};
16+
});
717

818
function RootUtilsFactory() {
919
var service = {}, width = window.innerWidth;

0 commit comments

Comments
 (0)