euscanwww: Icons for watching and refreshing, a user can refresh only once
Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
@ -21,10 +21,10 @@
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_category" category %}">
|
||||
Watch
|
||||
<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_category" category %}">
|
||||
Unwatch
|
||||
<img src="{{ STATIC_URL}}/img/unwatch-icon.png" alt="Unwatch" >
|
||||
</button>
|
||||
{% endif %}
|
||||
</h2>
|
||||
|
@ -20,10 +20,10 @@
|
||||
Herd: {{ herd.herd }}
|
||||
{% if user.is_authenticated %}
|
||||
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_herd" herd.herd %}">
|
||||
Watch
|
||||
<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_herd" herd.herd %}">
|
||||
Unwatch
|
||||
<img src="{{ STATIC_URL}}/img/unwatch-icon.png" alt="Unwatch" >
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
|
@ -22,10 +22,10 @@
|
||||
Maintainer: {{ maintainer.name }} <{{ maintainer.email }}>
|
||||
{% if user.is_authenticated %}
|
||||
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_maintainer" maintainer.id %}">
|
||||
Watch
|
||||
<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_maintainer" maintainer.id %}">
|
||||
Unwatch
|
||||
<img src="{{ STATIC_URL}}/img/unwatch-icon.png" alt="Unwatch" >
|
||||
</button>
|
||||
{% endif %}
|
||||
</h2>
|
||||
|
@ -12,10 +12,10 @@
|
||||
Overlay: {{ overlay }}
|
||||
{% if user.is_authenticated %}
|
||||
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_overlay" overlay %}">
|
||||
Watch
|
||||
<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_overlay" overlay %}">
|
||||
Unwatch
|
||||
<img src="{{ STATIC_URL}}/img/unwatch-icon.png" alt="Unwatch" >
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
|
@ -36,15 +36,20 @@
|
||||
{{ package.category }}/{{ package.name }}
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<button class="btn refresh-button" data-category="{{ package.category }}" data-package="{{ package.name }}">
|
||||
Refresh
|
||||
</button>
|
||||
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_package" package.category package.name %}">
|
||||
Watch
|
||||
</button>
|
||||
<button class="btn unfavourite-button {% if not favourited %}hide{% endif %}" data-url="{% url "unfavourite_package" package.category package.name %}">
|
||||
Unwatch
|
||||
</button>
|
||||
<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>
|
||||
<dl>
|
||||
@ -207,7 +212,8 @@
|
||||
var url = "{% url "refresh_package" "XXX" "YYY" %}";
|
||||
$.post(url.replace("XXX", $(this).data("category")).replace("YYY", $(this).data("package")),
|
||||
function() {
|
||||
alert("Submitted!");
|
||||
$(".refresh-button").addClass("hide");
|
||||
$(".refresh-button-disabled").removeClass("hide");
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user