Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
56dca2b
got rid of the tags in templates
dumax315 Nov 30, 2024
013fd13
got rid of i18n from settings
dumax315 Nov 30, 2024
9d033c9
added link to public wraps in header
dumax315 Nov 30, 2024
93be26d
Auto code format
dumax315 Nov 30, 2024
e980e02
Merge pull request #59 from GeorgiaTechTeam18/python-code-format-patches
dumax315 Nov 30, 2024
4b53b69
Merge pull request #62 from GeorgiaTechTeam18/public-wraps-no-i18n
dumax315 Nov 30, 2024
5423523
got likes to actually register, though with a bug that after liking t…
VarindraSeegobin Dec 1, 2024
7f9bb3b
Merge remote-tracking branch 'origin/public-wraps-no-i18n' into publi…
VarindraSeegobin Dec 1, 2024
3a64544
got likes to actually register, though with a bug that after liking t…
VarindraSeegobin Dec 1, 2024
c9c15dd
Update urls.py
dumax315 Dec 1, 2024
a5ef61c
switched to wrap id from uuid (in name only)
dumax315 Dec 1, 2024
5b25438
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣶⠀⢀⣴⣶⡄⠀⠀⠀
VarindraSeegobin Dec 1, 2024
f44b503
Fixed profile issues, added styling to wrap buttons.
VarindraSeegobin Dec 1, 2024
1486c39
Fixed profile issues, added styling to wrap buttons.
VarindraSeegobin Dec 1, 2024
307f8e5
filter fix
StanleyWangGT Dec 1, 2024
ca5cab1
fix v2
StanleyWangGT Dec 1, 2024
7e4da5d
fix v3
StanleyWangGT Dec 1, 2024
d56ebde
fix v4
StanleyWangGT Dec 1, 2024
8963ea4
Added styling to public and liked wraps. More styling TBD.
VarindraSeegobin Dec 1, 2024
7221443
Added styling to view public wraps and view liked wraps.
VarindraSeegobin Dec 1, 2024
61e208b
added linkedin and twitter links
dumax315 Dec 1, 2024
0a5d18e
added twitter and linkedin icons
dumax315 Dec 1, 2024
8bf3f54
Added styling to the view public wraps and view favorite wraps pages.
VarindraSeegobin Dec 1, 2024
e45ab25
removed delete and post buttons from public wraps.
VarindraSeegobin Dec 1, 2024
a85cb50
changed is_public to default to false. make other minor changes.
VarindraSeegobin Dec 1, 2024
1e1100b
added the ability to make wraps private.
VarindraSeegobin Dec 1, 2024
f0bde0e
Fixed like bug. Added ability to remove a wrap from public wraps.
VarindraSeegobin Dec 1, 2024
be8e9d8
Merge pull request #64 from GeorgiaTechTeam18/public-wraps-no-i18n
VarindraSeegobin Dec 1, 2024
bc7aebd
removed likes from your wraps in profile page.
VarindraSeegobin Dec 2, 2024
edd170d
Merge pull request #66 from GeorgiaTechTeam18/RemoveLikesFromProfile
VarindraSeegobin Dec 2, 2024
6b61a95
Add LICENSE and README files
alexhool Dec 2, 2024
5c5d407
Update README.md
alexhool Dec 2, 2024
851cbff
added share button style
dumax315 Dec 2, 2024
925b193
Merge branch 'main' into share-links
dumax315 Dec 2, 2024
1c66ec3
share links on public pages
dumax315 Dec 2, 2024
7f01891
Merge pull request #69 from GeorgiaTechTeam18/share-links
dumax315 Dec 2, 2024
31456ec
Update README.md
dumax315 Dec 2, 2024
21c4992
hotfix: if user doesn't have token don't try to supply one for web pl…
dumax315 Dec 4, 2024
61d125e
Auto code format
dumax315 Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 GeorgiaTechTeam18

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
# SpotifyWrapper
# SpotifyWrapper

## Deliverables

### Team Website
https://team18gt.weebly.com/

### Spotify Wrapper GitHub repo
https://github.com/GeorgiaTechTeam18/SpotifyWrapper

### Project management board
https://github.com/orgs/GeorgiaTechTeam18/projects/2/

## command reference
#### run the project
```bash
. .venv/bin/activate
python manage.py migrate
python manage.py runserver
```
#### regenerate files after modifications
```bash
pip3 freeze > requirements.txt
python manage.py makemigrations
```
17 changes: 1 addition & 16 deletions SpotifyWrapper/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,7 @@

LANGUAGE_CODE = "en-us"
TIME_ZONE = "America/New_York"
USE_I18N = True
USE_L10N = True
USE_TZ = True
LANGUAGES = [
("en", ("English")),
("de", ("German")),
("fr", ("French")),
("sp", ("Spanish")),
]
LOCALE_PATHS = [
os.path.join(BASE_DIR, "locale"),
os.path.join(BASE_DIR, "UserAuth/locale"),
os.path.join(BASE_DIR, "Wrapped/locale"),
]

# Application definition

INSTALLED_APPS = [
Expand All @@ -80,8 +67,6 @@
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
"django.middleware.locale.LocaleMiddleware",
"django.middleware.common.CommonMiddleware",
]

