Skip to content

Commit

Permalink
squash merge commits from base repo to fork (#3)
Browse files Browse the repository at this point in the history
* introduce new GEOSERVER_WEB_UI_LOCATION options

* Added chinese to ALL_LANGUAGES enumeration

* improve layer_thumbnail view

* improve map_thumbnail view

* fix map_thumbnail returned None instead.

* fix layer_thumbnail returned None instead.

* proxy auth refactoring with extended checks

* use requests retry to improve geonode/geoserver connection

* fix import

* fix force list status code

* Related to fix for GeoNode#4178

*  - fix pavemenet cmdopts options

* fix flake8

* fix flake8

* fixed mixing of token object and string in login/logout

* fixed pep8 issues

* fixed another pep8 issue

* Adding all Oauth2 endpoints to lockdown exempt uris

* fixed exception retrieving token object from empty session token

*  - Backporting GEOSERVER_WEB_UI_LOCATION to sample local settings

* Update oauth.py

* Cleaning up session if no valid access_token key has been found

* [Security Cleanup] - Remove unuseful and potentially blocking calls from signals and login/out calls

* Use gs instead of geoserver for URLs in Docker

* Includes additional fields in the search index

* add async_thumbnail to improve upload time

* use celery first if enabled

* disable threading in test 

we need to use TestCase threading aware

* Fix handling of missing layers.

When a missing layer is found during map_new the layer
_resolve_layer was not throwing a missing object exception but
was throwing Http404.  As Http404 was uncaught it was causing
the loop to fail instead of ignoring the missing data.

* use celery task to generate thumbnails

* Remove unwanted line of code in worldmap client

* moved login/logout callbacks to profile module; renamed oauth utils to auth

* remove unused import

* Make sure geogig can be created in a schema other than public

* Fix missing replacement of geoserver public location (GeoNode#4215)

* Fix missing replacement of geoserver public location

* Fix diff visualization

* Revert " Includes additional layer fields in the search index" (GeoNode#4217)

* Revert " Includes additional layer fields in the search index"

* Keep fields which don't affect the upload failure

* Remove not used settings sample

* [Related to GeoNode#4219] - mitigates the issue: Delayed Security Sync Task seems causing issues with sqlite queries

* Update requirements.txt

* Update requirements_docs.txt

* Update requirements.txt

* Update requirements_docs.txt

* filter by vector time layers is not working when haystack is enabled.
as for vector_time layer, 'vectorTimeSeries' is indexed instead of 'vector_time'

* for haystack
also get 'vector_time' layers when 'vector' type is selected
as 'vector' is super type of 'vector_time'(same behavior of rest api)

* Add rabbitmq volume

* [minor] There was a wrong 'expiring' check on purging old tokens

* use regex to extract schema

* Add rabbitmq volume to main docker-compose.yml

* Wait for GeoServer and PostgreSQL instead of failing

* Use geoserver instead of gs (partial revert)

* fix Object of type Map is not JSON serializable

*  - add missing header to Python file

* Add suffix geoserver to BASEURL

* Fixed a broken link in WorldMap documentation

* use 'update' queue instead if using the default

set task queue for  the thumbnail_task to 'update' queue instead of using the default

* Remove extra Postgres wait

* Add ON_ERROR_STOP=1

* Use custom Postgres password

* Use DATABASE_URL in pgdumper

* Improve comment about POSTGRES_PASSWORD

* Update GeoServer to 2.14.2

* Add support for plugins

* Typo fix

* Test with geonode-selenium

* Import SSL Certificate for GeoServer

* [Fixes GeoNode#4247] 404 error on CSV upload

* Fixes Travis geonode-selenium build

* Fixes Travis geonode-selenium build

* Fixes Travis geonode-selenium build

* Fixes Travis geonode-selenium build

* Fixes Travis geonode-selenium build

* Fixes Travis geonode-selenium build

* [Closes GeoNode#4249] Contribute back upstream menu management from IGAD

*  - Fix smoke test cases

*  - Fix smoke test cases

* Bump django-geoexplorer-worldmap==4.0.63

* Disable system_site_packages for geonode-selenium

* Removes unnecessary dependencies from the requirements.txt and settings.py files.

* Adds back pyopenssl to requirements.txt.

* [Fixes GeoNode#4254] Pavement YAMLLoadWarning

* [minor] removing redoundant middleware class from settings
  • Loading branch information
gannebamm authored Mar 1, 2019
1 parent b6c4ba9 commit b9a23d5
Show file tree
Hide file tree
Showing 72 changed files with 2,408 additions and 1,524 deletions.
470 changes: 259 additions & 211 deletions .travis.yml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docker-compose.override.localhost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- GEONODE_LB_PORT=80
- SITEURL=http://localhost/
- ALLOWED_HOSTS=['localhost', ]
- GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/
- GEOSERVER_PUBLIC_LOCATION=http://localhost/gs/

celery:
build: .
Expand All @@ -26,7 +26,7 @@ services:
- GEONODE_LB_PORT=80
- SITEURL=http://localhost/
- ALLOWED_HOSTS=['localhost', ]
- GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/
- GEOSERVER_PUBLIC_LOCATION=http://localhost/gs/

geoserver:
environment:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- GEONODE_LB_PORT=80
- SITEURL=http://localhost/
- ALLOWED_HOSTS=['localhost', ]
- GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/
- GEOSERVER_PUBLIC_LOCATION=http://localhost/gs/

celery:
build: .
Expand All @@ -26,7 +26,7 @@ services:
- GEONODE_LB_PORT=80
- SITEURL=http://localhost/
- ALLOWED_HOSTS=['localhost', ]
- GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/
- GEOSERVER_PUBLIC_LOCATION=http://localhost/gs/

geoserver:
environment:
Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ services:
labels:
org.geonode.component: rabbitmq
org.geonode.instance.name: geonode
volumes:
- rabbitmq:/var/lib/rabbitmq

celery:
restart: unless-stopped
Expand Down Expand Up @@ -138,4 +140,5 @@ volumes:
name: ${COMPOSE_PROJECT_NAME}-dbdata
dbbackups:
name: ${COMPOSE_PROJECT_NAME}-dbbackups

rabbitmq:
name: ${COMPOSE_PROJECT_NAME}-rabbitmq
4 changes: 2 additions & 2 deletions docs/reference/worldmap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Set the following environment variables as needed (change SITE_NAME and SERVER_I
export OWNER=$PG_USERNAME
export ALLOWED_HOSTS="localhost, $SERVER_IP, "
export GEOSERVER_LOCATION=http://localhost:8080/geoserver/
export GEOSERVER_PUBLIC_LOCATION=http://$SERVER_IP/geoserver/
export GEOSERVER_PUBLIC_LOCATION=http://$SERVER_IP/gs/
export SOLR_URL =http://localhost:8983/solr/hypermap/select/
export HYPERMAP_REGISTRY_URL =http://localhost:8001
export MAPPROXY_URL=http://localhost:8001
Expand Down Expand Up @@ -123,7 +123,7 @@ Hypermap Registry

GeoNode with the WorldMap contribute module requires a Hypermap Registry (Hypermap) running instance.

You can install Hypermap by following these instructions (use the "Manual Installation" section): https://github.com/cga-harvard/HHypermap/blob/master/_docs/developers.md
You can install Hypermap by following these instructions (use the "Manual Installation" section): http://cga-harvard.github.io/Hypermap-Registry/installation.html

Note that you can bypass Java 8 installation as it was installed previously. As a search engine you should install Solr, as we haven't tested Elasticsearch with WorldMap so far. Create a specific virtual environment for Hypermap in order not to interfere with the GeoNode/WorldMap virtual environment.

Expand Down
108 changes: 108 additions & 0 deletions docs/tutorials/admin/customize_lookfeel/customize/theme_admin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,114 @@ From here you can continue to customize your :file:`site_index.html` template to
Other theming options
---------------------

Additional menus
~~~~~~~~~~~~~~~~

An interesting customization could be to insert `additional menus` in the navbar.
It can be done very easily through the **render_nav_menu** inclusion tags which allow to have ready-to-use dropdown menus without any further front-end implementation needed.
This template tag takes the `placeholder name` as argument and renders all the menus which belong to it through ``<li>`` tags.

GeoNode provides a **TOPBAR_MENU** named placeholder by default inside the `extra_tab` block of the ``base.html``:

.. code-block:: html

{% block extra_tab %}

{% render_nav_menu 'TOPBAR_MENU' %}

{% endblock %}

A placeholder is a logical container for menus, to make it work you should load the `intial_data.json` (see :ref:`geonode_install_initialization` for references) or create the placeholder from the `Admin` panel (pay attention to the `Name`, it must be 'TOPBAR_MENU'):

.. figure:: ../img/admin_menu_placeholder_initial_data.png

Once the placeholder has been created you can add your menus from the 'Admin' panel.
The following is a basic example.

Open the `Admin panel` http://localhost:8000/admin/, go to the BASE section and take a look at the models inside the red rectangle in the picture below:

.. figure:: ../img/admin_base_section.png

Follow these steps:

#. Check if **TOPBAR_MENU** exists in the **Menu placeholder** section (if not create it as described in the section above):

.. figure:: ../img/admin_menu_placeholders.png

#. Create **Menu**\s. They are links containers, give them a `title` and choose the placeholder they belong to (the **TOPBAR_MENU** placeholder in this case). A menu will be shown before or after another menu based on the `order` field:

.. figure:: ../img/admin_menu.png

.. figure:: ../img/admin_menu_2.png

#. Create **Menu Item**\s. They can be internal or external links. For each link a `menu` must be selected. The `title` is the link visible label and the `order` field determines the mutual position between all the links in a menu:

.. figure:: ../img/admin_menu_item_1_1.png

.. figure:: ../img/admin_menu_item_1_2.png

.. figure:: ../img/admin_menu_item_2_1.png

#. See the result:

.. figure:: ../img/custom_menu_1.png

.. figure:: ../img/custom_menu_2.png

You could want your menu on the right side of the top navbar, near the `search` function for example. It can be accomplished in few simple steps:

#. Add a block (`my_extra_right_tab` in the example below) in the :file:`base.html` template, inside the ``navbar-right`` <ul> element:

.. code-block:: html

<ul class="nav navbar-nav navbar-right">

{% block my_extra_right_tab %}

{% endblock my_extra_right_tab %}

<li>
<div class="search">
...

#. Move the **render_nav_menu** tag into the block:

.. code-block:: html

<ul class="nav navbar-nav navbar-right">

{% block my_extra_right_tab %}

{% render_nav_menu 'TOPBAR_MENU' %}

{% endblock my_extra_right_tab %}

<li>
<div class="search">
...

Take a look at the right side of the navbar:

.. figure:: ../img/custom_right_menu.png

The custom menus seen so far are based on a fixed html template, the :file:`base/templates/menu.html`, hooked to the **render_nav_menu** tag. Feel free to create new placeholders and menus through this powerful template tag, it makes the menus creation very fast in the top navbar but it's not flexible enough to allow to choose a different position.
So more generic tags has been implemented in GeoNode to have more customization power.

The **get_menu** assignment tag, included in the `base_tags`, lets you decide how to render the menus returning only their data in a dictionary like this:

.. code-block:: html

{
<Menu: my_menu_1>: <QuerySet [<MenuItem: my_item_1_1>, <MenuItem: my_item_1_2>]>,
<Menu: my_menu_2>: <QuerySet [<MenuItem: my_item_2_1>, <MenuItem: my_item_2_2>]>,
...
}

You can easily use those data to build `Bootstrap <https://getbootstrap.com/docs/3.3>`_ dropdowns or an accordion panels and put them wherever you want.

Styling options
---------------

You are able to change any specific piece of your GeoNode project's style by adding CSS rules to :file:`site_base.css`, but since GeoNode is based on Bootstrap, there are many pre-defined themes that you can simply drop into your project to get a whole new look. This is very similar to `WordPress <http://wordpress.com>`_ themes and is a powerful and easy way to change the look of your site without much effort.

Bootswatch
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ Revert to default site settings
#)

#GEOSERVER_PUBLIC_LOCATION = os.getenv(
# 'GEOSERVER_PUBLIC_LOCATION', '{}/geoserver/'.format(SITEURL)
# 'GEOSERVER_PUBLIC_LOCATION', '{}/gs/'.format(SITEURL)
#)
...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Preliminary Steps & Checks
)

GEOSERVER_PUBLIC_LOCATION = os.getenv(
'GEOSERVER_PUBLIC_LOCATION', '{}/geoserver/'.format(SITEURL)
'GEOSERVER_PUBLIC_LOCATION', '{}/gs/'.format(SITEURL)
)
...

Expand Down Expand Up @@ -309,7 +309,7 @@ In order to do that, edit the ``my_geonode/local_settings.py`` file:
)

GEOSERVER_PUBLIC_LOCATION = os.getenv(
'GEOSERVER_PUBLIC_LOCATION', '{}/geoserver/'.format(SITEURL)
'GEOSERVER_PUBLIC_LOCATION', '{}/gs/'.format(SITEURL)
)
...
CATALOGUE = {
Expand Down Expand Up @@ -475,7 +475,7 @@ In order to do that, edit the ``my_geonode/local_settings.py`` file:
)

GEOSERVER_PUBLIC_LOCATION = os.getenv(
'GEOSERVER_PUBLIC_LOCATION', '{}/geoserver/'.format(SITEURL)
'GEOSERVER_PUBLIC_LOCATION', '{}/gs/'.format(SITEURL)
)

OGC_SERVER_DEFAULT_USER = os.getenv(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Upgrade Development Environment
65 GEOSERVER_PUBLIC_LOCATION = os.getenv( 49 GEOSERVER_PUBLIC_LOCATION = os.getenv(
------------------------------------------------------------------------
66 # 'GEOSERVER_PUBLIC_LOCATION', '{}geoserver/'.format(SITEURL) <>
67 'GEOSERVER_LOCATION', 'http://localhost:8080/geoserver/' 50 'GEOSERVER_PUBLIC_LOCATION', 'http://localhost:8080/geoserver/'
67 'GEOSERVER_LOCATION', 'http://localhost:8080/geoserver/' 50 'GEOSERVER_PUBLIC_LOCATION', 'http://localhost:8080/gs/'
68 )
------------------------------------------------------------------------
69 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ services:
- UWSGI_CMD=uwsgi --ini /usr/src/app/uwsgi.ini
- IS_CELERY=false
- C_FORCE_ROOT=1
- GEOSERVER_PUBLIC_LOCATION=http://geonode/geoserver/
- GEOSERVER_PUBLIC_LOCATION=http://geonode/gs/
- GEOSERVER_LOCATION=http://geonode/geoserver/
- SITEURL=http://geonode/

Expand Down Expand Up @@ -116,7 +116,7 @@ services:
- CELERY_CMD=celery worker --app=geonode.celery_app:app -B -l INFO
- IS_CELERY=true
- C_FORCE_ROOT=1
- GEOSERVER_PUBLIC_LOCATION=http://geonode/geoserver/
- GEOSERVER_PUBLIC_LOCATION=http://geonode/gs/
- GEOSERVER_LOCATION=http://geonode/geoserver/
- SITEURL=http://geonode/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Change the value of the `LOCATION` and `PUBLIC_LOCATION` variables as below::
'GEOSERVER_LOCATION', 'http://localhost/geoserver/'
)
GEOSERVER_PUBLIC_LOCATION = os.getenv(
'GEOSERVER_PUBLIC_LOCATION', 'http://localhost/geoserver/'
'GEOSERVER_PUBLIC_LOCATION', 'http://localhost/gs/'
)

Finally configure GeoServer datastore:
Expand Down Expand Up @@ -167,7 +167,7 @@ The resulting configuration file should look like this:::
'GEOSERVER_LOCATION', 'http://localhost/geoserver/'
)
GEOSERVER_PUBLIC_LOCATION = os.getenv(
'GEOSERVER_PUBLIC_LOCATION', 'http://localhost:8001/geoserver/'
'GEOSERVER_PUBLIC_LOCATION', 'http://localhost:8001/gs/'
)

# OGC (WMS/WFS/WCS) Server Settings
Expand Down
3 changes: 3 additions & 0 deletions geonode/api/resourcebase_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@ def build_haystack_filters(self, parameters):
elif type in LAYER_SUBTYPES.keys():
subtypes.append(type)

if 'vector' in subtypes and 'vector_time' not in subtypes:
subtypes.append('vector_time')

if len(subtypes) > 0:
types.append("layer")
sqs = SearchQuerySet().narrow("subtype:%s" %
Expand Down
1 change: 1 addition & 0 deletions geonode/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################

from datetime import datetime, timedelta
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
Expand Down
24 changes: 23 additions & 1 deletion geonode/base/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@
Link,
Backup,
License,
HierarchicalKeyword)
HierarchicalKeyword,
MenuPlaceholder,
Menu,
MenuItem
)
from django.http import HttpResponseRedirect


Expand Down Expand Up @@ -249,6 +253,21 @@ class HierarchicalKeywordAdmin(TreeAdmin):
form = movenodeform_factory(HierarchicalKeyword)


class MenuPlaceholderAdmin(admin.ModelAdmin):
model = MenuPlaceholder
list_display = ('name', )


class MenuAdmin(admin.ModelAdmin):
model = Menu
list_display = ('title', 'placeholder', 'order')


class MenuItemAdmin(admin.ModelAdmin):
model = MenuItem
list_display = ('title', 'menu', 'order', 'blank_target', 'url')


admin.site.register(TopicCategory, TopicCategoryAdmin)
admin.site.register(Region, RegionAdmin)
admin.site.register(SpatialRepresentationType, SpatialRepresentationTypeAdmin)
Expand All @@ -258,6 +277,9 @@ class HierarchicalKeywordAdmin(TreeAdmin):
admin.site.register(Backup, BackupAdmin)
admin.site.register(License, LicenseAdmin)
admin.site.register(HierarchicalKeyword, HierarchicalKeywordAdmin)
admin.site.register(MenuPlaceholder, MenuPlaceholderAdmin)
admin.site.register(Menu, MenuAdmin)
admin.site.register(MenuItem, MenuItemAdmin)


class ResourceBaseAdminForm(ModelForm):
Expand Down
Loading

0 comments on commit b9a23d5

Please sign in to comment.