Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
Cleaned up code
Browse files Browse the repository at this point in the history
  • Loading branch information
Elias committed Apr 28, 2020
1 parent ee9c077 commit d7d3d17
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
2 changes: 0 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def home_page():
@app.route("/login")
def login_page():
auth_url = f'{API_BASE}/authorize?client_id={SPOTIFY_CLIENT_ID}&response_type=code&redirect_uri={SPOTIFY_REDIRECT_URI}&scope={SCOPE}&show_dialog={SHOW_DIALOG}'
print(auth_url)
return redirect(auth_url)

@app.route("/callback")
Expand All @@ -65,7 +64,6 @@ def callback():
})

res_body = res.json()
print(res.json())
session["token"] = res_body.get("access_token")

return redirect("login_success")
Expand Down
2 changes: 1 addition & 1 deletion templates/callback.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<h1 style='margin-top: 8.5em;'>Sortify</h1>
<form action="/login" method="POST" style="margin-top: 3em;">
<a href="/login">
<div id="cssbutt" style="background: rgb(29, 185, 84); border-radius: 1000px; padding: 20px 45px; color: rgb(255, 255, 255); display: inline-block; font: bold 24px / 1 &quot;Open Sans&quot;, sans-serif; text-align: center;">Login</div>
<div id="button-1" style="background: #1DB954; border-radius: 1000px; padding: 20px 45px; color: #ffffff; display: inline-block; font: normal bold 24px/1 'Open Sans', sans-serif; text-align: center;">Login</div>
</a>
</form>
</div>
Expand Down
4 changes: 2 additions & 2 deletions templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
<h1 style='margin-top: 8.5em;'>Sortify</h1>
<form action="/login" method="POST" style="margin-top: 3em;">
<a href="/login">
<div id="cssbutt" style="background: rgb(29, 185, 84); border-radius: 1000px; padding: 20px 45px; color: rgb(255, 255, 255); display: inline-block; font: bold 24px / 1 &quot;Open Sans&quot;, sans-serif; text-align: center;">Login</div>
<div id="button-1" style="background: #1DB954; border-radius: 1000px; padding: 20px 45px; color: #ffffff; display: inline-block; font: normal bold 24px/1 'Open Sans', sans-serif; text-align: center;">Login</div>
</a>
</form>
</div>

