From 56dca2ba7bd5d4ed2b126a83ed2b730c047a4c85 Mon Sep 17 00:00:00 2001 From: Theo Date: Sat, 30 Nov 2024 00:14:55 -0800 Subject: [PATCH 01/32] got rid of the tags in templates --- templates/UserAuth/albumScrollDisplay.html | 5 ++-- templates/UserAuth/contactus.html | 27 +++++++++++----------- templates/UserAuth/login.html | 16 ++++++------- templates/UserAuth/profile.html | 3 +-- templates/UserAuth/signup.html | 2 +- templates/Wrapped/get_top.html | 18 +++++++-------- templates/Wrapped/user_profile.html | 10 +++----- templates/Wrapped/view_public_wraps.html | 17 ++++++-------- templates/Wrapped/view_wrap.html | 3 +-- templates/Wrapped/view_wraps.html | 13 +++++------ templates/Wrapped/wrap_detail.html | 8 ++----- 11 files changed, 53 insertions(+), 69 deletions(-) diff --git a/templates/UserAuth/albumScrollDisplay.html b/templates/UserAuth/albumScrollDisplay.html index 7f314c3..286e8f5 100644 --- a/templates/UserAuth/albumScrollDisplay.html +++ b/templates/UserAuth/albumScrollDisplay.html @@ -1,4 +1,3 @@ -{% load i18n %}
@@ -7,14 +6,14 @@ src="{{ album.images.0.url }}" width="100" height="100" - alt="{% trans album.name %}"> + alt="{{ album.name }}"> {% endfor %} {% for album in album_covers %} {% trans album.name %} + alt="{{ album.name }}"> {% endfor %}
diff --git a/templates/UserAuth/contactus.html b/templates/UserAuth/contactus.html index 1186409..a7c5a60 100644 --- a/templates/UserAuth/contactus.html +++ b/templates/UserAuth/contactus.html @@ -1,54 +1,53 @@ {% extends 'UserAuth/base.html' %} -{% load static i18n %} {% block body %}
-

{% trans "Your trust is important to us, and so we would like to answer your FAQs or contact us." %}

+

Your trust is important to us, and so we would like to answer your FAQs or contact us.


-

{% trans "Contact Us" %}

+

Contact Us

{% csrf_token %} {{ form.as_p }} - +
{% if messages %}
    diff --git a/templates/UserAuth/login.html b/templates/UserAuth/login.html index 460b8c2..cb349f7 100644 --- a/templates/UserAuth/login.html +++ b/templates/UserAuth/login.html @@ -1,31 +1,31 @@ {% extends 'UserAuth/base.html' %} -{% load static i18n %} +{% load static %} {% block body %}
    {% csrf_token %} -

    {% trans "Sign in" %}

    +

    Sign in


    - + {{ form.email.errors }} {{ form.email }}
    - + {{ form.password.errors }} {{ form.password }}
    - +
    {% endblock %} \ No newline at end of file diff --git a/templates/UserAuth/profile.html b/templates/UserAuth/profile.html index e049637..13077bc 100644 --- a/templates/UserAuth/profile.html +++ b/templates/UserAuth/profile.html @@ -1,5 +1,4 @@ {% extends 'UserAuth/base.html' %} -{% load i18n %} {% block body %}

    {{ user.get_username }}'s Profile Page


    @@ -55,7 +54,7 @@

    {{ wrap.title }}

    {% csrf_token %} - + {% endfor %} diff --git a/templates/UserAuth/signup.html b/templates/UserAuth/signup.html index 30317d4..c90172b 100644 --- a/templates/UserAuth/signup.html +++ b/templates/UserAuth/signup.html @@ -1,5 +1,5 @@ {% extends 'UserAuth/base.html' %} -{% load static i18n %} +{% load static %} {% block body %}
    diff --git a/templates/Wrapped/get_top.html b/templates/Wrapped/get_top.html index aa1cd11..b618bb9 100644 --- a/templates/Wrapped/get_top.html +++ b/templates/Wrapped/get_top.html @@ -3,7 +3,7 @@ - {% trans "Top Tracks and Artists" %} + Top Tracks and Artists -

    {% trans "Top Tracks" %}

    +

    Top Tracks

    {% if error %}

    {{ error }}

    {% else %} @@ -62,23 +62,23 @@

    {% trans "Top Tracks" %}

    height="50" />

    - {% trans "Song:" %} {{ track.song_name }} + Song: {{ track.song_name }}

    - {% trans "Artist:" %} {{ track.artist_name }} + Artist: {{ track.artist_name }}

    - {% trans "Album:" %} {{ track.album_name }} + Album: {{ track.album_name }}

    - {% trans "Duration:" %} {{ track.duration_ms }} ms + Duration: {{ track.duration_ms }} ms

    {% endfor %}
{% endif %} -

{% trans "Top Artists" %}

+

Top Artists

{% if error %}

{{ error }}

{% else %} @@ -91,10 +91,10 @@

{% trans "Top Artists" %}

height="50" />

- {% trans "Name:" %} {{ artist.name }} + Name: {{ artist.name }}

- {% trans "Genres:" %} {{ artist.genres|join:", " }} + Genres: {{ artist.genres|join:", " }}

diff --git a/templates/Wrapped/user_profile.html b/templates/Wrapped/user_profile.html index 69ee7fc..2b96ae2 100644 --- a/templates/Wrapped/user_profile.html +++ b/templates/Wrapped/user_profile.html @@ -1,12 +1,8 @@ {% extends 'Wrapped/base.html' %} {% block title %}User Profile{% endblock %} -{% load i18n %} -{% block title %} - {% trans "User Profile" %} -{% endblock %} {% block content %} -

{{ user.username }}{% trans "'s Profile" %}

-

{% trans "Posted Wraps" %}

+

{{ user.username }}'s Profile

+

Posted Wraps

    {% for wrap in user.spotifywrap_set.all %}
  • @@ -14,7 +10,7 @@

    {% trans "Posted Wraps" %}

  • {% endfor %}
-

{% trans "Liked Wraps" %}

+

Liked Wraps

    {% for like in user.like_set.all %}
  • diff --git a/templates/Wrapped/view_public_wraps.html b/templates/Wrapped/view_public_wraps.html index d099769..5d3547e 100644 --- a/templates/Wrapped/view_public_wraps.html +++ b/templates/Wrapped/view_public_wraps.html @@ -1,11 +1,8 @@ {% extends 'UserAuth/base.html' %} -{% load i18n %} -{% block title %} - {% trans "Public Wraps" %} -{% endblock %} +{% block title %}Public Wraps{% endblock %} {% block body %} -

    {% trans "Public Wraps" %}

    - +

    Public Wraps

    + {{ wraps }} {% for wrap in wraps %} {{ wrap }} @@ -19,7 +16,7 @@

    {% trans "Public Wraps" %}

    method="post" style="display:inline"> {% csrf_token %} - +
  • {% endfor %} @@ -34,7 +31,7 @@

    {% trans "Public Wraps" %}

    padding:20px; border:1px solid black"> - +
+ }); + {% endblock %} From 3a645445122ed9701649276c3568b39c3de8d837 Mon Sep 17 00:00:00 2001 From: "Seegobin, Varindra" Date: Sat, 30 Nov 2024 21:01:36 -0500 Subject: [PATCH 06/32] got likes to actually register, though with a bug that after liking the page needs to be reloaded. --- .../migrations/0007_spotifywrap_liked_by.py | 21 ++++++++++++++++ ...otifywrap_liked_by_spotifywrap_liked_by.py | 24 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 Wrapped/migrations/0007_spotifywrap_liked_by.py create mode 100644 Wrapped/migrations/0008_remove_spotifywrap_liked_by_spotifywrap_liked_by.py diff --git a/Wrapped/migrations/0007_spotifywrap_liked_by.py b/Wrapped/migrations/0007_spotifywrap_liked_by.py new file mode 100644 index 0000000..5714398 --- /dev/null +++ b/Wrapped/migrations/0007_spotifywrap_liked_by.py @@ -0,0 +1,21 @@ +# Generated by Django 5.1.2 on 2024-11-30 23:27 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('Wrapped', '0006_alter_spotifywrap_uuid'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.AddField( + model_name='spotifywrap', + name='liked_by', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='liked_by', to=settings.AUTH_USER_MODEL), + ), + ] diff --git a/Wrapped/migrations/0008_remove_spotifywrap_liked_by_spotifywrap_liked_by.py b/Wrapped/migrations/0008_remove_spotifywrap_liked_by_spotifywrap_liked_by.py new file mode 100644 index 0000000..62a4b70 --- /dev/null +++ b/Wrapped/migrations/0008_remove_spotifywrap_liked_by_spotifywrap_liked_by.py @@ -0,0 +1,24 @@ +# Generated by Django 5.1.2 on 2024-11-30 23:51 + +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('Wrapped', '0007_spotifywrap_liked_by'), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.RemoveField( + model_name='spotifywrap', + name='liked_by', + ), + migrations.AddField( + model_name='spotifywrap', + name='liked_by', + field=models.ManyToManyField(blank=True, related_name='liked_wraps', to=settings.AUTH_USER_MODEL), + ), + ] From c9c15dded014ac933e1a8451b4a5ee3b217af0eb Mon Sep 17 00:00:00 2001 From: Theo Date: Sun, 1 Dec 2024 08:21:20 -0800 Subject: [PATCH 07/32] Update urls.py --- Wrapped/urls.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Wrapped/urls.py b/Wrapped/urls.py index 1edc648..d4e4ef8 100644 --- a/Wrapped/urls.py +++ b/Wrapped/urls.py @@ -3,7 +3,7 @@ from UserAuth.views import delete_account -from .views import (create_wrap, like_wrap, make_wraps_public, +from .views import (create_wrap, like_unlike_wrap, make_wraps_public, view_public_wraps, view_wrap, view_wraps) urlpatterns = [ @@ -11,7 +11,7 @@ path("create_wrap/", create_wrap, name="create_wrap"), path("create_wrap/", create_wrap, name="create_wrap"), path("view_wrap/wrap_id_/", view_wrap, name="view_wrap"), - path("wrap//like", like_wrap, name="like_unlike_wrap"), + path("wrap//like", like_unlike_wrap, name="like_unlike_wrap"), path("make_wraps_public/", make_wraps_public, name="make_wraps_public"), path("view_public_wraps/", view_public_wraps, name="view_public_wraps"), path("delete_account/", delete_account, name="delete_account"), From a5ef61c32373363de9e96fe3307aa2161e7094ca Mon Sep 17 00:00:00 2001 From: Theo Date: Sun, 1 Dec 2024 08:22:55 -0800 Subject: [PATCH 08/32] switched to wrap id from uuid (in name only) --- Wrapped/views.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Wrapped/views.py b/Wrapped/views.py index 547863c..d6167df 100644 --- a/Wrapped/views.py +++ b/Wrapped/views.py @@ -76,9 +76,9 @@ def view_public_wraps(request): @login_required -def like_unlike_wrap(request, wrap_uuid): +def like_unlike_wrap(request, wrap_id): if request.method == "POST": - wrap = get_object_or_404(SpotifyWrap, uuid=wrap_uuid) + wrap = get_object_or_404(SpotifyWrap, uuid=wrap_id) # Toggle like/unlike status if request.user in wrap.liked_by.all(): @@ -154,8 +154,6 @@ def view_wrap(request, wrap_id): }, ) - -# TODO def like_wrap(request, wrap_id): wrap = get_object_or_404(SpotifyWrap, uuid=wrap_id) From 5b254383d2f3c9e5c6cab27fd9f2f4da0c9e87a0 Mon Sep 17 00:00:00 2001 From: "Seegobin, Varindra" Date: Sun, 1 Dec 2024 11:49:50 -0500 Subject: [PATCH 09/32] =?UTF-8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0=80=E2=A1=84=E2=A1=80=E2=A0=99=E2=A2=BE=E2=A3=9F=E2=A2=AF?= =?UTF-8?q?=E2=A3=BF=E2=A1=BF=E2=A0=BF=E2=A0=BF=E2=A2=BF=E2=A3=BF=E2=A3=BF?= =?UTF-8?q?=E2=A1=BF=E2=A3=BF=E2=A0=80=E2=A0=80=20=E2=A0=80=E2=A0=80?= =?UTF-8?q?=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80?= =?UTF-8?q?=E2=A0=80=E2=A0=80=E2=A0=B3=E2=A3=A4=E2=A3=A4=E2=A3=A4=E2=A3=A4?= =?UTF-8?q?=E2=A3=BC=E2=A3=BF=E2=A3=BF=E2=A1=87=E2=A0=88=E2=A0=A0=E2=A0=84?= =?UTF-8?q?=E2=A0=80=E2=A0=99=E2=A3=BF=E2=A3=BF=E2=A1=BF=E2=A0=80=E2=A0=80?= =?UTF-8?q?=20=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80?= =?UTF-8?q?=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=80?= =?UTF-8?q?=E2=A0=88=E2=A0=81=E2=A0=81=E2=A0=80=E2=A0=80=E2=A0=80=E2=A0=98?= =?UTF-8?q?=E2=A0=BF=E2=A3=AD=E2=A3=89=E2=A3=89=E2=A3=A9=E2=A1=B5=E2=A0=8B?= =?UTF-8?q?=E2=A0=80=E2=A0=80=E2=A0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/UserAuth/login.html | 52 +++++++++++---------- templates/Wrapped/view_public_wraps.html | 58 ++++++++++++++---------- 2 files changed, 60 insertions(+), 50 deletions(-) diff --git a/templates/UserAuth/login.html b/templates/UserAuth/login.html index a57c47e..8bf6cf7 100644 --- a/templates/UserAuth/login.html +++ b/templates/UserAuth/login.html @@ -1,31 +1,33 @@ {% extends 'UserAuth/base.html' %} {% load static %} {% block body %} -
- {% csrf_token %} -

Sign in

-
-
- - {{ form.email.errors }} - {{ form.email }} +
+ + {% csrf_token %} +

Sign in

+
+
+ + {{ form.email.errors }} + {{ form.email }} +
+
+ + {{ form.password.errors }} + {{ form.password }} +
+ + + + + -
- - {{ form.password.errors }} - {{ form.password }} -
- - - - - {% endblock %} diff --git a/templates/Wrapped/view_public_wraps.html b/templates/Wrapped/view_public_wraps.html index bf0bfc1..7329b8c 100644 --- a/templates/Wrapped/view_public_wraps.html +++ b/templates/Wrapped/view_public_wraps.html @@ -22,37 +22,45 @@

Public Wraps

{% endfor %} {% endblock %} From f44b5037fa8751eb1aea8550b289f5890e7e347a Mon Sep 17 00:00:00 2001 From: "Seegobin, Varindra" Date: Sun, 1 Dec 2024 12:07:52 -0500 Subject: [PATCH 10/32] Fixed profile issues, added styling to wrap buttons. --- UserAuth/static/UserAuth/styles.css | 43 +++++++++++++++++++------- templates/UserAuth/profile.html | 48 ++++++++++++++--------------- 2 files changed, 56 insertions(+), 35 deletions(-) diff --git a/UserAuth/static/UserAuth/styles.css b/UserAuth/static/UserAuth/styles.css index 722bf75..acae40e 100644 --- a/UserAuth/static/UserAuth/styles.css +++ b/UserAuth/static/UserAuth/styles.css @@ -602,20 +602,41 @@ ul { margin-bottom: 10px; } -.wrap form button { - background-color: #1DB954; - color: white; - border: none; - border-radius: 5px; - padding: 10px 15px; - font-size: 0.9em; - font-weight: bold; +.wrap-buttons { + display: flex; + gap: 10px; /* Space between buttons */ + margin-top: 10px; /* Add some spacing above the buttons */ +} + +.wrap-buttons form { + margin: 0; +} + +.wrap-buttons button { + padding: 8px 12px; + font-size: 14px; + border: 1px solid #ccc; + border-radius: 4px; + background-color: #f8f9fa; cursor: pointer; - transition: background-color 0.3s, transform 0.2s; + transition: background-color 0.3s ease, border-color 0.3s ease; +} + +.wrap-buttons button:hover { + background-color: #e9ecef; + border-color: #bbb; +} + +.wrap-buttons .like-button { + color: #007bff; +} + +.wrap-buttons .delete-button { + color: #dc3545; } -.wrap form button:hover { - background-color: #14863E; +.wrap-buttons .post-button { + color: #28a745; } @media (max-width: 768px) { diff --git a/templates/UserAuth/profile.html b/templates/UserAuth/profile.html index 13077bc..2b04b6f 100644 --- a/templates/UserAuth/profile.html +++ b/templates/UserAuth/profile.html @@ -1,6 +1,6 @@ {% extends 'UserAuth/base.html' %} {% block body %} -

{{ user.get_username }}'s Profile Page

+

{{ user.get_username }}'s Profile


{% endfor %} @@ -77,5 +82,15 @@

{{ wrap.title }}

}); }); }); + +function share(text, url) { + const shareData = { + title: "SpotifyWrapped", + text: text, + url: url, + }; + + navigator.share(shareData); +} {% endblock %} diff --git a/templates/Wrapped/view_public_wraps.html b/templates/Wrapped/view_public_wraps.html index df9dd7b..2472f49 100644 --- a/templates/Wrapped/view_public_wraps.html +++ b/templates/Wrapped/view_public_wraps.html @@ -29,6 +29,11 @@

