Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to CKAN 2.9.4 & python 3.7 #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ckanext/mapviews/plugin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import urlparse
from urllib.parse import urlparse

import ckan.plugins as p
import pylons.config as config
config = p.toolkit.config

Invalid = p.toolkit.Invalid
_ = p.toolkit._
Expand All @@ -11,8 +11,8 @@


def url_is_relative_or_in_same_domain(url):
site_url = urlparse.urlparse(config.get('ckan.site_url', ''))
parsed_url = urlparse.urlparse(url)
site_url = urlparse(config.get('ckan.site_url', ''))
parsed_url = urlparse(url)

is_relative = (parsed_url.netloc == '')
is_in_same_domain = (parsed_url.netloc == site_url.netloc)
Expand Down
26 changes: 0 additions & 26 deletions ckanext/mapviews/theme/public/resource.config

This file was deleted.

25 changes: 25 additions & 0 deletions ckanext/mapviews/theme/public/webassets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
main-css:
output: ckanext-mapviews/main.css
extra:
preload:
- base/main
contents:
- vendor/leaflet.css
- vendor/leaflet.label.css
- navigablemap.css
- choroplethmap.css

main:
output: ckanext-mapviews/main.js
extra:
preload:
- base/main
contents:
- vendor/leaflet.js
- vendor/leaflet.label.js
- vendor/d3.scale.quantize.js
- vendor/backend.ckan.js
- vendor/queryStringToJSON.js
- ckan_map_modules.js
- navigablemap.js
- choroplethmap.js
6 changes: 6 additions & 0 deletions ckanext/mapviews/theme/templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% ckan_extends %}

{% block styles %}
{{ super() }}
{% asset 'mapviews/main-css' %}
{% endblock %}
2 changes: 1 addition & 1 deletion ckanext/mapviews/theme/templates/choroplethmap_view.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% resource "mapviews/main" %}
{% asset "mapviews/main" %}

<div
data-module = "choroplethmap"
Expand Down
2 changes: 1 addition & 1 deletion ckanext/mapviews/theme/templates/navigablemap_form.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% resource 'mapviews/main' %}
{% asset 'mapviews/main' %}
{% import 'macros/form.html' as form %}

{% macro filterFields(name, label='', options='', error='', fields={}, classes=[], attrs={}, is_required=false) %}
Expand Down
2 changes: 1 addition & 1 deletion ckanext/mapviews/theme/templates/navigablemap_view.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% resource "mapviews/main" %}
{% asset "mapviews/main" %}

<div
data-module = "navigablemap"
Expand Down
9 changes: 9 additions & 0 deletions ckanext/mapviews/theme/templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% ckan_extends %}

{%- block scripts %}

{{ super() }}
{% asset 'mapviews/main' %}

{% endblock -%}