euscanwww: Watch/unwatch packages, categories, maintainers, overlays
Added a button for watch/unwatch and a dashboard with user selected stuff only Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
18
euscanwww/djeuscan/templates/euscan/_overlays_table.html
Normal file
18
euscanwww/djeuscan/templates/euscan/_overlays_table.html
Normal file
@ -0,0 +1,18 @@
|
||||
{% load url from future %}
|
||||
|
||||
<table id="table" class="display">
|
||||
<thead>
|
||||
<th>Overlay</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for overlay in overlays %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{% url "overlay" overlay %}">
|
||||
{{ overlay }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
15
euscanwww/djeuscan/templates/euscan/accounts/overlays.html
Normal file
15
euscanwww/djeuscan/templates/euscan/accounts/overlays.html
Normal file
@ -0,0 +1,15 @@
|
||||
{% extends "euscan/_datatable.html" %}
|
||||
|
||||
{% load euscan %}
|
||||
{% load url from future %}
|
||||
|
||||
{% block title %}
|
||||
{{ block.super }} - Watched overlays
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Watched overlays</h2>
|
||||
|
||||
{% overlays_table overlays %}
|
||||
|
||||
{% endblock %}
|
@ -16,7 +16,18 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Category: {{ category }}</h2>
|
||||
<h2>
|
||||
Category: {{ category }}
|
||||
|
||||
{% if user.is_authenticated %}
|
||||
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_category" category %}">
|
||||
Watch
|
||||
</button>
|
||||
<button class="btn unfavourite-button {% if not favourited %}hide{% endif %}" data-url="{% url "unfavourite_category" category %}">
|
||||
Unwatch
|
||||
</button>
|
||||
{% endif %}
|
||||
</h2>
|
||||
|
||||
{% packages packages %}
|
||||
|
||||
@ -38,11 +49,27 @@
|
||||
<img src="{% url "chart_category" category 'packages-monthly' %}" />
|
||||
</p>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".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 %}
|
||||
|
||||
{% block menus %}
|
||||
{{ block.super }}
|
||||
<div class="menu">
|
||||
<div class="menu rounded notfirst-menu">
|
||||
<dl>
|
||||
<dt>Versions</dt>
|
||||
<dd><img src="{% url "chart_category" category 'versions-monthly-small' %}" /></dd>
|
||||
@ -50,5 +77,4 @@
|
||||
<dd><img src="{% url "chart_category" category 'packages-monthly-small' %}" /></dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -16,7 +16,18 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Herd: {{ herd.herd }}</h2>
|
||||
<h2>
|
||||
Herd: {{ herd.herd }}
|
||||
{% if user.is_authenticated %}
|
||||
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_herd" herd.herd %}">
|
||||
Watch
|
||||
</button>
|
||||
<button class="btn unfavourite-button {% if not favourited %}hide{% endif %}" data-url="{% url "unfavourite_herd" herd.herd %}">
|
||||
Unwatch
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
</h2>
|
||||
{% packages packages %}
|
||||
|
||||
<h3>Statistics</h2>
|
||||
@ -36,11 +47,27 @@
|
||||
<img src="{% url "chart_herd" herd.herd 'packages-monthly' %}" />
|
||||
</p>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".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 %}
|
||||
|
||||
{% block menus %}
|
||||
{{ block.super }}
|
||||
<div class="menu">
|
||||
<div class="menu rounded notfirst-menu">
|
||||
<dl>
|
||||
<dt>Versions</dt>
|
||||
<dd><img src="{% url "chart_herd" herd.herd 'versions-monthly-small' %}" /></dd>
|
||||
|
@ -18,7 +18,17 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Maintainer: {{ maintainer.name }} <{{ maintainer.email }}></h2>
|
||||
<h2>
|
||||
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
|
||||
</button>
|
||||
<button class="btn unfavourite-button {% if not favourited %}hide{% endif %}" data-url="{% url "unfavourite_maintainer" maintainer.id %}">
|
||||
Unwatch
|
||||
</button>
|
||||
{% endif %}
|
||||
</h2>
|
||||
{% packages packages %}
|
||||
|
||||
<h3>Statistics</h2>
|
||||
@ -38,11 +48,28 @@
|
||||
<img src="{% url "chart_maintainer" maintainer.id 'packages-weekly' %}" />
|
||||
<img src="{% url "chart_maintainer" maintainer.id 'packages-monthly' %}" />
|
||||
</p>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".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 %}
|
||||
|
||||
{% block menus %}
|
||||
{{ block.super }}
|
||||
<div class="menu">
|
||||
<div class="menu rounded notfirst-menu">
|
||||
<dl>
|
||||
<dt>Versions</dt>
|
||||
<dd><img src="{% url "chart_maintainer" maintainer.id 'versions-monthly-small' %}" /></dd>
|
||||
@ -52,4 +79,3 @@
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
5A
|
||||
|
@ -1,5 +1,6 @@
|
||||
{% extends "euscan/_datatable.html" %}
|
||||
|
||||
{% load url from future %}
|
||||
{% load euscan %}
|
||||
|
||||
{% block title %}
|
||||
@ -7,6 +8,35 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Overlay: {{ overlay }}</h2>
|
||||
<h2>
|
||||
Overlay: {{ overlay }}
|
||||
{% if user.is_authenticated %}
|
||||
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_overlay" overlay %}">
|
||||
Watch
|
||||
</button>
|
||||
<button class="btn unfavourite-button {% if not favourited %}hide{% endif %}" data-url="{% url "unfavourite_overlay" overlay %}">
|
||||
Unwatch
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
</h2>
|
||||
|
||||
{% packages packages %}
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".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 %}
|
||||
|
@ -10,20 +10,6 @@
|
||||
{% block content %}
|
||||
<h2>Overlays</h2>
|
||||
|
||||
<table id="table" class="display">
|
||||
<thead>
|
||||
<th>Overlay</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for overlay in overlays %}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{% url "overlay" overlay.version__overlay %}">
|
||||
{{ overlay.version__overlay }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% overlays_table overlays %}
|
||||
|
||||
{% endblock %}
|
||||
|
@ -39,10 +39,10 @@
|
||||
Refresh
|
||||
</button>
|
||||
<button class="btn favourite-button {% if favourited %}hide{% endif %}" data-url="{% url "favourite_package" package.category package.name %}">
|
||||
Add to favourites
|
||||
Watch
|
||||
</button>
|
||||
<button class="btn unfavourite-button {% if not favourited %}hide{% endif %}" data-url="{% url "unfavourite_package" package.category package.name %}">
|
||||
Remove from favourites
|
||||
Unwatch
|
||||
</button>
|
||||
{% endif %}
|
||||
</h2>
|
||||
|
Reference in New Issue
Block a user