{{ wrap.title }}

{% endif %} +
{% endfor %} @@ -81,5 +86,15 @@

{{ wrap.title }}

}); }); }); + +function share(text, url) { + const shareData = { + title: "SpotifyWrapped", + text: text, + url: url, + }; + + navigator.share(shareData); +} {% endblock %} From 31456ecc9def8ade5b168fa9a4f208dc6c319277 Mon Sep 17 00:00:00 2001 From: Theo Date: Sun, 1 Dec 2024 22:10:31 -0500 Subject: [PATCH 30/32] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 246567c..a445b11 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ https://github.com/orgs/GeorgiaTechTeam18/projects/2/ #### run the project ```bash . .venv/bin/activate -python manage.py runserver python manage.py migrate +python manage.py runserver ``` #### regenerate files after modifications ```bash From 21c4992c4ce700cc81ea7449c4f9832705fcd840 Mon Sep 17 00:00:00 2001 From: Theo Date: Tue, 3 Dec 2024 19:49:40 -0500 Subject: [PATCH 31/32] hotfix: if user doesn't have token don't try to supply one for web playback sdk --- Wrapped/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Wrapped/views.py b/Wrapped/views.py index 67da27a..f8d20c5 100644 --- a/Wrapped/views.py +++ b/Wrapped/views.py @@ -185,6 +185,9 @@ def view_wrap(request, wrap_id): wrap.get_audio_features() ) selected_tracks = select_tracks(tracks, artists, genres) + spotify_webplayback_token = "" + if (request.user.is_authenticated and get_user_tokens(request.user)): + spotify_webplayback_token = get_user_tokens(request.user).access_token return render( request, "Wrapped/view_wrap.html", @@ -198,7 +201,7 @@ def view_wrap(request, wrap_id): "audio_features_graphs": audio_features_graphs, "audio_features_list": audio_features_list, "selected_tracks": selected_tracks, - "access_token": get_user_tokens(request.user).access_token, + "access_token": spotify_webplayback_token, }, ) From 61d125e8aabd087a083afedc60316fc8ff7c1bd3 Mon Sep 17 00:00:00 2001 From: dumax315 <26506274+dumax315@users.noreply.github.com> Date: Wed, 4 Dec 2024 00:51:27 +0000 Subject: [PATCH 32/32] Auto code format --- UserAuth/urls.py | 1 - .../migrations/0007_spotifywrap_liked_by.py | 13 +- ...otifywrap_liked_by_spotifywrap_liked_by.py | 15 +- .../0009_alter_spotifywrap_is_public.py | 6 +- Wrapped/models.py | 3 +- Wrapped/urls.py | 7 +- Wrapped/views.py | 81 ++++++---- templates/UserAuth/login.html | 20 +-- templates/UserAuth/profile.html | 75 +++++---- templates/Wrapped/view_liked_wraps.html | 145 +++++++++-------- templates/Wrapped/view_public_wraps.html | 152 +++++++++--------- 11 files changed, 277 insertions(+), 241 deletions(-) diff --git a/UserAuth/urls.py b/UserAuth/urls.py index d05dd16..6b0bb70 100644 --- a/UserAuth/urls.py +++ b/UserAuth/urls.py @@ -13,6 +13,5 @@ path("unlink/", views.delete_token, name="unlink_token"), path("view_wraps/", include("Wrapped.urls"), name="view_wraps"), path("delete-wrap//", views.delete_wrap, name="delete_wrap"), - path("contact/", views.contact, name="contact"), ] diff --git a/Wrapped/migrations/0007_spotifywrap_liked_by.py b/Wrapped/migrations/0007_spotifywrap_liked_by.py index 5714398..333d723 100644 --- a/Wrapped/migrations/0007_spotifywrap_liked_by.py +++ b/Wrapped/migrations/0007_spotifywrap_liked_by.py @@ -8,14 +8,19 @@ class Migration(migrations.Migration): dependencies = [ - ('Wrapped', '0006_alter_spotifywrap_uuid'), + ("Wrapped", "0006_alter_spotifywrap_uuid"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.AddField( - model_name='spotifywrap', - name='liked_by', - field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='liked_by', to=settings.AUTH_USER_MODEL), + model_name="spotifywrap", + name="liked_by", + field=models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.CASCADE, + related_name="liked_by", + to=settings.AUTH_USER_MODEL, + ), ), ] diff --git a/Wrapped/migrations/0008_remove_spotifywrap_liked_by_spotifywrap_liked_by.py b/Wrapped/migrations/0008_remove_spotifywrap_liked_by_spotifywrap_liked_by.py index 62a4b70..5db60c6 100644 --- a/Wrapped/migrations/0008_remove_spotifywrap_liked_by_spotifywrap_liked_by.py +++ b/Wrapped/migrations/0008_remove_spotifywrap_liked_by_spotifywrap_liked_by.py @@ -7,18 +7,21 @@ class Migration(migrations.Migration): dependencies = [ - ('Wrapped', '0007_spotifywrap_liked_by'), + ("Wrapped", "0007_spotifywrap_liked_by"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.RemoveField( - model_name='spotifywrap', - name='liked_by', + model_name="spotifywrap", + name="liked_by", ), migrations.AddField( - model_name='spotifywrap', - name='liked_by', - field=models.ManyToManyField(blank=True, related_name='liked_wraps', to=settings.AUTH_USER_MODEL), + model_name="spotifywrap", + name="liked_by", + field=models.ManyToManyField( + blank=True, + related_name="liked_wraps", + to=settings.AUTH_USER_MODEL), ), ] diff --git a/Wrapped/migrations/0009_alter_spotifywrap_is_public.py b/Wrapped/migrations/0009_alter_spotifywrap_is_public.py index f492dd6..c9e18ad 100644 --- a/Wrapped/migrations/0009_alter_spotifywrap_is_public.py +++ b/Wrapped/migrations/0009_alter_spotifywrap_is_public.py @@ -6,13 +6,13 @@ class Migration(migrations.Migration): dependencies = [ - ('Wrapped', '0008_remove_spotifywrap_liked_by_spotifywrap_liked_by'), + ("Wrapped", "0008_remove_spotifywrap_liked_by_spotifywrap_liked_by"), ] operations = [ migrations.AlterField( - model_name='spotifywrap', - name='is_public', + model_name="spotifywrap", + name="is_public", field=models.BooleanField(default=False), ), ] diff --git a/Wrapped/models.py b/Wrapped/models.py index 3f67c72..2943cb2 100644 --- a/Wrapped/models.py +++ b/Wrapped/models.py @@ -17,7 +17,8 @@ class SpotifyWrap(models.Model): audio_features = models.TextField(default="{}") is_public = models.BooleanField(default=False) likes = models.IntegerField(default=0) - liked_by = models.ManyToManyField(User, related_name="liked_wraps", blank=True) + liked_by = models.ManyToManyField( + User, related_name="liked_wraps", blank=True) def set_top_artists(self, artists_data): self.artists = json.dumps(artists_data) diff --git a/Wrapped/urls.py b/Wrapped/urls.py index 4759a1f..86fba95 100644 --- a/Wrapped/urls.py +++ b/Wrapped/urls.py @@ -3,8 +3,9 @@ from UserAuth.views import delete_account -from .views import (create_wrap, like_unlike_wrap, make_wraps_public, - view_public_wraps, view_wrap, view_wraps, view_liked_wraps, make_wraps_private) +from .views import (create_wrap, like_unlike_wrap, make_wraps_private, + make_wraps_public, view_liked_wraps, view_public_wraps, + view_wrap, view_wraps) urlpatterns = [ path("view_wraps/", view_wraps, name="view_wraps"), @@ -15,6 +16,6 @@ path("make_wraps_public/", make_wraps_public, name="make_wraps_public"), path("view_public_wraps/", view_public_wraps, name="view_public_wraps"), path("delete_account/", delete_account, name="delete_account"), - path('liked-wraps/', view_liked_wraps, name='view_liked_wraps'), + path("liked-wraps/", view_liked_wraps, name="view_liked_wraps"), path("make_wraps_private/", make_wraps_private, name="make_wraps_private"), ] diff --git a/Wrapped/views.py b/Wrapped/views.py index f8d20c5..b0f9a4c 100644 --- a/Wrapped/views.py +++ b/Wrapped/views.py @@ -3,17 +3,15 @@ from datetime import datetime import requests -from django.http import JsonResponse, HttpResponseServerError -from django.shortcuts import render, redirect, get_object_or_404 from django.contrib.auth.decorators import login_required from django.contrib.auth.models import AnonymousUser -from django.http import HttpResponseRedirect -from django.http import HttpResponseNotFound, JsonResponse +from django.db.models import Exists, OuterRef +from django.http import (HttpResponseNotFound, HttpResponseRedirect, + HttpResponseServerError, JsonResponse) from django.shortcuts import get_object_or_404, redirect, render from UserAuth.models import SpotifyToken from UserAuth.util import get_user_tokens -from django.db.models import Exists, OuterRef from .models import SpotifyWrap @@ -33,6 +31,7 @@ def make_wraps_public(request): return redirect("profile") + def make_wraps_private(request): wrap_ids = request.POST.getlist("wrap_ids") action = request.POST.get("action") @@ -61,8 +60,8 @@ def view_liked_wraps(request): public_wraps = public_wraps.filter(is_liked_by_user=True) - if request.method == 'POST': - wrap_uuid = request.POST.get('wrap_uuid') + if request.method == "POST": + wrap_uuid = request.POST.get("wrap_uuid") wrap = get_object_or_404(SpotifyWrap, uuid=wrap_uuid) liked = None @@ -77,14 +76,21 @@ def view_liked_wraps(request): wrap.save() print(liked) - return JsonResponse({ - "success": True, - "liked": liked, - "wrap_uuid": wrap.uuid, - }) - return render(request, "Wrapped/view_liked_wraps.html", { - "wraps": public_wraps, - }) + return JsonResponse( + { + "success": True, + "liked": liked, + "wrap_uuid": wrap.uuid, + } + ) + return render( + request, + "Wrapped/view_liked_wraps.html", + { + "wraps": public_wraps, + }, + ) + def view_public_wraps(request): public_wraps = SpotifyWrap.objects.filter(is_public=True).annotate( @@ -96,9 +102,8 @@ def view_public_wraps(request): ) ) - - if request.method == 'POST': - wrap_uuid = request.POST.get('wrap_uuid') + if request.method == "POST": + wrap_uuid = request.POST.get("wrap_uuid") wrap = get_object_or_404(SpotifyWrap, uuid=wrap_uuid) liked = None @@ -113,14 +118,20 @@ def view_public_wraps(request): wrap.save() print(liked) - return JsonResponse({ - "success": True, - "liked": liked, - "wrap_uuid": wrap.uuid, - }) - return render(request, "Wrapped/view_public_wraps.html", { - "wraps": public_wraps, - }) + return JsonResponse( + { + "success": True, + "liked": liked, + "wrap_uuid": wrap.uuid, + } + ) + return render( + request, + "Wrapped/view_public_wraps.html", + { + "wraps": public_wraps, + }, + ) @login_required @@ -140,14 +151,17 @@ def like_unlike_wrap(request, wrap_id): wrap.save() - return JsonResponse({ - "success": True, - "liked": liked, - "wrap_uuid": wrap.uuid, - }) + return JsonResponse( + { + "success": True, + "liked": liked, + "wrap_uuid": wrap.uuid, + } + ) return JsonResponse({"success": False, "message": "Invalid request."}) + def view_wraps(request): wraps = SpotifyWrap.objects.filter(user=request.user) return render(request, "Wrapped/view_wraps.html", {"wraps": wraps}) @@ -186,7 +200,7 @@ def view_wrap(request, wrap_id): ) selected_tracks = select_tracks(tracks, artists, genres) spotify_webplayback_token = "" - if (request.user.is_authenticated and get_user_tokens(request.user)): + if request.user.is_authenticated and get_user_tokens(request.user): spotify_webplayback_token = get_user_tokens(request.user).access_token return render( request, @@ -205,6 +219,7 @@ def view_wrap(request, wrap_id): }, ) + def like_wrap(request, wrap_id): wrap = get_object_or_404(SpotifyWrap, uuid=wrap_id) @@ -216,7 +231,7 @@ def like_wrap(request, wrap_id): message = "Liked" wrap.save() - return JsonResponse({'message': message}) + return JsonResponse({"message": message}) key_map = { diff --git a/templates/UserAuth/login.html b/templates/UserAuth/login.html index 551b965..3daca2a 100644 --- a/templates/UserAuth/login.html +++ b/templates/UserAuth/login.html @@ -2,36 +2,28 @@ {% load static %} {% block body %}
-
- {% csrf_token %} -

