Skip to content

Commit

Permalink
Changes to make it work with Wagtail 1.4.*
Browse files Browse the repository at this point in the history
  • Loading branch information
jordij committed Apr 4, 2016
1 parent 94f6b21 commit 964ee40
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 35 deletions.
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ Assuming you have a [Wagtail](https://wagtail.io/) project up and running:

``` $ pip install wagtailgmaps```

add wagtailgmaps to your `settings.py` in the INSTALLED_APPS section:
add `wagtailgmaps` and `overextends` to your `settings.py` before any wagtail apps in the INSTALLED_APPS section:

```
...
'modelcluster',
.
.
'overextends',
'wagtailgmaps',
'wagtail.contrib.wagtailsitemaps',
'wagtail.wagtailcore',
'wagtail.wagtailadmin',
.
.
.
...
```

Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='wagtailgmaps',
version='0.2.4',
version='0.2.5',
packages=['wagtailgmaps'],
include_package_data=True,
license='BSD License',
Expand All @@ -35,4 +35,5 @@
'Topic :: Internet :: WWW/HTTP',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
install_requires=['django-overextends'],
)
32 changes: 2 additions & 30 deletions wagtailgmaps/templates/wagtailadmin/admin_base.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,6 @@
{% extends "wagtailadmin/skeleton.html" %}
{% load compress static wagtailadmin_tags %}

{% block css %}
{% compress css %}
<link rel="stylesheet" href="{% static 'wagtailadmin/css/vendor/jquery-ui/jquery-ui-1.10.3.verdant.css' %}" />
<link rel="stylesheet" href="{% static 'wagtailadmin/css/core.css' %}" type="text/css" />
<link rel="stylesheet" href="{% static 'wagtailgmaps/css/admin.css' %}" type="text/css" />
{% endcompress %}

{% block extra_css %}{% endblock %}
{% endblock %}

{% block branding_favicon %}
<link rel="shortcut icon" href="{% static 'wagtailadmin/images/favicon.ico' %}" />
{% endblock %}
{% overextends "wagtailadmin/admin_base.html" %}

{% block js %}
<script src="https://maps.google.com/maps/api/js"></script>
{% compress js %}
<script src="{% static 'wagtailadmin/js/vendor/jquery-1.10.3.js' %}"></script>
<script src="{% static 'wagtailadmin/js/vendor/jquery-ui-1.10.3.js' %}"></script>
<script src="{% static 'wagtailadmin/js/vendor/jquery.datetimepicker.js' %}"></script>
<script src="{% static 'wagtailadmin/js/vendor/jquery.autosize.js' %}"></script>
<script src="{% static 'wagtailadmin/js/vendor/bootstrap-transition.js' %}"></script>
<script src="{% static 'wagtailadmin/js/vendor/bootstrap-modal.js' %}"></script>
<script src="{% static 'wagtailadmin/js/vendor/bootstrap-tab.js' %}"></script>
<script src="{% static 'wagtailadmin/js/vendor/jquery.dlmenu.js' %}"></script>
<script src="{% static 'wagtailadmin/js/core.js' %}"></script>
{% main_nav_js %}
{% endcompress %}

{% block extra_js %}{% endblock %}
{{ block.super }}
{% endblock %}
14 changes: 14 additions & 0 deletions wagtailgmaps/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,17 @@ def editor_js():
)

return js_includes


@hooks.register('insert_global_admin_css')
def admin_css():
"""
Add extra CSS files to the admin
"""
css_files = [
'wagtailadmin/css/admin.css',
]

css_includes = format_html_join(
'\n', '<link rel="stylesheet" href="{0}{1}">', ((settings.STATIC_URL, filename) for filename in css_files))
return css_includes

0 comments on commit 964ee40

Please sign in to comment.