Commit 1d1fb543 authored by Brian Guadalupe's avatar Brian Guadalupe

Merge branch 'playlistwip' into 'master'

Adds search features, album views, artists views, and increases dummy data size

See merge request brian/mymusiclist!9
parents 0a2ae1d3 25209f3a
...@@ -10,6 +10,11 @@ Sqlite3 ...@@ -10,6 +10,11 @@ Sqlite3
.open db.sqlite3 .open db.sqlite3
.read SQL/sqlite3.sql .read SQL/sqlite3.sql
If you're not yet migrated, then do this first:
python manage.py makemigrations core
python manage.py migrate
Now you can view tables with .tables and run sql statements Now you can view tables with .tables and run sql statements
Assuming you have mysql installed, run: Assuming you have mysql installed, run:
......
-- Do NOT RUN -- Do NOT RUN
--artist extraction --artist extraction
INSERT INTO artist(id, name, description) INSERT INTO Artist(id, name, description)
select ag.artistid, ag.name, "No description available" from artists_group ag where ag.name in select ag.artistid, ag.name, "No description available" from artists_group ag where ag.name in
( (
"Taylor Swift", "Taylor Swift",
...@@ -26,18 +26,89 @@ select ag.artistid, ag.name, "No description available" from artists_group ag wh ...@@ -26,18 +26,89 @@ select ag.artistid, ag.name, "No description available" from artists_group ag wh
"Halsey", "Halsey",
"Jason Derulo", "Jason Derulo",
"ClariS", "ClariS",
"Post Malone" "Post Malone",
"5 Seconds of Summer",
"21 Savage",
"Adam Lambert",
"Adele",
"Alan Walker",
"Alessia Cara",
"Alesso",
"American Authors",
"Andy Grammer",
"Ariana Grande",
"Backstreet Boys",
"Bastille",
"Bebe Rexha",
"Big Sean",
"Bruno Mars",
"Calvin Harris",
"Camila Cabello",
"Cardiknox",
"The Chainsmokers",
"Charlie Puth",
"Chris Brown",
"Coldplay",
"David Guetta",
"Dawin",
"Daya",
"DJ Khaled",
"DNCE",
"Drake",
"Echosmith",
"Ellie Goulding",
"Fall Out Boy",
"Fetty Wap",
"Fifth Harmony",
"Flo Rida",
"Galantis",
"Hinder",
"Jay Sean",
"Imagine Dragons",
"Jason Derulo",
"Jason Mraz",
"Jessie J",
"Jonas Blue",
"Justin Bieber",
"Justin Timberlake",
"Katy Perry",
"Khalid",
"Lifehouse",
"Lorde",
"Maroon 5",
"Martin Garrix",
"Meghan Trainor",
"Miley Cyrus",
"Moderat",
"Nelly",
"Ne-Yo",
"Nicki Minaj",
"Owl City",
"Rihanna",
"Rixton",
"Sam Smith",
"The Script",
"Secondhand Serenade",
"Selena Gomez",
"Shawn Mendes",
"Sia",
"Starship",
"Troye Sivan",
"Twenty One Pilots",
"Wiz Khalifa",
"Zara Larsson",
"Zedd"
); );
--album extraction --album extraction
INSERT INTO album(id, album_name, year, artist_id) INSERT INTO Album(id, album_name, year, artist_id)
select tg.id, name, year, (select artistid from torrents_artists where groupid=tg.id order by importance asc limit 1) as artistidv select distinct tg.id, name, year, (select artistid from torrents_artists where groupid=tg.id order by importance asc limit 1) as artistidv
from torrents_group tg join torrents_artists ta on ta.groupid = tg.id from torrents_group tg join torrents_artists ta on ta.groupid = tg.id
where (select artistid from torrents_artists where groupid=tg.id order by importance asc limit 1) where (select artistid from torrents_artists where groupid=tg.id order by importance asc limit 1)
in (select id from artist) and (ta.artistid in (select id from artist)) and tg.releasetype=1 order by tg.id; in (select id from artist) and (ta.artistid in (select id from artist)) and tg.releasetype=1 order by tg.id;
--song extraction --song extraction
INSERT INTO song(song_name, genre, artist_id, album_id) INSERT INTO Song(song_name, genre, artist_id, album_id)
select (select filelist from torrents where groupid=album.id order by time desc limit 1), tg.taglist , artist.id, album.id select (select filelist from torrents where groupid=album.id order by time desc limit 1), tg.taglist , artist.id, album.id
from artist join album on album.artist_id = artist.id join torrents_group tg on tg.id = album.id; from artist join album on album.artist_id = artist.id join torrents_group tg on tg.id = album.id;
-- DO NOT RUN -- DO NOT RUN
create table user_account( create table UserAccount(
id int unique primary key auto_increment, id int unique primary key auto_increment,
first_name varchar(64) not null, first_name varchar(64) not null,
last_name varchar(64) not null, last_name varchar(64) not null,
email varchar(64) not null email varchar(64) not null
); );
create table artist( create table Artist(
id int unique primary key auto_increment, id int unique primary key auto_increment,
name varchar(64) not null, name varchar(64) not null,
description text description text
); );
create table album( create table Album(
id int unique primary key auto_increment, id int unique primary key auto_increment,
album_name varchar(64) not null, album_name varchar(64) not null,
year int(4) not null, year int(4) not null,
...@@ -20,7 +20,7 @@ create table album( ...@@ -20,7 +20,7 @@ create table album(
FOREIGN KEY (artist_id) REFERENCES artist(id) FOREIGN KEY (artist_id) REFERENCES artist(id)
); );
create table song( create table Song(
id int unique primary key auto_increment, id int unique primary key auto_increment,
song_name mediumtext not null, song_name mediumtext not null,
genre varchar(128), genre varchar(128),
...@@ -32,7 +32,7 @@ create table song( ...@@ -32,7 +32,7 @@ create table song(
FOREIGN KEY (album_id) REFERENCES album(id) FOREIGN KEY (album_id) REFERENCES album(id)
); );
create table music_playlist( create table MusicPlaylist(
id int unique primary key auto_increment, id int unique primary key auto_increment,
playlist_name varchar(32) not null, playlist_name varchar(32) not null,
is_public boolean not null, is_public boolean not null,
...@@ -40,7 +40,7 @@ create table music_playlist( ...@@ -40,7 +40,7 @@ create table music_playlist(
FOREIGN KEY (owner_id) REFERENCES user_account(id) FOREIGN KEY (owner_id) REFERENCES user_account(id)
); );
create table music_entry( create table MusicEntry(
id int unique primary key auto_increment, id int unique primary key auto_increment,
order_in_playlist int unique not null, order_in_playlist int unique not null,
rating ENUM('1','2','3','4','5','6','7','8','9','10'), rating ENUM('1','2','3','4','5','6','7','8','9','10'),
...@@ -50,12 +50,12 @@ create table music_entry( ...@@ -50,12 +50,12 @@ create table music_entry(
FOREIGN KEY (song_id) REFERENCES song(id) FOREIGN KEY (song_id) REFERENCES song(id)
); );
create table tag( create table Tag(
id int unique primary key auto_increment, id int unique primary key auto_increment,
name varchar(32) not null name varchar(32) not null
) )
create table tag_entry( create table TagEntry(
tag_id int, tag_id int,
entry_id int unique, entry_id int unique,
FOREIGN KEY (tag_id) REFERENCES tag(id), FOREIGN KEY (tag_id) REFERENCES tag(id),
......
This source diff could not be displayed because it is too large. You can view the blob instead.
# -*- coding: utf-8 -*-
# run in Django shell ONLY!!! # run in Django shell ONLY!!!
# python manage.py shell # python manage.py shell
# >>> exec(open('./SQL/populate_songs.py').read()) # >>> exec(open('./SQL/populate_songs.py').read())
from core.models import * from core.models import *
def extract_song_title(s): def extract_song_title(s):
clean = [] clean = []
i = 1 i = 1
for t in s.split(' ÷'): for t in s.split(u' ÷'):
if t == '': continue if t == '': continue
u = t.strip('\n').split() u = t.strip('\n').split()
if u[0] == '.flac' or u[0] == '.mp3' or u[0] == '.dts': if u[0] == '.flac' or u[0] == '.mp3' or u[0] == '.dts':
...@@ -18,12 +20,12 @@ def extract_song_title(s): ...@@ -18,12 +20,12 @@ def extract_song_title(s):
def prettify_genre(g): def prettify_genre(g):
return ', '.join([h.replace('_',' ') for h in g.split()]) return ', '.join([h.replace('_',' ') for h in g.split()])
for song in Song.objects.filter(song_name__startswith="."): for i in Song.objects.filter(song_name__startswith="."):
songlst = extract_song_title(song.song_name) songlst = extract_song_title(i.song_name)
for e in songlst: for e in songlst:
Song.objects.create(song_name=e, genre=prettify_genre(song.genre), artist=song.artist, album=song.album) Song.objects.create(song_name=e, genre=prettify_genre(i.genre), artist=i.artist, album=i.album)
# uncomment the next line if you want to delete the original entry after parsing # uncomment the next line if you want to delete the original entry after parsing
# song.delete() i.delete()
# if something messed up above, uncomment these lines # if something messed up above, uncomment these lines
# for song in Song.objects.exclude(song_name__startswith="."): # for song in Song.objects.exclude(song_name__startswith="."):
......
This source diff could not be displayed because it is too large. You can view the blob instead.
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-04 13:55
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Album',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('album_name', models.CharField(max_length=64)),
('year', models.DecimalField(decimal_places=0, max_digits=4)),
],
),
migrations.CreateModel(
name='Artist',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=64)),
('description', models.TextField()),
],
),
migrations.CreateModel(
name='MusicEntry',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('order_in_playlist', models.PositiveSmallIntegerField()),
('rating', models.DecimalField(choices=[(0, '1'), (1, '2'), (2, '3'), (3, '4'), (4, '5'), (5, '6'), (6, '7'), (7, '8'), (8, '9'), (9, '10')], decimal_places=0, max_digits=1)),
],
),
migrations.CreateModel(
name='MusicPlaylist',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('playlist_name', models.CharField(max_length=32)),
('is_public', models.BooleanField(default=False)),
],
),
migrations.CreateModel(
name='Song',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('song_name', models.TextField()),
('genre', models.CharField(max_length=128)),
('song_length', models.PositiveIntegerField(default=0, null=True)),
('lyrics', models.TextField(null=True)),
('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Album')),
('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Artist')),
],
),
migrations.CreateModel(
name='Tag',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('name', models.CharField(max_length=32)),
('tag', models.ManyToManyField(to='core.MusicEntry')),
],
),
migrations.CreateModel(
name='UserAccount',
fields=[
('id', models.AutoField(primary_key=True, serialize=False)),
('first_name', models.CharField(max_length=64)),
('last_name', models.CharField(max_length=64)),
('email', models.CharField(max_length=64)),
],
),
migrations.AddField(
model_name='musicplaylist',
name='user',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.UserAccount'),
),
migrations.AddField(
model_name='musicentry',
name='playlist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.MusicPlaylist'),
),
migrations.AddField(
model_name='musicentry',
name='song',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Song'),
),
migrations.AddField(
model_name='album',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Artist'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-05 05:39
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.RenameModel(
old_name='MusicEntry',
new_name='music_entry',
),
migrations.RenameModel(
old_name='MusicPlaylist',
new_name='music_playlist',
),
migrations.RenameModel(
old_name='UserAccount',
new_name='user_account',
),
migrations.AlterField(
model_name='album',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.artist'),
),
migrations.AlterField(
model_name='music_entry',
name='song',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.song'),
),
migrations.AlterField(
model_name='song',
name='album',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.album'),
),
migrations.AlterField(
model_name='song',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.artist'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-05 05:39
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_auto_20171105_1339'),
]
operations = [
migrations.AlterField(
model_name='album',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.artist'),
),
migrations.AlterField(
model_name='music_entry',
name='song',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.song'),
),
migrations.AlterField(
model_name='song',
name='album',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.album'),
),
migrations.AlterField(
model_name='song',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.artist'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-05 05:50
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20171105_1339'),
]
operations = [
migrations.AlterField(
model_name='album',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.artist'),
),
migrations.AlterField(
model_name='music_entry',
name='song',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.song'),
),
migrations.AlterField(
model_name='song',
name='album',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.album'),
),
migrations.AlterField(
model_name='song',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.artist'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-05 05:52
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0004_auto_20171105_1350'),
]
operations = [
migrations.AlterField(
model_name='album',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.artist'),
),
migrations.AlterField(
model_name='music_entry',
name='song',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.song'),
),
migrations.AlterField(
model_name='song',
name='album',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.album'),
),
migrations.AlterField(
model_name='song',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.artist'),
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-05 06:53
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0005_auto_20171105_1352'),
]
operations = [
migrations.AlterField(
model_name='album',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.artist'),
),
migrations.AlterField(
model_name='music_entry',
name='song',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.song'),
),
migrations.AlterField(
model_name='song',
name='album',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.album'),
),
migrations.AlterField(
model_name='song',
name='artist',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.artist'),
),
]
from django.apps import AppConfig
class MusicBrainzHook(AppConfig):
name = 'Musicbrainzhook'
verbose_name = name
def ready(self):
print("Self called")
def custom():
print("print called")
\ No newline at end of file
from django.shortcuts import render from django.shortcuts import render
# Create your views here.
from django.contrib.auth import login, authenticate from django.contrib.auth import login, authenticate
# from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.shortcuts import render, redirect, get_object_or_404 from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic.edit import UpdateView from django.views.generic.edit import UpdateView
from core.forms import SignUpForm from core.forms import SignUpForm
from core.models import *
from core.musicbrainzhook import *
def signup(request): def signup(request):
if request.method == 'POST': if request.method == 'POST':
...@@ -38,6 +36,43 @@ class EditProfile(UpdateView): ...@@ -38,6 +36,43 @@ class EditProfile(UpdateView):
slug_field = 'username' slug_field = 'username'
slug_url_kwarg = 'slug' slug_url_kwarg = 'slug'
def search(request):
type = request.GET.get('searchtype', '')
term = request.GET.get('search', '')
artistAlbums = Album.objects.filter(artist__name__contains = term)
if type == 'song':
results =Song.objects.filter(song_name__contains = term)
elif type == 'album':
results = Album.objects.filter(album_name__contains = term)
elif type == 'artist':
results = Artist.objects.filter(name__contains = term)
context = {
'type': type,
'term': term,
'results': results,
'albums': artistAlbums,
}
return render(request, 'search.html', context)
def artist_profile(request, identifier):
result = Artist.objects.filter(id = identifier)
albums = Album.objects.filter(artist = identifier)
return render(request, 'artist.html', {'result': result[0], 'albums': albums})
def album_profile(request, identifier):
result = Album.objects.filter(id = identifier)
artist_name = result[0].artist.name
songs =Song.objects.filter(album = identifier)
return render(request, 'album.html', {'result':result[0], 'songs': songs, 'artist': artist_name})
# def search(request,term):
# results = album.objects.filter(album_name__contains = term)
# custom()
# return render(request, 'search.html',{'term': term, 'results': results})
# def edit_profile(request, username): # def edit_profile(request, username):
# if request.method == 'POST': # if request.method == 'POST':
# form = EditProfile(request.POST, instance=request.user) # form = EditProfile(request.POST, instance=request.user)
...@@ -46,4 +81,4 @@ class EditProfile(UpdateView): ...@@ -46,4 +81,4 @@ class EditProfile(UpdateView):
# return HttpResponseRedirect(reverse('update_profile_success')) # return HttpResponseRedirect(reverse('update_profile_success'))
# else: # else:
# form = EditProfile(initial={'username': request.user.username, 'email': request.user.email, 'first_name': request.user.first_name, 'last_name': request.user.last_name}) # form = EditProfile(initial={'username': request.user.username, 'email': request.user.email, 'first_name': request.user.first_name, 'last_name': request.user.last_name})
# return render(request, 'edit_profile.html', {'form': form}) # return render(request, 'edit_profile.html', {'form': form})
\ No newline at end of file
This diff is collapsed.
...@@ -27,6 +27,78 @@ body { ...@@ -27,6 +27,78 @@ body {
text-align: center; text-align: center;
} }
/*for dropdown thing */
li a, .dropbtn {
display: inline-block;
color: white;
text-align: center;
text-decoration: none;
}
li a:hover, .dropdown:hover .dropbtn {
background-color: red;
}
li.dropdown {
display: inline-block;
}
.dropdown-content {
display: none;
position: absolute;
background-color: blue;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
}
.dropdown-content a {
color: black;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {background-color: #f1f1f1}
.dropdown:hover .dropdown-content {
display: block;
}
/*searchbar*/
/*form {
width:500px;
margin:50px auto;
}*/
.search_nav{
padding: 15px;
}
.searchbar {
padding:8px 15px;
background:rgba(50, 50, 50, 0.2);
border:0px solid #dbdbdb;
color: white;
}
.button {
position:relative;
padding:6px 15px;
left:-8px;
border:2px solid #207cca;
background-color:#207cca;
color:#fafafa;
}
.button:hover {
background-color:#fafafa;
color:#207cca;
}
/* Generic style for clickable shit*/ /* Generic style for clickable shit*/
.buttoned{ .buttoned{
...@@ -38,9 +110,20 @@ body { ...@@ -38,9 +110,20 @@ body {
/* Generic style for wrapping stuff in a box*/ /* Generic style for wrapping stuff in a box*/
.boxified{ .boxified{
background-color: rgba(20,100,100,0.3);
border-radius: 10px;
padding: 3vw;
text-align:center;
}
.features{
background-color: rgba(0,0,0,0.6); background-color: rgba(0,0,0,0.6);
border-radius: 10px; border-radius: 10px;
padding: 3vw; padding: 3vw;
max-width: 600px
width:100px;
text-align:center;
border: 1px solid #000;
} }
/* Nav bar */ /* Nav bar */
...@@ -48,7 +131,7 @@ body { ...@@ -48,7 +131,7 @@ body {
position:fixed; position:fixed;
width : 100vw; width : 100vw;
list-style-type: none; list-style-type: none;
background-color: #282525; background-color: #000;
overflow: hidden; overflow: hidden;
margin : -15px; margin : -15px;
margin-top: -70px; margin-top: -70px;
...@@ -76,7 +159,7 @@ body { ...@@ -76,7 +159,7 @@ body {
.nav_bar_tab{ .nav_bar_tab{
float: left; float: left;
display: block; display:inline-block;
color: white; color: white;
font-size: 20px; font-size: 20px;
font-family: PalanquinDark; font-family: PalanquinDark;
...@@ -104,6 +187,10 @@ body { ...@@ -104,6 +187,10 @@ body {
margin-top: 2vh; margin-top: 2vh;
} }
a, .link{
color: white;
}
@media (max-width:1280px){ @media (max-width:1280px){
.sidebar{ .sidebar{
display:none; display:none;
...@@ -115,7 +202,6 @@ body { ...@@ -115,7 +202,6 @@ body {
#first_name_id{ #first_name_id{
font-size: 100px; font-size: 100px;
} }
...@@ -124,5 +210,3 @@ body { ...@@ -124,5 +210,3 @@ body {
font-family: 'PalanquinDark'; font-family: 'PalanquinDark';
src: url('/files/fonts/palanquindark/PalanquinDark-Regular.ttf'); src: url('/files/fonts/palanquindark/PalanquinDark-Regular.ttf');
} }
This diff is collapsed.
files/images/background.jpg

288 KB | W: | H:

files/images/background.jpg

30.1 KB | W: | H:

files/images/background.jpg
files/images/background.jpg
files/images/background.jpg
files/images/background.jpg
  • 2-up
  • Swipe
  • Onion skin
...@@ -33,6 +33,7 @@ ALLOWED_HOSTS = [] ...@@ -33,6 +33,7 @@ ALLOWED_HOSTS = []
INSTALLED_APPS = [ INSTALLED_APPS = [
'core', 'core',
'core.musicbrainzhook',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
......
...@@ -24,8 +24,15 @@ urlpatterns = [ ...@@ -24,8 +24,15 @@ urlpatterns = [
url(r'^logout/$', auth_views.logout, {'template_name': 'logged_out.html'}, name='logout'), url(r'^logout/$', auth_views.logout, {'template_name': 'logged_out.html'}, name='logout'),
url(r'^admin/', admin.site.urls), url(r'^admin/', admin.site.urls),
url(r'^signup/$', core_views.signup, name='signup'), url(r'^signup/$', core_views.signup, name='signup'),
url(r'^profile/(?P<slug>[A-Za-z0-9-+_.@]+)/$', core_views.user_profile_page, name='viewprofile'),
# url(r'^search_by_(?P<type>[A-Za-z0-9-+_.@]+)/?search=(?P<term>[A-Za-z0-9-+_.@]+)/$',core_views.search, name='search'),
url(r'^search/$',core_views.search, name='search'),
url(r'^album/(?P<identifier>[0-9]+)/$', core_views.album_profile, name='album_profile'),
url(r'^artist/(?P<identifier>[0-9]+)/$', core_views.artist_profile, name='artist_profile'),
# url(r'^search/(?P<term>[A-Za-z0-9-+_.@]+)/$',core_views.search, name='search'),
url(r'^profile/(?P<slug>[A-Za-z0-9-+_.@]+)/$', core_views.user_profile_page, name='viewprofile'),
url(r'^profile/(?P<slug>[A-Za-z0-9-+_.@]+)/edit/$', core_views.EditProfile.as_view(success_url=reverse_lazy('home')), name='editprofile'), url(r'^profile/(?P<slug>[A-Za-z0-9-+_.@]+)/edit/$', core_views.EditProfile.as_view(success_url=reverse_lazy('home')), name='editprofile'),
# url(r'^profile/(?P<slug>[A-Za-z0-9-+_.@]+)/edit/$', core_views.EditProfile.as_view(success_url=reverse_lazy('profile', kwargs={'update':'true'})), name='editprofile'), # url(r'^profile/(?P<slug>[A-Za-z0-9-+_.@]+)/edit/$', core_views.EditProfile.as_view(success_url=reverse_lazy('profile', kwargs={'update':'true'})), name='editprofile'),
url(r'^$', core_views.home, name='home'), url(r'^$', core_views.home, name='home')
] ]
{% extends 'base.html' %}
{% block title %}{{result.name}}{% endblock %}
{% block sidebar %}
<h2> Album info </h2>
<p>
Album: {{result.name}} <br>
Artist: {{artist_name}} <br>
Year: {{result.year}} <br>
{% endblock %}
{% block content %}
{% for i in songs %}
<div class = "boxified main">
<h3> {{i.song_name}} </h3>
<p> Genre: {{i.genre}} </p>
</div>
{% endfor %}
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% block title %}{{result.name}}{% endblock %}
{% block sidebar %}
<h2> Artist info </h2>
<p>
Artist: {{result.name}} <br>
Albums: {{albums.count}} <br>
<br>
<h2> Description </h2>
{{result.description}}
{% endblock %}
{% block content %}
{% for i in albums %}
<div class = "boxified main">
<h3> <a class = "link" href= "/album/{{i.id}}"> {{i.album_name}} </a></h3>
<p> Year: {{i.year}} </p>
</div>
{% endfor %}
{% endblock %}
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>{% block title %}MyMusicList{% endblock %}</title> <title>{% block title %}MyMusicList{% endblock %}</title>
<link rel="stylesheet" href="/files/css/mymusiclist.css"> <link rel="stylesheet" href="/files/css/mymusiclist.css">
<link rel="stylesheet" href="/files/css/font-awesome.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head> </head>
<body> <body>
<header> <header>
...@@ -19,23 +19,86 @@ ...@@ -19,23 +19,86 @@
<li><a class="nav_bar_home" href="/">MyMusicList</a></li> <li><a class="nav_bar_home" href="/">MyMusicList</a></li>
<li><a class="nav_bar_tab" href="{% url 'login' %}">LOGIN</a></li> <li><a class="nav_bar_tab" href="{% url 'login' %}">LOGIN</a></li>
<li><a class="nav_bar_tab" href="{% url 'signup' %}">SIGN UP</a></li> <li><a class="nav_bar_tab" href="{% url 'signup' %}">SIGN UP</a></li>
<li>
<div class="search_nav">
<form action="{% url 'search' %}" method="get">
<div class="wrap">
<div class="search">
<input class="searchbar" type="text" name="search" placeholder="Search..">
<input id="searchbytype" type="hidden" name="searchtype" value="album">
<button class="button"> <i class="fa fa-search" aria-hidden="true"></i></button>
</div>
</div>
</form>
</div>
</li>
<li class="dropdown nav_bar_tab">
<a id=search_type href=# class="dropbtn">SEARCH <i class="fa fa-caret-down"></i></a>
<div class="dropdown-content">
<a href="#" onclick="mainA()" >Album</a>
<a href="#" onclick="mainB()">Artist</a>
<a href="#" onclick="mainC()">Song</a>
</div>
</li>
<li style="float:right"><button class="nav_bar_tab"type="button" onclick="toggleWallpaper()"></button></li> <li style="float:right"><button class="nav_bar_tab"type="button" onclick="toggleWallpaper()"></button></li>
</ul> </ul>
{% endif %} {% endif %}
<div class="boxified sidebar">
{% block sidebar %}
<h2>Featured Songs</h2>
<img src="/files/images/divide_edsheeran.jpeg" alt="Divide - Ed Sheeran">
Divide - Ed Sheeran
<img src="/files/images/palette_iu.jpeg" alt="Palette - IU">
Palette - IU
<img src="/files/images/rockstar_postmalone21savage.jpeg" alt="Rockstar">
Rockstar
{% endblock %}
</div>
</header> </header>
<main>
<div class="boxified sidebar">
<h2>Featured Songs</h2>
<img src="/files/images/divide_edsheeran.jpeg" alt="Divide - Ed Sheeran">
Divide - Ed Sheeran
<img src="/files/images/palette_iu.jpeg" alt="Palette - IU">
Palette - IU
<img src="/files/images/rockstar_postmalone21savage.jpeg" alt="Rockstar"> <script>
Rockstar function mainA(){
</div> document.getElementById("search_type").innerHTML = "Album Search";
document.getElementById("searchbytype").value = "album";
}
function mainB(){
document.getElementById("search_type").innerHTML = "Artist Search";
document.getElementById("searchbytype").value = "artist";
}
function mainC(){
document.getElementById("search_type").innerHTML = "Song Search";
document.getElementById("searchbytype").value = "song";
}
</script>
{% block content %} {% block content %}
{% endblock %} {% endblock %}
</main>
<script> <script>
function toggleWallpaper() { function toggleWallpaper() {
document.getElementByID("nav_bar").style.background-color = "white"; document.getElementByID("nav_bar").style.background-color = "white";
......
...@@ -6,21 +6,35 @@ ...@@ -6,21 +6,35 @@
<div class="boxified main"> <div class="boxified main">
<h2>What is MyMusicList?</h2> <h2>What is MyMusicList?</h2>
<p> <p>
MyMusicList is the solution to all your music catalog needs. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum finibus magna eros. Nulla non mauris non mi ornare mattis vel vel diam. Suspendisse malesuada lacus at venenatis sollicitudin. Sed et ultrices ex. Praesent feugiat bibendum nibh. Sed commodo elementum turpis. Morbi faucibus nunc sagittis, rutrum nisl quis, fermentum orci.</br></br> <img src="/files/images/logo.jpg" /> </br> </br>
Do you want to see music like you’ve never before? Do you want to make a playlist without it feeling lifeless and a hassle? Do you want to show off your hip-and-cool music with your friends?
MyMusicList is the answer.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel tristique risus. Cras molestie pretium urna, a lobortis diam dictum aliquet. Pellentesque non fermentum dolor, sed aliquet dolor. Etiam mauris ex, congue vehicula eleifend vel, hendrerit fermentum velit. In ac tempus justo. Aliquam nec rutrum nibh. Sed pulvinar ex sed ex tincidunt tempor. Praesent tristique semper mauris, vel pretium sapien congue a.</br></br>
Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris suscipit nec velit non egestas. Quisque auctor viverra urna, at euismod turpis ornare id. Aliquam pharetra purus quis dui blandit tincidunt. Quisque massa ligula, malesuada vel leo eu, accumsan vulputate nulla. Integer faucibus malesuada pharetra. Duis varius sapien sit amet justo malesuada fringilla. Integer eget ex sed urna auctor vestibulum. Aliquam sit amet molestie velit, a pretium ligula. Mauris gravida turpis vitae scelerisque finibus.
</p> </p>
</div> </div>
<div class="boxified main"> <div class="boxified main">
<h2>Features</h2> <h2>Features</h2>
<p> <p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum finibus magna eros. Nulla non mauris non mi ornare mattis vel vel diam. Suspendisse malesuada lacus at venenatis sollicitudin. Sed et ultrices ex. Praesent feugiat bibendum nibh. Sed commodo elementum turpis. Morbi faucibus nunc sagittis, rutrum nisl quis, fermentum orci.</br></br> <div class="img-container">
<img src="/files/images/image2.png" />
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel tristique risus. Cras molestie pretium urna, a lobortis diam dictum aliquet. Pellentesque non fermentum dolor, sed aliquet dolor. Etiam mauris ex, congue vehicula eleifend vel, hendrerit fermentum velit. In ac tempus justo. Aliquam nec rutrum nibh. Sed pulvinar ex sed ex tincidunt tempor. Praesent tristique semper mauris, vel pretium sapien congue a.</br></br> <p>
“Playlist Manager”</br>
Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris suscipit nec velit non egestas. Quisque auctor viverra urna, at euismod turpis ornare id. Aliquam pharetra purus quis dui blandit tincidunt. Quisque massa ligula, malesuada vel leo eu, accumsan vulputate nulla. Integer faucibus malesuada pharetra. Duis varius sapien sit amet justo malesuada fringilla. Integer eget ex sed urna auctor vestibulum. Aliquam sit amet molestie velit, a pretium ligula. Mauris gravida turpis vitae scelerisque finibus. MyMusicList features a simplistic playlist manager that is created for the user’s convenience but still allows a lot of features without overwhelming the user. With MyMusicList’s playlist manager, one can manage multiple playlists, organize music entries, and so much more.
</p>
</div>
<div class="img-container">
<img src="/files/images/image3.png" />
<p>“Customizable Tags”</br>
MyMusicList features customizable tags that you can attach to any music entry. It makes making playlists more personal and makes organizing music easier.
</p>
</div>
<div class="img-container">
<img src="/files/images/image4.png" />
<p>“S.S. Integration”</br>
Your MyMusicList account can be integrated with your selected social media accounts, so you can share your playlists with your friends and followers. You don’t have to leave the site to listen to your playlist because MyMusicList is integrated with your preferred music streaming service.
</p>
</div>
</p> </p>
</div> </div>
<div class="boxified main"> <div class="boxified main">
......
{% extends 'base.html' %}
{% block title %}Song search test{% endblock %}
{% block sidebar %}
<h2> Search results (by {{type}})</h2>
<p>
You searched for '{{term}}' <br>
Found {{results.count}} results <br>
Source: Local</p>
{% endblock %}
{% block content %}
{% for i in results %}
<div class = "boxified main">
{% if type == "album" %}
<h3><a href="/album/{{i.id}}">{{i.album_name}}</a></h3>
<p>Artist: <a href="/artist/{{i.artist.id}}">{{i.artist.name}}</a><br>
Year: {{i.year}} </p>
{% endif %}
{% if type == "artist" %}
<h3><a href="/artist/{{i.id}}">{{i.name}}</a></h3>
{% for j in albums %}
<p> <tab>
{% if j.artist.name == i.name %}
<h3><a href="/album/{{j.id}}">{{ j.album_name }}</a> - {{ j.year }} </h3>
{% endif %} </p>
{% endfor %}
{% endif %}
{% if type == "song" %}
<h3>{{i.song_name}}</h3>
<h3><a href="/album/{{i.album.id}}">{{i.album.album_name}}</a></h3>
<p>Artist: <a href="/artist/{{i.artist.id}}">{{i.artist.name}}</a><br>
Year: {{i.album.year}} </p>
{% endif %}
</div>
{% endfor %}
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment