Update to follow django-chickpea changes

This commit is contained in:
Yohan Boniface 2012-11-21 17:50:27 +01:00
parent 0cce7f9e2a
commit 4220a2df1d
4 changed files with 22 additions and 24 deletions

View file

@ -1,6 +1,13 @@
YouMap project YouMap project
============== ==============
About
-----
YouMap let you create map with OpenStreetMap layers in a minute and embed them in your site.
*Be cause we think that the more OSM will be used, the more OSM will be **cured**.*
It uses django-chickpea, built on top of Django and Leaflet
Quickstart Quickstart
---------- ----------

View file

@ -28,7 +28,7 @@
<script src="{{ STATIC_URL }}foundation/javascripts/jquery.js"></script> <script src="{{ STATIC_URL }}foundation/javascripts/jquery.js"></script>
<script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.mediaQueryToggle.js"></script> <script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.mediaQueryToggle.js"></script>
<script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.reveal.js"></script> <script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.reveal.js"></script>
<script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.orbit.js"></script> <!--script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.orbit.js"></script-->
<script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.navigation.js"></script> <script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.navigation.js"></script>
<script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.buttons.js"></script> <script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.buttons.js"></script>
<script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.tabs.js"></script> <script src="{{ STATIC_URL }}foundation/javascripts/jquery.foundation.tabs.js"></script>
@ -40,22 +40,24 @@
{% block bottom_js %} {% block bottom_js %}
<script type="text/javascript"> <script type="text/javascript">
$(document).foundationAlerts(); $(document).foundationAlerts();
L.Util.chickpea_modal = function (content, context) { L.Chickpea.on('modal_ready', function (e) {
var $div = $('#reveal-container'); var $div = $('#reveal-container');
// reset class // reset class
$div.attr("class", ""); $div.attr("class", "");
$div.addClass("reveal-modal"); $div.addClass("reveal-modal");
if (context && context.class) { if (e.cssClass) {
$div.addClass(context.class); $div.addClass(e.cssClass);
} }
return $div.empty().html(content).append('<a class="close-reveal-modal">&#215;</a>').reveal(); return $div.empty().html(e.data.html).append('<a class="close-reveal-modal">&#215;</a>').reveal();
}; });
L.Util.chickpea_alert = function (content, level, context) { L.Chickpea.on('modal_close', function (e) {
console.log("alert", content); var $div = $('#reveal-container').trigger('reveal:close');
$div = $('<div>').addClass('alert-box success global').html(content); });
L.Chickpea.on('alert', function (e) {
$div = $('<div>').addClass('alert-box success global').html(e.content);
$div.append('<a href="#" class="close">&times;</a>'); $div.append('<a href="#" class="close">&times;</a>');
$("body").prepend($div); $("body").prepend($div);
}; });
$('a.reveal').click(function(e) { $('a.reveal').click(function(e) {
e.preventDefault(); e.preventDefault();
var $this = $(this); var $this = $(this);

View file

@ -8,6 +8,8 @@
{% endfor %} {% endfor %}
{{ form.description }} {{ form.description }}
{{ form.description.errors }} {{ form.description.errors }}
{{ form.licence }}
{{ form.licence.errors }}
{{ form.zoom }} {{ form.zoom }}
{{ form.center }} {{ form.center }}
<input type="submit" class="button" /> <input type="submit" class="button" />

View file

@ -144,17 +144,4 @@
<!-- End Footer --> <!-- End Footer -->
<!-- Included JS Files --> <!-- Included JS Files -->
{% endblock content %} {% endblock content %}
{% block bottom_js %}
{{ block.super }}
<script type="text/javascript">
$(window).load(function() {
$('#featured').orbit({
fluid: '2x1',
timer: false
});
});
</script>
{% endblock bottom_js %}