diff --git a/playlist/static/style.css b/playlist/static/style.css index 7a8ef68..0d0760b 100644 --- a/playlist/static/style.css +++ b/playlist/static/style.css @@ -456,6 +456,26 @@ input[type="range"]#volume::-webkit-slider-thumb { background-image: url(img/star-inactive.png) !important; } +#average-stars { + width: 200px; +} + +#average-stars .stars { + background-image: url(img/star-inactive.png); + background-repeat: repeat-x; + height: 32px; + width: 160px; + position: relative; +} + +#average-stars .stars-overlay { + background-image: url(img/star.png); + background-repeat: repeat-x; + height: 32px; + width: 160px; + position: absolute; +} + .undo-wrapper { display: flex; flex-flow: row nowrap; diff --git a/playlist/templates/Settings.html b/playlist/templates/Settings.html index df858d0..e936ec9 100644 --- a/playlist/templates/Settings.html +++ b/playlist/templates/Settings.html @@ -61,4 +61,14 @@ Instellingen {{user.profile.quota|floatformat:3}} +
+
+ Hoeveel sterren geef jij gemiddeld? +
+
+
+
+
+
+ {% endblock %} diff --git a/playlist/views.py b/playlist/views.py index eb99186..4d48705 100644 --- a/playlist/views.py +++ b/playlist/views.py @@ -126,9 +126,11 @@ class SettingsView(LoginRequiredMixin, View): def get(self, request): backgrounds = Background.objects.all() (profile,created) = Profile.objects.get_or_create(user=request.user) + average_vote = Vote.objects.filter(user=request.user).aggregate(Avg("points", default=0))['points__avg'] context = { "backgrounds": backgrounds, - "currentBackground": (profile.background.id if profile.background else 1) + "currentBackground": (profile.background.id if profile.background else 1), + "average": average_vote } spt_token = profile.get_or_update_spt() if spt_token: