We may move it back to the package page later. Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
		
			
				
	
	
		
			95 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			95 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{% extends "euscan/_datatable.html" %}
 | 
						|
 | 
						|
{% load sub %}
 | 
						|
{% load url from future %}
 | 
						|
 | 
						|
{% block meta %}
 | 
						|
{{ block.super }}
 | 
						|
<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" />
 | 
						|
  <a title="{{ package }} Feed" href="{% url "package_feed" package.category package.name %}">
 | 
						|
    {{ package }}
 | 
						|
  </a>
 | 
						|
</li>
 | 
						|
{% endblock %}
 | 
						|
 | 
						|
{% block title %}
 | 
						|
{{ block.super }} - {{ package.category }}/{{ package.name }}
 | 
						|
{% endblock %}
 | 
						|
 | 
						|
{% block content %}
 | 
						|
 | 
						|
<div class="refresh-alert alert {% if not refreshed %}hide{% endif %}">
 | 
						|
  A refresh request is in progress, please wait...
 | 
						|
</div>
 | 
						|
 | 
						|
<h2>
 | 
						|
  {{ package.category }}/{{ package.name }}
 | 
						|
 | 
						|
  {% if user.is_authenticated %}
 | 
						|
    <span class="pull-right">
 | 
						|
      <button class="btn refresh-button {% if refreshed %}hide{% endif %}" data-category="{{ package.category }}" data-package="{{ package.name }}">
 | 
						|
        <img src="{{ STATIC_URL}}/img/refresh-active.png" alt="Refresh" >
 | 
						|
      </button>
 | 
						|
      <button class="btn refresh-button-disabled disabled {% if not refreshed %}hide{% endif %}">
 | 
						|
        <img src="{{ STATIC_URL}}/img/refresh-inactive.png" alt="Refresh" >
 | 
						|
      </button>
 | 
						|
      <button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_package" package.category package.name %}">
 | 
						|
        <img src="{{ STATIC_URL}}/img/watch-icon.png" alt="Watch" >
 | 
						|
      </button>
 | 
						|
      <button class="btn unfavourite-button {% if not favourited %}hide{% endif %}" data-url="{% url "unfavourite_package" package.category package.name %}">
 | 
						|
        <img src="{{ STATIC_URL}}/img/unwatch-icon.png" alt="Unwatch" >
 | 
						|
      </button>
 | 
						|
    </span>
 | 
						|
  {% endif %}
 | 
						|
</h2>
 | 
						|
 | 
						|
{% include "euscan/_package_details.html" %}
 | 
						|
 | 
						|
<hr/>
 | 
						|
 | 
						|
{% if user.is_authenticated %}
 | 
						|
    <form class="pull-right" action="{% url "problem" package.category package.name %}" method="get">
 | 
						|
      <button class="btn bug-button">
 | 
						|
        <img src="{{ STATIC_URL}}/img/bug.png" alt="Report problems" >
 | 
						|
      </button>
 | 
						|
    </form>
 | 
						|
{% endif %}
 | 
						|
 | 
						|
<script type="text/javascript">
 | 
						|
  $(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")),
 | 
						|
        function() {
 | 
						|
          $(".refresh-button").addClass("hide");
 | 
						|
          $(".refresh-button-disabled").removeClass("hide");
 | 
						|
          $(".refresh-alert").show("slow");
 | 
						|
        });
 | 
						|
    });
 | 
						|
 | 
						|
    $(".favourite-button").click(function() {
 | 
						|
      $.post($(this).data("url"), function() {
 | 
						|
        $(".unfavourite-button").removeClass("hide");
 | 
						|
        $(".favourite-button").addClass("hide");
 | 
						|
      });
 | 
						|
    });
 | 
						|
 | 
						|
    $(".unfavourite-button").click(function() {
 | 
						|
      $.post($(this).data("url"), function() {
 | 
						|
        $(".favourite-button").removeClass("hide");
 | 
						|
        $(".unfavourite-button").addClass("hide");
 | 
						|
      });
 | 
						|
    });
 | 
						|
 | 
						|
  });
 | 
						|
</script>
 | 
						|
 | 
						|
{% endblock %}
 |