Sign in

-
+ + {% csrf_token %} +

Sign in

+
{% if form.email.errors %}
- {% for error in form.email.errors %} -

{{ error }}

- {% endfor %} + {% for error in form.email.errors %}

{{ error }}

{% endfor %}
{% endif %} -
{{ form.email }}
- {% if form.password.errors %}
- {% for error in form.password.errors %} -

{{ error }}

- {% endfor %} + {% for error in form.password.errors %}

{{ error }}

{% endfor %}
{% endif %} - - diff --git a/templates/UserAuth/profile.html b/templates/UserAuth/profile.html index c609b34..10285e5 100644 --- a/templates/UserAuth/profile.html +++ b/templates/UserAuth/profile.html @@ -35,35 +35,42 @@

Spotify Accounts

{% if wraps is not none %}

Spotify Wraps

    - {% for wrap in wraps %} -
  • -

    {{ wrap.title }}

    - View this wrap -

    Posted by: {{ wrap.user.username }}

    -
    - - {% csrf_token %} - - -
    - {% csrf_token %} - - {% if wrap.is_public %} - - - {% else %} - - - {% endif %} -
    - -
    -
  • - {% endfor %} + {% for wrap in wraps %} +
  • +

    {{ wrap.title }}

    + View this wrap +

    Posted by: {{ wrap.user.username }}

    +
    +
    + {% csrf_token %} + +
    +
    + {% csrf_token %} + + {% if wrap.is_public %} + + + {% else %} + + + {% endif %} +
    + +
    +
  • + {% endfor %}
{% else %}
@@ -101,14 +108,14 @@

