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
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
442 additions
and
67 deletions
+442
-67
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
search.html
templates/search.html
+10
-10
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
...
@@ -37,18 +37,18 @@ class EditProfile(UpdateView):
...
@@ -37,18 +37,18 @@ class EditProfile(UpdateView):
slug_url_kwarg
=
'slug'
slug_url_kwarg
=
'slug'
def
search
(
request
):
def
search
(
request
):
type
=
request
.
GET
.
get
(
'searchtype'
,
''
)
type
=
request
.
GET
.
get
(
'searchtype'
,
''
)
term
=
request
.
GET
.
get
(
'search'
,
''
)
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'
:
if
type
==
'song'
:
results
=
s
ong
.
objects
.
filter
(
song_name__contains
=
term
)
results
=
S
ong
.
objects
.
filter
(
song_name__contains
=
term
)
elif
type
==
'album'
:
elif
type
==
'album'
:
results
=
a
lbum
.
objects
.
filter
(
album_name__contains
=
term
)
results
=
A
lbum
.
objects
.
filter
(
album_name__contains
=
term
)
elif
type
==
'artist'
:
elif
type
==
'artist'
:
results
=
a
rtist
.
objects
.
filter
(
name__contains
=
term
)
results
=
A
rtist
.
objects
.
filter
(
name__contains
=
term
)
context
=
{
context
=
{
'type'
:
type
,
'type'
:
type
,
'term'
:
term
,
'term'
:
term
,
...
@@ -56,16 +56,16 @@ def search(request):
...
@@ -56,16 +56,16 @@ def search(request):
'albums'
:
artistAlbums
,
'albums'
:
artistAlbums
,
}
}
return
render
(
request
,
'search.html'
,
context
)
return
render
(
request
,
'search.html'
,
context
)
def
artist_profile
(
request
,
identifier
):
def
artist_profile
(
request
,
identifier
):
result
=
a
rtist
.
objects
.
filter
(
id
=
identifier
)
result
=
A
rtist
.
objects
.
filter
(
id
=
identifier
)
albums
=
a
lbum
.
objects
.
filter
(
artist
=
identifier
)
albums
=
A
lbum
.
objects
.
filter
(
artist
=
identifier
)
return
render
(
request
,
'artist.html'
,
{
'result'
:
result
[
0
],
'albums'
:
albums
})
return
render
(
request
,
'artist.html'
,
{
'result'
:
result
[
0
],
'albums'
:
albums
})
def
album_profile
(
request
,
identifier
):
def
album_profile
(
request
,
identifier
):
result
=
a
lbum
.
objects
.
filter
(
id
=
identifier
)
result
=
A
lbum
.
objects
.
filter
(
id
=
identifier
)
artist_name
=
result
[
0
]
.
a
rtist
.
name
artist_name
=
result
[
0
]
.
A
rtist
.
name
songs
=
s
ong
.
objects
.
filter
(
album
=
identifier
)
songs
=
S
ong
.
objects
.
filter
(
album
=
identifier
)
return
render
(
request
,
'album.html'
,
{
'result'
:
result
[
0
],
'songs'
:
songs
,
'artist'
:
artist_name
})
return
render
(
request
,
'album.html'
,
{
'result'
:
result
[
0
],
'songs'
:
songs
,
'artist'
:
artist_name
})
# def search(request,term):
# def search(request,term):
...
@@ -81,4 +81,4 @@ def album_profile(request, identifier):
...
@@ -81,4 +81,4 @@ def album_profile(request, identifier):
# 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
files/css/mymusiclist.css
View file @
3a9e8eb9
...
@@ -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,7 +110,7 @@ body {
...
@@ -38,7 +110,7 @@ body {
/* Generic style for wrapping stuff in a box*/
/* Generic style for wrapping stuff in a box*/
.boxified
{
.boxified
{
background-color
:
rgba
(
0
,
0
,
0
,
0.6
);
background-color
:
rgba
(
20
,
100
,
100
,
0.3
);
border-radius
:
10px
;
border-radius
:
10px
;
padding
:
3vw
;
padding
:
3vw
;
text-align
:
center
;
text-align
:
center
;
...
@@ -59,7 +131,7 @@ body {
...
@@ -59,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
;
...
@@ -87,7 +159,7 @@ body {
...
@@ -87,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
;
...
@@ -138,5 +210,3 @@ a, .link{
...
@@ -138,5 +210,3 @@ a, .link{
font-family
:
'PalanquinDark'
;
font-family
:
'PalanquinDark'
;
src
:
url('/files/fonts/palanquindark/PalanquinDark-Regular.ttf')
;
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 @@
...
@@ -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,9 +19,38 @@
...
@@ -19,9 +19,38 @@
<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"
>
<div
class=
"boxified sidebar"
>
{% block sidebar %}
{% block sidebar %}
<h2>
Featured Songs
</h2>
<h2>
Featured Songs
</h2>
...
@@ -34,54 +63,40 @@
...
@@ -34,54 +63,40 @@
{% endblock %}
{% endblock %}
</div>
</div>
</header>
</header>
<script>
<script>
function
mainA
(){
function
mainA
(){
document
.
getElementById
(
"
demo
"
).
innerHTML
=
"Album Search"
;
document
.
getElementById
(
"
search_type
"
).
innerHTML
=
"Album Search"
;
document
.
getElementById
(
"searchbytype"
).
value
=
"album"
;
document
.
getElementById
(
"searchbytype"
).
value
=
"album"
;
}
}
function
mainB
(){
function
mainB
(){
document
.
getElementById
(
"
demo
"
).
innerHTML
=
"Artist Search"
;
document
.
getElementById
(
"
search_type
"
).
innerHTML
=
"Artist Search"
;
document
.
getElementById
(
"searchbytype"
).
value
=
"artist"
;
document
.
getElementById
(
"searchbytype"
).
value
=
"artist"
;
}
}
function
mainC
(){
function
mainC
(){
document
.
getElementById
(
"
demo
"
).
innerHTML
=
"Song Search"
;
document
.
getElementById
(
"
search_type
"
).
innerHTML
=
"Song Search"
;
document
.
getElementById
(
"searchbytype"
).
value
=
"song"
;
document
.
getElementById
(
"searchbytype"
).
value
=
"song"
;
}
}
</script>
</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>
{% block content %}
{% block content %}
{% endblock %}
{% endblock %}
<script>
<script>
...
...
templates/search.html
View file @
3a9e8eb9
...
@@ -11,16 +11,16 @@
...
@@ -11,16 +11,16 @@
{% endblock %}
{% endblock %}
{% block content %}
{% block content %}
{% for i in results %}
{% for i in results %}
<div
class =
"boxified main"
>
<div
class =
"boxified main"
>
{% if type == "album" %}
{% if type == "album" %}
<h3><a
href=
"/album/{{i.id}}"
>
{{i.album_name}}
</a></h3>
<h3><a
href=
"/album/{{i.id}}"
>
{{i.album_name}}
</a></h3>
<p>
Artist:
<a
href=
"/artist/{{i.artist.id}}"
>
{{i.artist.name}}
</a><br>
<p>
Artist:
<a
href=
"/artist/{{i.artist.id}}"
>
{{i.artist.name}}
</a><br>
Year: {{i.year}}
</p>
Year: {{i.year}}
</p>
{% endif %}
{% endif %}
{% if type == "artist" %}
{% if type == "artist" %}
<h3><a
href=
"/artist/{{i.id}}"
>
{{i.name}}
</a></h3>
<h3><a
href=
"/artist/{{i.id}}"
>
{{i.name}}
</a></h3>
{% for j in albums %}
{% for j in albums %}
...
@@ -30,17 +30,17 @@
...
@@ -30,17 +30,17 @@
{% endif %}
</p>
{% endif %}
</p>
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% if type == "song" %}
{% if type == "song" %}
<h3>
{{i.song_name}}
</h3>
<h3>
{{i.song_name}}
</h3>
<h3><a
href=
"/album/{{i.album.id}}"
>
{{i.album.album_name}}
</a></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>
<p>
Artist:
<a
href=
"/artist/{{i.artist.id}}"
>
{{i.artist.name}}
</a><br>
Year: {{i.album.year}}
</p>
Year: {{i.album.year}}
</p>
{% endif %}
{% endif %}
</div>
</div>
{% endfor %}
{% endfor %}
{% endblock %}
{% endblock %}
\ No newline at end of file
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