Permalink
Browse files

Merge branch 'fetch-progress' of https://github.com/ptone/packaginator

…into ptone-fetch-progress
  • Loading branch information...
2 parents 942bf7e + 9a29fb4 commit ebf0171d0b9b81451696ac7d5157597c40551c5d @pydanny pydanny committed Mar 16, 2011
Showing with 16 additions and 4 deletions.
  1. +4 −2 apps/package/views.py
  2. BIN media/img/progress.gif
  3. +12 −2 templates/package/package.html
View
@@ -2,10 +2,11 @@
import simplejson
import urllib
+from django.conf import settings
+from django.contrib import messages
from django.contrib.auth.decorators import login_required
-from django.core.urlresolvers import reverse
from django.core.cache import cache
-from django.conf import settings
+from django.core.urlresolvers import reverse
from django.db.models import Q, Count
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response, get_object_or_404
@@ -71,6 +72,7 @@ def update_package(request, slug):
package = get_object_or_404(Package, slug=slug)
package.fetch_metadata()
+ messages.add_message(request, messages.INFO, 'Package updated successfully')
return HttpResponseRedirect(reverse("package", kwargs={"slug": package.slug}))
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -45,7 +45,7 @@ <h1><a href="{% url home %}">home</a> / <a href="{% url packages %}">packages</a
{% usage_button %}
{% endwith %}
</td>
- <td><a class="awesome forestgreen" href="{% url fetch_package_data object.slug %}">Fetch latest data</a></td>
+ <td id="fetch-cell"><a class="awesome forestgreen" href="{% url fetch_package_data object.slug %}">Fetch latest data</a></td>
</tr>
</tbody>
</table>
@@ -157,7 +157,17 @@ <h2>Sites using this package</h2>
{% block extra_body %}
<script type="text/javascript">
- $(function() {
+ $(function() {
+
+ $('#fetch-cell > a').click(function(){
+ $('#fetch-cell').html('Updating <img src="{{ STATIC_URL }}img/progress.gif">');
+ }
+ )
+ });
+</script>
+
+<script type="text/javascript">
+ $(function() { '
$('#find-a-grid').click(function() {
$('#find-a-grid').hide();

0 comments on commit ebf0171

Please sign in to comment.