{{ wrap.title }}

} }); }); - + function share(text, url) { const shareData = { - title: "SpotifyWrapped", - text: text, - url: url, + title: "SpotifyWrapped", + text: text, + url: url, }; - + navigator.share(shareData); } diff --git a/templates/Wrapped/view_liked_wraps.html b/templates/Wrapped/view_liked_wraps.html index e1bfb4a..a482a09 100644 --- a/templates/Wrapped/view_liked_wraps.html +++ b/templates/Wrapped/view_liked_wraps.html @@ -1,7 +1,8 @@ {% extends 'UserAuth/base.html' %} {% block title %}Liked Wraps{% endblock %} {% block body %} -

+
+

Favorite Wraps

@@ -11,28 +12,35 @@

Favorite Wraps

{% if wraps %}
    {% for wrap in wraps %} -
  • -

    {{ wrap.title }}

    - View this wrap -

    Posted by: {{ wrap.user.username }}

    -
    - -
  • +

    {{ wrap.title }}

    + View this wrap +

    Posted by: {{ wrap.user.username }}

    +
    + +
    -
- + {% endfor %} {% else %} @@ -40,57 +48,56 @@

{{ wrap.title }}

You haven't liked any wraps yet. Check out some public wraps!

{% endif %} + + function share(text, url) { + const shareData = { + title: "SpotifyWrapped", + text: text, + url: url, + }; + + navigator.share(shareData); + } + {% endblock %} diff --git a/templates/Wrapped/view_public_wraps.html b/templates/Wrapped/view_public_wraps.html index 2472f49..2485140 100644 --- a/templates/Wrapped/view_public_wraps.html +++ b/templates/Wrapped/view_public_wraps.html @@ -1,100 +1,106 @@ {% extends 'UserAuth/base.html' %} {% block title %}Public Wraps{% endblock %} {% block body %} -

+
+

All Wraps

- {% if wraps %} -

Take a look at some wraps generated by the community.

- {% endif %} + {% if wraps %}

Take a look at some wraps generated by the community.

{% endif %}
Favorites
{% if wraps %}
    {% for wrap in wraps %} -
  • -

    {{ wrap.title }}

    - View this wrap -

    Posted by: {{ wrap.user.username }}

    -
    - -
  • +

    {{ wrap.title }}

    + View this wrap +

    Posted by: {{ wrap.user.username }}

    +
    + +
    -
- + {% endfor %} {% else %} -

+
+

There are no public wraps yet. Be the first!

{% endif %} + + function share(text, url) { + const shareData = { + title: "SpotifyWrapped", + text: text, + url: url, + }; + + navigator.share(shareData); + } + {% endblock %}