2011-04-15 19:28:37 +02:00
|
|
|
{% extends "euscan/_datatable.html" %}
|
|
|
|
|
2012-08-10 17:45:43 +02:00
|
|
|
{% load url from future %}
|
2012-07-20 09:04:15 +02:00
|
|
|
{% load djeuscan_helpers %}
|
2011-04-15 19:28:37 +02:00
|
|
|
|
|
|
|
{% block title %}
|
|
|
|
{{ block.super }} - World Scan
|
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2012-08-10 17:45:43 +02:00
|
|
|
<h2>
|
|
|
|
World scan:
|
|
|
|
{% if user.is_authenticated %}
|
|
|
|
<span class="pull-right">
|
|
|
|
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_world" %}">
|
2012-08-15 15:32:16 +02:00
|
|
|
<img src="{{ STATIC_URL}}/img/watch-icon.png" alt="Watch" />
|
2012-08-10 17:45:43 +02:00
|
|
|
</button>
|
|
|
|
<button class="btn unfavourite-button {% if not favourited %}hide{% endif %}" data-url="{% url "unfavourite_world" %}">
|
2012-08-15 15:32:16 +02:00
|
|
|
<img src="{{ STATIC_URL}}/img/unwatch-icon.png" alt="Unwatch" />
|
2012-08-10 17:45:43 +02:00
|
|
|
</button>
|
|
|
|
</span>
|
|
|
|
{% endif %}
|
|
|
|
</h2>
|
|
|
|
|
2011-04-15 19:28:37 +02:00
|
|
|
{% packages packages %}
|
2012-08-10 17:45:43 +02:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function () {
|
|
|
|
var packages = [{{packages_ids|join:","}}];
|
|
|
|
|
|
|
|
$(".favourite-button").click(function() {
|
|
|
|
$.post($(this).data("url"), {packages: packages}, function() {
|
|
|
|
$(".unfavourite-button").removeClass("hide");
|
|
|
|
$(".favourite-button").addClass("hide");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$(".unfavourite-button").click(function() {
|
|
|
|
$.post($(this).data("url"), {packages: packages}, function() {
|
|
|
|
$(".favourite-button").removeClass("hide");
|
|
|
|
$(".unfavourite-button").addClass("hide");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2011-04-15 19:28:37 +02:00
|
|
|
{% endblock %}
|