Skip to content

Commit

Permalink
Merge pull request #58 from jnm/master
Browse files Browse the repository at this point in the history
Support S3 static files storage
  • Loading branch information
leplatrem committed Apr 7, 2014
2 parents 3e595b7 + 08aa315 commit 4c637a8
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ USAGE

* Add ``leaflet`` to your ``INSTALLED_APPS``

* Make sure ``django.contrib.staticfiles`` is also in your ``INSTALLED_APPS``; Django >= 1.3 `includes this by default <https://docs.djangoproject.com/en/1.3/intro/tutorial01/#database-setup>`_

* Add the HTML header::

{% load leaflet_tags %}
Expand Down
3 changes: 2 additions & 1 deletion leaflet/templates/leaflet/_leaflet_map.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load static i18n %}
{% load i18n %}
{% load static from staticfiles %}
{% if creatediv %}<div id="{{ name }}" class="leaflet-container-default"></div>{% endif %}
<script type="text/javascript">
(function () {
Expand Down
3 changes: 2 additions & 1 deletion leaflet/templates/leaflet/admin/widget.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% extends "leaflet/widget.html" %}
{% load i18n static %}
{% load i18n %}
{% load static from staticfiles %}


{% block map_css %}
Expand Down
2 changes: 1 addition & 1 deletion leaflet/templates/leaflet/css.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% load static %}
{% load static from staticfiles %}
<link rel="stylesheet" href="{% static "leaflet/leaflet.css" %}" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="{% static "leaflet/leaflet.ie.css" %}" />
Expand Down
13 changes: 9 additions & 4 deletions leaflet/templates/leaflet/js.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{% load i18n static %}
<script src="{% get_static_prefix %}leaflet/leaflet{% if DEBUG %}-src{% endif %}.js" type="text/javascript"></script>
{% load i18n %}
{% load static from staticfiles %}
{% if DEBUG %}
<script src="{% static "leaflet/leaflet-src.js" %}" type="text/javascript"></script>
{% else %}
<script src="{% static "leaflet/leaflet.js" %}" type="text/javascript"></script>
{% endif %}
{% if SRID %}
<script src="{% static "leaflet/proj4js.js" %}" type="text/javascript"></script>
<script src="{% static "leaflet/proj4leaflet.js" %}" type="text/javascript"></script>
<script src="{% get_static_prefix %}proj4js/{{ SRID }}.js" type="text/javascript"></script>
<script src="{% static "proj4js/"|add:SRID|add:".js" %}" type="text/javascript"></script>
{% endif %}
{% if PLUGINS_JS %}
{% for js in PLUGINS_JS %}
Expand All @@ -15,4 +20,4 @@
{% if with_forms %}{% include "leaflet/_leaflet_draw_i18n.js" %}{% endif %}
L.Control.ResetView.TITLE = "{% trans "Reset view" %}";
L.Control.ResetView.ICON = "url({% static "leaflet/images/reset-view.png" %})";
</script>
</script>
3 changes: 2 additions & 1 deletion leaflet/templates/leaflet/widget.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load static leaflet_tags %}
{% load leaflet_tags %}
{% load static from staticfiles %}

<style type="text/css">{% block map_css %}
{% if map_width and map_height %}#{{ id_map }} { width: {{ map_width }}; height: {{ map_height }}; }{% endif %}
Expand Down

0 comments on commit 4c637a8

Please sign in to comment.