euscan-ng/euscanwww/djeuscan/templates/euscan/package.html

90 lines
2.6 KiB
HTML
Raw Normal View History

{% extends "euscan/_datatable.html" %}
2012-05-06 20:27:14 +02:00
{% load url from future %}
{% load sub %}
{% load euscan_accounts_helpers %}
{% block meta %}
{{ block.super }}
2012-05-06 20:27:14 +02:00
<link rel="alternate" type="application/atom+xml" title="{{ package }} Feed"
href="{% url "package_feed" package.category package.name %}" />
{% endblock %}
{% block menu_feed %}
{{ block.super }}
<li>
<img src="{{ STATIC_URL }}/img/feed.png" alt="feed" />
2012-05-06 20:27:14 +02:00
<a title="{{ package }} Feed" href="{% url "package_feed" package.category package.name %}">
{{ package|truncatechars:15 }}
2012-05-06 20:27:14 +02:00
</a>
</li>
{% endblock %}
{% block title %}
{{ block.super }} - {{ package.category }}/{{ package.name }}
{% endblock %}
{% block content %}
<div class="refresh-alert alert {% if not refresh_pos %}hide{% endif %}">
<p>A refresh request is in progress, please wait...</p>
<p>Queue position: <span id="refresh-pos">{{ refresh_pos }}</span></p>
</div>
<h2>
{{ package.category }}/{{ package.name }}
{% if user.is_authenticated %}
<div class="pull-right">
<form class="refresh-form inline"
method="POST"
action="{% url "refresh_package" package.category package.name %}">
<button class="btn refresh-button {% if refresh_requested %}hide{% endif %}" type="submit">
<img src="{{ STATIC_URL}}/img/refresh-active.png" alt="Refresh" />
</button>
<input type="hidden" name="nojs" value="true" />
</form>
<button class="btn refresh-button-disabled disabled {% if not refresh_requested %}hide{% endif %}">
<img src="{{ STATIC_URL}}/img/refresh-inactive.png" alt="Refresh" />
</button>
{% favourite_buttons "package" package.category package.name %}
</div>
{% endif %}
</h2>
{% include "euscan/_package_details.html" %}
<hr/>
{% if user.is_authenticated %}
<a class="pull-right" href="{% url "problem" package.category package.name %}">
<span class="btn bug-button">
<img src="{{ STATIC_URL}}/img/bug.png" alt="Report problems" >
</span>
</a>
{% endif %}
<script type="text/javascript">
$(document).ready(function () {
$(".refresh-form").submit(function(e) {
var url = $(this).attr("action");
e.preventDefault();
e.stopPropagation();
$.post(url, function(data) {
$(".refresh-button").addClass("hide");
$(".refresh-button-disabled").removeClass("hide");
$("#refresh-pos").text(data.position);
$(".refresh-alert").show("slow");
});
return false;
});
});
</script>
<script src="{{ STATIC_URL }}js/favourite.js" type="text/javascript"></script>
{% endblock %}