ROOT_URLCONF = "SpotifyWrapper.urls"
Expand Down
114 changes: 103 additions & 11 deletions UserAuth/static/UserAuth/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,29 @@ main {
color: #A268DB;
}

.form-errors {
color: #ff4d4d; /* Red color for errors */
font-size: 14px;
margin-bottom: 10px;
}

.error-message {
margin: 5px 0;
}

.authForm .form-errors {
margin-bottom: 15px; /* Space between the errors and the form */
}

.authForm label {
display: block;
margin-top: 10px;
}

.authForm input, .authForm button {
margin-top: 5px;
}

.login-alternate {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -602,20 +625,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 form button:hover {
background-color: #14863E;
.wrap-buttons .like-button {
color: #007bff;
}

.wrap-buttons .delete-button {
color: #dc3545;
}

.wrap-buttons .post-button {
color: #28a745;
}

@media (max-width: 768px) {
Expand Down Expand Up @@ -671,6 +715,54 @@ ul {
}
}

/* Share buttons */
.share-container {
margin-left: auto;
}

.share-button {
border-radius: .3em;
padding: .3em;
background: #f8f9fa;
margin: 0;
font-size: large;
}

.share-button:hover {
background: #e3e3e4;
}

/* View public and liked wraps styling*/
.header-container {
display: flex;
align-items: center; /* Align items vertically */
justify-content: space-between; /* Keep the button to the right */
margin-bottom: 20px;
}

/* Text container to stack the heading and paragraph */
.text-container {
display: flex;
flex-direction: column; /* Stack items vertically */
}

/* Style the anchor tag like a Spotify button */
.spotify-button {
background-color: #1DB954;
color: black;
border: none;
border-radius: 50px;
padding: 10px 20px;
text-decoration: none;
font-weight: bold;
transition: background-color 0.3s ease;
}

/* Add hover effect */
.spotify-button:hover {
background-color: #1ed760;
}

@media (min-width: 768px) {
#hamburger {
display: none !important;
Expand Down
4 changes: 0 additions & 4 deletions UserAuth/util.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from .models import User, SpotifyToken
from django.utils import timezone
import datetime
from requests import post, get
import os
from dotenv import load_dotenv
from functools import cache

from django.utils import timezone
Expand Down
16 changes: 2 additions & 14 deletions UserAuth/views.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import secrets

from django.http import HttpResponseBadRequest
from django.shortcuts import render, redirect
from requests import Request, post, exceptions
from .util import update_or_create_user_tokens, get_top_song_album_covers
from .models import SpotifyToken
import os
import secrets

import requests
from django.contrib import messages
from django.contrib.auth import authenticate, get_user_model, login, logout
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseBadRequest
from django.shortcuts import get_object_or_404, redirect, render
from dotenv import load_dotenv
from requests import Request, exceptions, post
Expand Down Expand Up @@ -64,18 +58,14 @@ def authWithSpotify(request):
"redirect_uri": REDIRECT_URI,
"client_id": CLIENT_ID,
},
)
.prepare()
.url
)
) .prepare() .url)

return redirect(url)


def login_view(request):
if request.method == "POST":
form = RegistrationForm(request.POST)
print(form)
if form.is_valid():
user_data = form.cleaned_data
user = authenticate(
Expand Down Expand Up @@ -263,5 +253,3 @@ def getSpotifyUserData(access_token):
raise Exception(
f"Failed to retrieve user info. Status code: {response.status_code}"
)


26 changes: 26 additions & 0 deletions Wrapped/migrations/0007_spotifywrap_liked_by.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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,
),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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),
),
]
18 changes: 18 additions & 0 deletions Wrapped/migrations/0009_alter_spotifywrap_is_public.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 5.1.2 on 2024-12-01 22:52

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("Wrapped", "0008_remove_spotifywrap_liked_by_spotifywrap_liked_by"),
]

operations = [
migrations.AlterField(
model_name="spotifywrap",
name="is_public",
field=models.BooleanField(default=False),
),
]
4 changes: 3 additions & 1 deletion Wrapped/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ class SpotifyWrap(models.Model):
artists = models.TextField(default="[]")
tracks = models.TextField(default="[]")
audio_features = models.TextField(default="{}")
is_public = models.BooleanField(default=True)
is_public = models.BooleanField(default=False)
likes = models.IntegerField(default=0)
liked_by = models.ManyToManyField(
User, related_name="liked_wraps", blank=True)

def set_top_artists(self, artists_data):
self.artists = json.dumps(artists_data)
Expand Down
10 changes: 6 additions & 4 deletions Wrapped/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@

from UserAuth.views import delete_account

from .views import (create_wrap, like_wrap, make_wraps_public,
view_public_wraps, view_wrap,
view_wraps)
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"),
path("create_wrap/", create_wrap, name="create_wrap"),
path("create_wrap/<str:time_range>", create_wrap, name="create_wrap"),
path("view_wrap/wrap_id_<uuid:wrap_id>/", view_wrap, name="view_wrap"),
path("like_wrap/<uuid:wrap_id>/", like_wrap, name="like_wrap"),
path("wrap/<uuid:wrap_id>/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"),
path("liked-wraps/", view_liked_wraps, name="view_liked_wraps"),
path("make_wraps_private/", make_wraps_private, name="make_wraps_private"),
]
Loading