Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mymusiclist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Brian Guadalupe
mymusiclist
Commits
3a9e8eb9
Commit
3a9e8eb9
authored
Nov 05, 2017
by
Gink
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'playlistwip' of
https://gitlab.discs.ateneo.edu/brian/mymusiclist
into playlistwip
parents
e7a341a2
ce1c94dc
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
432 additions
and
57 deletions
+432
-57
0001_initial.py
core/migrations/0001_initial.py
+98
-0
0002_auto_20171105_1339.py
core/migrations/0002_auto_20171105_1339.py
+48
-0
0003_auto_20171105_1339.py
core/migrations/0003_auto_20171105_1339.py
+36
-0
0004_auto_20171105_1350.py
core/migrations/0004_auto_20171105_1350.py
+36
-0
0005_auto_20171105_1352.py
core/migrations/0005_auto_20171105_1352.py
+36
-0
0006_auto_20171105_1453.py
core/migrations/0006_auto_20171105_1453.py
+36
-0
views.py
core/views.py
+14
-14
mymusiclist.css
files/css/mymusiclist.css
+75
-5
background.jpg
files/images/background.jpg
+0
-0
base.html
templates/base.html
+53
-38
No files found.
core/migrations/0001_initial.py
0 → 100644
View file @
3a9e8eb9
# -*- 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'
),
),
]
core/migrations/0002_auto_20171105_1339.py
0 → 100644
View file @
3a9e8eb9
# -*- 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'
),
),
]
core/migrations/0003_auto_20171105_1339.py
0 → 100644
View file @
3a9e8eb9
# -*- 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'
),
),
]
core/migrations/0004_auto_20171105_1350.py
0 → 100644
View file @
3a9e8eb9
# -*- 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'
),
),
]
core/migrations/0005_auto_20171105_1352.py
0 → 100644
View file @
3a9e8eb9
# -*- 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'
),
),
]
core/migrations/0006_auto_20171105_1453.py
0 → 100644
View file @
3a9e8eb9
# -*- 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'
),
),
]
core/views.py
View file @
3a9e8eb9
...
...
@@ -40,14 +40,14 @@ def search(request):
type
=
request
.
GET
.
get
(
'searchtype'
,
''
)
term
=
request
.
GET
.
get
(
'search'
,
''
)
artistAlbums
=
a
lbum
.
objects
.
filter
(
artist__name__contains
=
term
)
artistAlbums
=
A
lbum
.
objects
.
filter
(
artist__name__contains
=
term
)
if
type
==
'song'
:
results
=
s
ong
.
objects
.
filter
(
song_name__contains
=
term
)
results
=
S
ong
.
objects
.
filter
(
song_name__contains
=
term
)
elif
type
==
'album'
:
results
=
a
lbum
.
objects
.
filter
(
album_name__contains
=
term
)
results
=
A
lbum
.
objects
.
filter
(
album_name__contains
=
term
)
elif
type
==
'artist'
:
results
=
a
rtist
.
objects
.
filter
(
name__contains
=
term
)
results
=
A
rtist
.
objects
.
filter
(
name__contains
=
term
)
context
=
{
'type'
:
type
,
...
...
@@ -58,14 +58,14 @@ def search(request):
return
render
(
request
,
'search.html'
,
context
)
def
artist_profile
(
request
,
identifier
):
result
=
a
rtist
.
objects
.
filter
(
id
=
identifier
)
albums
=
a
lbum
.
objects
.
filter
(
artist
=
identifier
)
result
=
A
rtist
.
objects
.
filter
(
id
=
identifier
)
albums
=
A
lbum
.
objects
.
filter
(
artist
=
identifier
)
return
render
(
request
,
'artist.html'
,
{
'result'
:
result
[
0
],
'albums'
:
albums
})
def
album_profile
(
request
,
identifier
):
result
=
a
lbum
.
objects
.
filter
(
id
=
identifier
)
artist_name
=
result
[
0
]
.
a
rtist
.
name
songs
=
s
ong
.
objects
.
filter
(
album
=
identifier
)
result
=
A
lbum
.
objects
.
filter
(
id
=
identifier
)
artist_name
=
result
[
0
]
.
A
rtist
.
name
songs
=
S
ong
.
objects
.
filter
(
album
=
identifier
)
return
render
(
request
,
'album.html'
,
{
'result'
:
result
[
0
],
'songs'
:
songs
,
'artist'
:
artist_name
})
# def search(request,term):
...
...
files/css/mymusiclist.css
View file @
3a9e8eb9
...
...
@@ -27,6 +27,78 @@ body {
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*/
.buttoned
{
...
...
@@ -38,7 +110,7 @@ body {
/* Generic style for wrapping stuff in a box*/
.boxified
{
background-color
:
rgba
(
0
,
0
,
0
,
0.6
);
background-color
:
rgba
(
20
,
100
,
100
,
0.3
);
border-radius
:
10px
;
padding
:
3vw
;
text-align
:
center
;
...
...
@@ -59,7 +131,7 @@ body {
position
:
fixed
;
width
:
100vw
;
list-style-type
:
none
;
background-color
:
#
282525
;
background-color
:
#
000
;
overflow
:
hidden
;
margin
:
-15px
;
margin-top
:
-70px
;
...
...
@@ -87,7 +159,7 @@ body {
.nav_bar_tab
{
float
:
left
;
display
:
block
;
display
:
inline-
block
;
color
:
white
;
font-size
:
20px
;
font-family
:
PalanquinDark
;
...
...
@@ -138,5 +210,3 @@ a, .link{
font-family
:
'PalanquinDark'
;
src
:
url('/files/fonts/palanquindark/PalanquinDark-Regular.ttf')
;
}
files/images/background.jpg
View replaced file @
e7a341a2
View file @
3a9e8eb9
288 KB
|
W:
|
H:
30.1 KB
|
W:
|
H:
2-up
Swipe
Onion skin
templates/base.html
View file @
3a9e8eb9
...
...
@@ -4,7 +4,7 @@
<meta
charset=
"utf-8"
>
<title>
{% block title %}MyMusicList{% endblock %}
</title>
<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>
<body>
<header>
...
...
@@ -19,9 +19,38 @@
<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 '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>
</ul>
{% endif %}
<div
class=
"boxified sidebar"
>
{% block sidebar %}
<h2>
Featured Songs
</h2>
...
...
@@ -43,36 +72,22 @@
<script>
function
mainA
(){
document
.
getElementById
(
"
demo
"
).
innerHTML
=
"Album Search"
;
document
.
getElementById
(
"
search_type
"
).
innerHTML
=
"Album Search"
;
document
.
getElementById
(
"searchbytype"
).
value
=
"album"
;
}
function
mainB
(){
document
.
getElementById
(
"
demo
"
).
innerHTML
=
"Artist Search"
;
document
.
getElementById
(
"
search_type
"
).
innerHTML
=
"Artist Search"
;
document
.
getElementById
(
"searchbytype"
).
value
=
"artist"
;
}
function
mainC
(){
document
.
getElementById
(
"
demo
"
).
innerHTML
=
"Song Search"
;
document
.
getElementById
(
"
search_type
"
).
innerHTML
=
"Song Search"
;
document
.
getElementById
(
"searchbytype"
).
value
=
"song"
;
}
</script>
<form
action=
"{% url 'search' %}"
method=
"get"
>
<div
class=
"wrap"
>
<div
class=
"search"
>
<input
type=
"text"
name=
"search"
placeholder=
"Search.."
>
<input
id=
"searchbytype"
type=
"hidden"
name=
"searchtype"
value=
"album"
>
<p
id=
"demo"
>
Album Search
</p></input>
<button>
Search
</button>
</div>
</div>
</form>
<div>
<a><button
onclick=
"mainA()"
>
By Album
</button></a>
<a><button
onclick=
"mainB()"
>
By Artist
</button></a>
<a><button
onclick=
"mainC()"
>
By Song
</button></a>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment