euscanwww: naive implementation of the refresh button
A refresh button lets launching a scan_upstream task for a package while navigating into euscanwww Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
		@@ -24,7 +24,15 @@
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 | 
			
		||||
{% block content %}
 | 
			
		||||
<h2>{{ package.category }}/{{ package.name }}</h2>
 | 
			
		||||
<h2>
 | 
			
		||||
  {{ package.category }}/{{ package.name }}
 | 
			
		||||
 | 
			
		||||
  {% if user.is_superuser %}
 | 
			
		||||
    <button class="refresh-button" data-package="{{ package.category }}/{{ package.name }}">
 | 
			
		||||
      Refresh
 | 
			
		||||
    </button>
 | 
			
		||||
  {% endif %}
 | 
			
		||||
</h2>
 | 
			
		||||
<dl>
 | 
			
		||||
  {% if package.description %}
 | 
			
		||||
  <dt>Description</dt>
 | 
			
		||||
@@ -129,4 +137,14 @@
 | 
			
		||||
  </dd>
 | 
			
		||||
  {% endif %}
 | 
			
		||||
</dl>
 | 
			
		||||
 | 
			
		||||
<script type="text/javascript">
 | 
			
		||||
  $(".refresh-button").click(function() {
 | 
			
		||||
    var url = "{% url "apply_task" "djeuscan.tasks.scan_upstream_task" %}";
 | 
			
		||||
    $.post(url, {query: $(this).data("package")}, function() {
 | 
			
		||||
      alert("Submitted!");
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
{% endblock %}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user