now it looks fantastic. Nothing under!

This commit is contained in:
didier.amyot committed 2014-05-09 16:45:23 -04:00
1 parent a72347d1e3
commit 59813e906e
15 files changed
+130 -16

No files matched your search

@@ -65,14 +65,17 @@ testmongoJsToMongoJSON()
root.controllers.controller('documentCtrl', ['$scope', '$routeParams', '$http', ($scope, $routeParams, $http) ->
$scope.idx = $routeParams.idx
$scope.doc = {}
$scope.idx = Number($routeParams.idx)
$scope.idx = Number($routeParams.idx) or 1
$scope.meta = {}
$scope.newQuery = $routeParams.query or ""
url = "/api/#{ $routeParams.server }/#{ $routeParams.database }/#{ $routeParams.collection }"
if $routeParams.query
url = "#{url}/query/#{$routeParams.query}"
url = "#{ url }/idx/#{$routeParams.idx - 1}"
if $routeParams.idx
url = "#{ url }/idx/#{$routeParams.idx - 1}"
else if $routeParams.id
url = "#{ url }/_id/#{$routeParams.id}"
$http.get(url).then((res) ->
$scope.doc = res.data.document
@@ -0,0 +1,28 @@
root = this;
root.controllers.controller('fieldCtrl', ['$scope', '$routeParams', '$http', ($scope, $routeParams, $http) ->
$scope.idx = $routeParams.idx
$scope.field = $routeParams.field
$scope.fields = []
$scope._ = _
$scope.value = ""
$scope.doc = {}
$scope.meta = {}
$scope.fieldUrl = (fieldName) ->
rt = $routeParams
return "#/#{ rt.server }/#{ rt.database }/#{ rt.collection }/_id/#{rt.id}/field/#{fieldName}"
url = "/api/#{ $routeParams.server }/#{ $routeParams.database }/#{ $routeParams.collection }"
url = "#{ url }/_id/#{$routeParams.id}"
$http.get(url).then((res) ->
$scope.doc = res.data.document
$scope.value = $scope.doc[$scope.field]
$scope.fields = _.keys($scope.doc)
$scope.meta = res.data.meta
)
])
@@ -1,7 +1,7 @@
root = this;
root.controllers.controller('geojsonmapCtrl', ['$scope', '$routeParams', '$http', ($scope, $routeParams, $http) ->
root.controllers.controller('geojsonmapCtrl', ['$scope', '$routeParams', '$location', '$http', ($scope, $routeParams, $location, $http) ->
$scope.geojson = {}
$scope.geojsonData = {}
$scope.idx = Number($routeParams.idx)
@@ -10,7 +10,7 @@ root.controllers.controller('geojsonmapCtrl', ['$scope', '$routeParams', '$http'
lng: -72.6169
zoom: 7
url = "/api/#{ $routeParams.server }/#{ $routeParams.database }/#{ $routeParams.collection }"
url = "/api/#{ $routeParams.server }/#{ $routeParams.database }/#{ $routeParams.collection }"
if $routeParams.query
url = "#{url}/query/#{$routeParams.query}"
url = "#{ url }/idx/#{$routeParams.idx - 1}"
@@ -18,10 +18,11 @@ root.controllers.controller('geojsonmapCtrl', ['$scope', '$routeParams', '$http'
$scope.geojson = res.data.document[$routeParams.key]
if not $scope.geojson.properties
$scope.geojson.properties = {}
$scope.geojson.properties["_vulture_url_link"] = ""
url = "/#{ $routeParams.server }/#{ $routeParams.database }/#{ $routeParams.collection }/_id/#{ res.data.document._id }"
$scope.geojson.properties["_vulture_url_link"] = url
$scope.meta = res.data.meta
$scope.geojsonData =
data: $scope.geojson
data: $scope.geojson
style: undefined
resetStyleOnMouseout: true
)
@@ -42,8 +43,7 @@ root.controllers.controller('geojsonmapCtrl', ['$scope', '$routeParams', '$http'
$scope.idx > 1
$scope.$on "leafletDirectiveMap.geojsonClick", (ev, featureSelected, leafletEvent) ->
a = 90
b = 89
$location.url(featureSelected.properties._vulture_url_link);
])
+1 -1
View File
@@ -11,7 +11,7 @@ root.controllers.controller('topBarCtrl', ['$scope', '$location', ($scope, $loca
$scope.path = joinArray($scope.path[0...6], $scope.path[7...-1])
$scope.getHistoryUrl = (idx) ->
ret = "#/" + ($scope.path[i] for i in [0...idx]).join("/")
if _.indexOf(["idx", "geojson", "query"], $scope.path[idx]) != -1
if _.indexOf(["idx", "geojson", "query", "_id", "field"], $scope.path[idx]) != -1
return ""
if idx == 0
ret += "servers"