From 446c487e22765950b191cf7cef44f8d3dceccc1a Mon Sep 17 00:00:00 2001 From: Julien Acroute Date: Wed, 14 Jun 2017 14:38:31 +0200 Subject: [PATCH 1/4] Use osm source for search map and use protocol relative link http/https --- geonode/static/geonode/js/search/search.js | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/geonode/static/geonode/js/search/search.js b/geonode/static/geonode/js/search/search.js index 948bb5578c9..6bc8d1459cc 100644 --- a/geonode/static/geonode/js/search/search.js +++ b/geonode/static/geonode/js/search/search.js @@ -72,7 +72,7 @@ if(node.nodes){ for(var i=0; i 0){ module.load_regions($http, $rootScope, $location); } @@ -249,7 +249,7 @@ $scope.query.limit = $scope.query.limit || CLIENT_RESULTS_LIMIT; $scope.query.offset = $scope.query.offset || 0; $scope.page = Math.round(($scope.query.offset / $scope.query.limit) + 1); - + //Get data from apis and make them available to the page function query_api(data){ $http.get(Configs.url, {params: data || {}}).success(function(data){ @@ -350,7 +350,7 @@ query_entry.push($scope.query[data_filter]); } } - + // Add the entry in the correct query if (query_entry.indexOf(value) == -1){ query_entry.push(value); @@ -377,7 +377,7 @@ query_entry.push($scope.query[data_filter]); } } - + query_entry.splice(query_entry.indexOf(value), 1); //save back the new query entry to the scope query @@ -588,12 +588,12 @@ layers: { baselayers: { stamen: { - name: 'Toner Lite', + name: 'OpenStreetMap Mapnik', type: 'xyz', - url: 'http://{s}.tile.stamen.com/toner-lite/{z}/{x}/{y}.png', + url: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', layerOptions: { subdomains: ['a', 'b', 'c'], - attribution: 'Map tiles by Stamen Design', + attribution: '© OpenStreetMap', continuousWorld: true } } @@ -609,7 +609,7 @@ } }); - + var leafletData = $injector.get('leafletData'), map = leafletData.getMap('filter-map'); @@ -619,15 +619,15 @@ query_api($scope.query); }); }); - + var showMap = false; $('#_extent_filter').click(function(evt) { - showMap = !showMap + showMap = !showMap if (showMap){ leafletData.getMap().then(function(map) { map.invalidateSize(); }); - } + } }); } }); From cbb8780505e7099aa7e9737dcb0a0581ece9e984 Mon Sep 17 00:00:00 2001 From: Julien Acroute Date: Wed, 14 Jun 2017 14:45:00 +0200 Subject: [PATCH 2/4] add frontend tools and bootstrap static files --- Dockerfile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 11d254014cf..e23605ca880 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,13 +41,33 @@ EXPOSE 8000 ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["django-admin.py", "runserver", "0.0.0.0:8000", "--settings=geonode.settings"] +# Install gunicorn +RUN pip install gunicorn + +# Install tools for frontend (node, npm, grunt, bower, ...) +ADD https://nodejs.org/dist/v6.10.3/node-v6.10.3-linux-x64.tar.xz /usr/local/ +RUN cd /usr/local/ \ + && wget https://nodejs.org/dist/v6.10.3/node-v6.10.3-linux-x64.tar.xz \ + && tar Jxvf node-v6.10.3-linux-x64.tar.xz \ + && rm node-v6.10.3-linux-x64.tar.xz \ + && ln -s node-v6.10.3-linux-x64 node \ + && cd /usr/local/bin \ + && ln -s /usr/local/node-v6.10.3-linux-x64/bin/node \ + && ln -s /usr/local/node-v6.10.3-linux-x64/bin/npm \ + && npm install npm@latest -g \ + && npm install -g bower \ + && npm install -g grunt +ENV PATH=/usr/local/node/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + # Install geonode code and dependencies RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY requirements.txt /usr/src/app/ RUN pip install --no-cache-dir -r requirements.txt COPY . /usr/src/app/ -RUN pip install --no-cache-dir --no-deps -e /usr/src/app/ +RUN pip install --no-cache-dir --no-deps -e /usr/src/app/ \ + && cd /usr/src/app/geonode/static \ + && grunt production # Install geonode configuration RUN mkdir -p /mnt/geonode_data/uploaded /mnt/geonode_data/static /mnt/geonode_config \ From 029f7ff7994c53fb09d3109819575777f299a142 Mon Sep 17 00:00:00 2001 From: Julien Acroute Date: Wed, 14 Jun 2017 16:50:55 +0200 Subject: [PATCH 3/4] =?UTF-8?q?Use=C2=A02.7=20image=20for=20python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index af58d5b04e0..6e85600eff5 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ up: docker-compose up -d build: - docker pull python:2.7.9 + docker pull python:2.7 docker build -t camptocamp/geonode_django:latest . docker build -t camptocamp/geonode_django:`date +%Y%m%d%H%M%S` . From d11051e8e9ffee753316d290405a3b594791ff88 Mon Sep 17 00:00:00 2001 From: Julien Acroute Date: Tue, 20 Jun 2017 16:03:50 +0200 Subject: [PATCH 4/4] use regular link to osm copyright page --- geonode/static/geonode/js/search/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/geonode/static/geonode/js/search/search.js b/geonode/static/geonode/js/search/search.js index 6bc8d1459cc..a94a5d5a14b 100644 --- a/geonode/static/geonode/js/search/search.js +++ b/geonode/static/geonode/js/search/search.js @@ -593,7 +593,7 @@ url: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', layerOptions: { subdomains: ['a', 'b', 'c'], - attribution: '© OpenStreetMap', + attribution: '© OpenStreetMap', continuousWorld: true } }