]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/updater/templates/index.html
adding download update messages functionality, AJAX button
[osqa.git] / forum_modules / updater / templates / index.html
index 04f20af4922bcdcb3bca7851d5723ebfd1aeff4a..aed0d016d6fff035804f76e581084442a5fcb644 100644 (file)
@@ -1,14 +1,34 @@
 {% extends basetemplate %}
 
-{% load i18n %}
+{% load i18n extra_tags %}
 
 {% block adminjs %}
 {{ block.super }}
+
+<style type="text/css">
+#update_check_status {
+    margin-top: 5px;
+    padding: 5px 0;
+    display: none;
+}
+</style>
+
 <script type="text/javascript">
 $(function() {
 
     $('#check_for_updates').live('click', function() {
-        alert("Ok")
+        var update_check_url = $(this).attr('href')
+        var update_check_status = $('#update_check_status')
+        update_check_status.html('{% trans "Checking for updates" %}')
+        update_check_status.show('slow')
+
+        $.get(update_check_url, function(data) {
+            update_check_status.hide('slow', function() {
+                update_check_status.html(data)
+                update_check_status.show('slow');
+            })
+        })
+        return false;
     })
 });
 </script>
@@ -23,6 +43,7 @@ $(function() {
 
 {% block admincontent %}
 
-<a href="javascript:void(0);" id="check_for_updates" class="button">{% trans "Check for Updates" %}</a>
+<a href="{% url updater_check %}" id="check_for_updates" class="button">{% trans "Check for Updates" %}</a>
+<div id="update_check_status"></div>
 
 {% endblock %}