2011-04-15 00:24:45 +02:00
|
|
|
{% extends "euscan/_datatable.html" %}
|
|
|
|
|
|
|
|
{% load sub %}
|
2012-05-06 20:27:14 +02:00
|
|
|
{% load url from future %}
|
2011-04-15 00:24:45 +02:00
|
|
|
|
2011-08-25 15:39:54 +02:00
|
|
|
{% 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 %}" />
|
2011-08-25 15:39:54 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block menu_feed %}
|
|
|
|
{{ block.super }}
|
|
|
|
<li>
|
2012-04-04 14:33:40 +02:00
|
|
|
<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 %}">
|
2012-07-27 12:28:53 +02:00
|
|
|
{{ package|truncatechars:15 }}
|
2012-05-06 20:27:14 +02:00
|
|
|
</a>
|
2011-08-25 15:39:54 +02:00
|
|
|
</li>
|
|
|
|
{% endblock %}
|
|
|
|
|
2011-04-15 00:24:45 +02:00
|
|
|
{% block title %}
|
|
|
|
{{ block.super }} - {{ package.category }}/{{ package.name }}
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2012-07-09 14:29:42 +02:00
|
|
|
|
2012-07-27 12:21:48 +02:00
|
|
|
<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>
|
2012-07-20 17:20:18 +02:00
|
|
|
</div>
|
|
|
|
|
2012-06-05 13:10:25 +02:00
|
|
|
<h2>
|
|
|
|
{{ package.category }}/{{ package.name }}
|
|
|
|
|
2012-06-12 15:27:28 +02:00
|
|
|
{% if user.is_authenticated %}
|
2012-07-20 17:10:12 +02:00
|
|
|
<span class="pull-right">
|
2012-07-27 12:21:48 +02:00
|
|
|
<button class="btn refresh-button {% if refresh_requested %}hide{% endif %}" data-category="{{ package.category }}" data-package="{{ package.name }}">
|
2012-08-15 15:32:16 +02:00
|
|
|
<img src="{{ STATIC_URL}}/img/refresh-active.png" alt="Refresh" />
|
2012-07-20 17:10:12 +02:00
|
|
|
</button>
|
2012-07-27 12:21:48 +02:00
|
|
|
<button class="btn refresh-button-disabled disabled {% if not refresh_requested %}hide{% endif %}">
|
2012-08-15 15:32:16 +02:00
|
|
|
<img src="{{ STATIC_URL}}/img/refresh-inactive.png" alt="Refresh" />
|
2012-07-20 17:10:12 +02:00
|
|
|
</button>
|
|
|
|
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_package" package.category package.name %}">
|
2012-08-15 15:32:16 +02:00
|
|
|
<img src="{{ STATIC_URL}}/img/watch-icon.png" alt="Watch" />
|
2012-07-20 17:10:12 +02:00
|
|
|
</button>
|
|
|
|
<button class="btn unfavourite-button {% if not favourited %}hide{% endif %}" data-url="{% url "unfavourite_package" package.category package.name %}">
|
2012-08-15 15:32:16 +02:00
|
|
|
<img src="{{ STATIC_URL}}/img/unwatch-icon.png" alt="Unwatch" />
|
2012-07-20 17:10:12 +02:00
|
|
|
</button>
|
|
|
|
</span>
|
2012-06-05 13:10:25 +02:00
|
|
|
{% endif %}
|
|
|
|
</h2>
|
2012-07-25 16:52:10 +02:00
|
|
|
|
|
|
|
{% include "euscan/_package_details.html" %}
|
2012-06-05 13:10:25 +02:00
|
|
|
|
2012-07-09 14:29:42 +02:00
|
|
|
<hr/>
|
|
|
|
|
2012-07-25 16:52:10 +02:00
|
|
|
{% if user.is_authenticated %}
|
2012-11-08 15:50:19 +01:00
|
|
|
<a class="pull-right" href="{% url "problem" package.category package.name %}">
|
|
|
|
<span class="btn bug-button">
|
2012-07-25 16:52:10 +02:00
|
|
|
<img src="{{ STATIC_URL}}/img/bug.png" alt="Report problems" >
|
2012-11-08 15:50:19 +01:00
|
|
|
</span>
|
|
|
|
</a>
|
2012-07-25 16:52:10 +02:00
|
|
|
{% endif %}
|
2012-07-09 14:29:42 +02:00
|
|
|
|
2012-06-05 13:10:25 +02:00
|
|
|
<script type="text/javascript">
|
2012-07-17 19:05:26 +02:00
|
|
|
$(document).ready(function () {
|
|
|
|
$(".refresh-button").click(function() {
|
|
|
|
var url = "{% url "refresh_package" "XXX" "YYY" %}";
|
|
|
|
$.post(url.replace("XXX", $(this).data("category")).replace("YYY", $(this).data("package")),
|
2012-07-27 12:21:48 +02:00
|
|
|
function(data) {
|
2012-07-20 17:10:12 +02:00
|
|
|
$(".refresh-button").addClass("hide");
|
|
|
|
$(".refresh-button-disabled").removeClass("hide");
|
2012-07-27 12:21:48 +02:00
|
|
|
$("#refresh-pos").text(data.position);
|
2012-07-20 17:20:18 +02:00
|
|
|
$(".refresh-alert").show("slow");
|
2012-07-17 19:05:26 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$(".favourite-button").click(function() {
|
|
|
|
$.post($(this).data("url"), function() {
|
|
|
|
$(".unfavourite-button").removeClass("hide");
|
|
|
|
$(".favourite-button").addClass("hide");
|
2012-07-07 15:44:00 +02:00
|
|
|
});
|
2012-07-17 19:05:26 +02:00
|
|
|
});
|
2012-06-12 15:27:28 +02:00
|
|
|
|
2012-07-17 19:05:26 +02:00
|
|
|
$(".unfavourite-button").click(function() {
|
|
|
|
$.post($(this).data("url"), function() {
|
|
|
|
$(".favourite-button").removeClass("hide");
|
|
|
|
$(".unfavourite-button").addClass("hide");
|
|
|
|
});
|
2012-06-14 10:03:49 +02:00
|
|
|
});
|
|
|
|
|
2012-06-12 15:27:28 +02:00
|
|
|
});
|
2012-06-05 13:10:25 +02:00
|
|
|
</script>
|
|
|
|
|
2011-04-15 00:24:45 +02:00
|
|
|
{% endblock %}
|