<section class="section" id="about-section">
<div class="container" align="center" style="margin-top: 24em;">
<h1>About Sortify</h1>
<p style="text-align: center; margin-top: 1.5em;">Sortify is a Python app built with the Flask framework. It uses the Spotipy API to allow you to view and sort your Spotify playlists to your heart's content.</p>
<p style="text-align: center; margin-top: 1em;">Sortify is a Python app built with the Flask framework. It uses the Spotipy API to allow you to view and sort your Spotify playlists to your heart's content.</p>
</div>
<a href="https://github.com/eliasbenb/Sortify" target="_blank"><h6 align="center" style="margin-top: 0.5em;">Source Code</h4></a>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/login_success.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1 style='margin-top: 8.5em;'>Login Successful!</h1>
<form action="/playlists" method="POST" align="center" style="margin-top: 3em;">
<a href="/playlists">
<div id="cssbutt" style="background: rgb(29, 185, 84); border-radius: 1000px; padding: 20px 45px; color: rgb(255, 255, 255); display: inline-block; font: bold 24px / 1 &quot;Open Sans&quot;, sans-serif; text-align: center;">Go to Sortify</div>
<div id="button-1" style="background: #1DB954; border-radius: 1000px; padding: 20px 45px; color: #ffffff; display: inline-block; font: normal bold 24px/1 'Open Sans', sans-serif; text-align: center;">Go to Sortify</div>
</a>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/not_your_playlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1 style='margin-top: 8.5em;'>This is not your playlist!</h1>
<h5 style="margin-top: 1em;">You do not own this playlist, and so can't edit it. I reccomend duplicating the playlist and editing the duplicated one.</h5>
<form action="/playlists" method="POST" align="center" style="margin-top: 2em;">
<a href="/playlists">
<div id="cssbutt" style="background: rgb(29, 185, 84); border-radius: 1000px; padding: 20px 45px; color: rgb(255, 255, 255); display: inline-block; font: bold 24px / 1 &quot;Open Sans&quot;, sans-serif; text-align: center;">Go back to Playlists</div>
<div id="button-1" style="background: #1DB954; border-radius: 1000px; padding: 20px 45px; color: #ffffff; display: inline-block; font: normal bold 24px/1 'Open Sans', sans-serif; text-align: center;">Go Back to Playlists</div>
</a>
</form>
</div>
Expand Down
12 changes: 6 additions & 6 deletions templates/playlist.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<h1 style='margin-top: 8.5em;'>{{ playlist['name'] }}</h1>
<form action="#tracks" method="POST" style="margin-top: 3em;">
<a href="#tracks">
<div id="cssbutt" style="background: rgb(29, 185, 84); border-radius: 1000px; padding: 20px 45px; color: rgb(255, 255, 255); display: inline-block; font: bold 24px / 1 &quot;Open Sans&quot;, sans-serif; text-align: center;">View Tracks</div>
<div id="button-1" style="background: #1DB954; border-radius: 1000px; padding: 20px 45px; color: #ffffff; display: inline-block; font: normal bold 24px/1 'Open Sans', sans-serif; text-align: center;">View Tracks</div>
</a>
</form>
</div>
Expand Down Expand Up @@ -58,10 +58,10 @@ <h1 style='margin-top: 8.5em;'>{{ playlist['name'] }}</h1>
<section align="center" class="section" id="sort-options">
<h1>Sort Options</h1>
<div class="container" style="margin-top: 2em; margin-bottom: 1em;">
<a href = "/playlists/{{ index }}/alphabetical-az"><div id="cssbutt" style="background: #1db954; border-radius: 11px; width: 325px; height: 60px; color: #ffffff; display: inline-block; font: normal bold 16px/60px 'Open Sans', sans-serif; text-align: center; margin-top: 0.25em;">Alphabetical (A-Z)</div></a>
<a href = "/playlists/{{ index }}/alphabetical-za"><div id="cssbutt" style="background: #1db954; border-radius: 11px; width: 325px; height: 60px; color: #ffffff; display: inline-block; font: normal bold 16px/60px 'Open Sans', sans-serif; text-align: center; margin-top: 0.25em;">Alphabetical (Z-A)</div></a>
<a href = "/playlists/{{ index }}/release_date-chronological"><div id="cssbutt" style="background: #1db954; border-radius: 11px; width: 325px; height: 60px; color: #ffffff; display: inline-block; font: normal bold 16px/60px 'Open Sans', sans-serif; text-align: center; margin-top: 0.25em;">Release Date (Chronological)</div></a>
<a href = "/playlists/{{ index }}/release_date-non_chronological"><div id="cssbutt" style="background: #1db954; border-radius: 11px; width: 325px; height: 60px; color: #ffffff; display: inline-block; font: normal bold 16px/60px 'Open Sans', sans-serif; text-align: center; margin-top: 0.25em;">Release Date (Non Chronological)</div></a>
<a href = "/playlists/{{ index }}/added_at"><div id="cssbutt" style="background: #1db954; border-radius: 11px; width: 325px; height: 60px; color: #ffffff; display: inline-block; font: normal bold 16px/60px 'Open Sans', sans-serif; text-align: center; margin-top: 0.25em;">Added At</div></a>
<a href="/playlists/{{ index }}/alphabetical-az"><div id="button-2" style="background: #1db954; border-radius: 11px; width: 325px; height: 60px; color: #ffffff; display: inline-block; font: normal bold 16px/60px 'Open Sans', sans-serif; text-align: center; margin-top: 0.25em;">Alphabetical (A-Z)</div></a>
<a href="/playlists/{{ index }}/alphabetical-za"><div id="button-3" style="background: #1db954; border-radius: 11px; width: 325px; height: 60px; color: #ffffff; display: inline-block; font: normal bold 16px/60px 'Open Sans', sans-serif; text-align: center; margin-top: 0.25em;">Alphabetical (Z-A)</div></a>
<a href="/playlists/{{ index }}/release_date-chronological"><div id="button-4" style="background: #1db954; border-radius: 11px; width: 325px; height: 60px; color: #ffffff; display: inline-block; font: normal bold 16px/60px 'Open Sans', sans-serif; text-align: center; margin-top: 0.25em;">Release Date (Chronological)</div></a>
<a href="/playlists/{{ index }}/release_date-non_chronological"><div id="button-5" style="background: #1db954; border-radius: 11px; width: 325px; height: 60px; color: #ffffff; display: inline-block; font: normal bold 16px/60px 'Open Sans', sans-serif; text-align: center; margin-top: 0.25em;">Release Date (Non Chronological)</div></a>
<a href="/playlists/{{ index }}/added_at"><div id="button-6" style="background: #1db954; border-radius: 11px; width: 325px; height: 60px; color: #ffffff; display: inline-block; font: normal bold 16px/60px 'Open Sans', sans-serif; text-align: center; margin-top: 0.25em;">Added At</div></a>
</section>
{% endblock %}
2 changes: 1 addition & 1 deletion templates/playlists.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<h1 style='margin-top: 8.5em;'>Playlists</h1>
<form action="#playlists" method="POST" style="margin-top: 3em;">
<a href="#playlists">
<div id="cssbutt" style="background: rgb(29, 185, 84); border-radius: 1000px; padding: 20px 45px; color: rgb(255, 255, 255); display: inline-block; font: bold 24px / 1 &quot;Open Sans&quot;, sans-serif; text-align: center;">View Playlists</div>
<div id="button-1" style="background: #1DB954; border-radius: 1000px; padding: 20px 45px; color: #ffffff; display: inline-block; font: normal bold 24px/1 'Open Sans', sans-serif; text-align: center;">View Playlists</div>
</a>
</form>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/sorted.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h1 style='margin-top: 8.5em;'>{{ playlist['name'] }} was sorted successfully!</h1>
<form action="/playlists/{{ index }}" method="POST" style="margin-top: 3em;">
<a href="/playlists/{{ index }}#tracks">
<div id="cssbutt" style="background: rgb(29, 185, 84); border-radius: 1000px; padding: 20px 45px; color: rgb(255, 255, 255); display: inline-block; font: bold 24px / 1 &quot;Open Sans&quot;, sans-serif; text-align: center;">View Tracks</div>
<div id="button-1" style="background: #1DB954; border-radius: 1000px; padding: 20px 45px; color: #ffffff; display: inline-block; font: normal bold 24px/1 'Open Sans', sans-serif; text-align: center;">View Tracks</div>
</a>
</form>
</div>
Expand Down

0 comments on commit d7d3d17

Please sign in to comment.