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
ebd70c01
Commit
ebd70c01
authored
Nov 20, 2017
by
Deion Menor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dropdown for profile/logout
parent
5eb0c603
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
59 deletions
+26
-59
0001_initial.py
core/migrations/0001_initial.py
+2
-49
base.html
templates/base.html
+20
-6
search.html
templates/search.html
+4
-4
No files found.
core/migrations/0001_initial.py
View file @
ebd70c01
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-
04 13:55
# Generated by Django 1.11.5 on 2017-11-
19 11:12
from
__future__
import
unicode_literals
from
__future__
import
unicode_literals
from
django.db
import
migrations
,
models
from
django.db
import
migrations
,
models
...
@@ -20,6 +20,7 @@ class Migration(migrations.Migration):
...
@@ -20,6 +20,7 @@ class Migration(migrations.Migration):
(
'id'
,
models
.
AutoField
(
primary_key
=
True
,
serialize
=
False
)),
(
'id'
,
models
.
AutoField
(
primary_key
=
True
,
serialize
=
False
)),
(
'album_name'
,
models
.
CharField
(
max_length
=
64
)),
(
'album_name'
,
models
.
CharField
(
max_length
=
64
)),
(
'year'
,
models
.
DecimalField
(
decimal_places
=
0
,
max_digits
=
4
)),
(
'year'
,
models
.
DecimalField
(
decimal_places
=
0
,
max_digits
=
4
)),
(
'art'
,
models
.
URLField
(
blank
=
True
,
null
=
True
)),
],
],
),
),
migrations
.
CreateModel
(
migrations
.
CreateModel
(
...
@@ -30,22 +31,6 @@ class Migration(migrations.Migration):
...
@@ -30,22 +31,6 @@ class Migration(migrations.Migration):
(
'description'
,
models
.
TextField
()),
(
'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
(
migrations
.
CreateModel
(
name
=
'Song'
,
name
=
'Song'
,
fields
=
[
fields
=
[
...
@@ -58,38 +43,6 @@ class Migration(migrations.Migration):
...
@@ -58,38 +43,6 @@ class Migration(migrations.Migration):
(
'artist'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'core.Artist'
)),
(
'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
(
migrations
.
AddField
(
model_name
=
'album'
,
model_name
=
'album'
,
name
=
'artist'
,
name
=
'artist'
,
...
...
templates/base.html
View file @
ebd70c01
...
@@ -15,19 +15,33 @@
...
@@ -15,19 +15,33 @@
<div
class=
"w3-bar w3-black w3-large"
>
<div
class=
"w3-bar w3-black w3-large"
>
<a
href=
"/"
id=
"logo-nav"
class=
"w3-bar-item w3-button w3-blue-gray"
>
MyMusicList
</a>
<a
href=
"/"
id=
"logo-nav"
class=
"w3-bar-item w3-button w3-blue-gray"
style=
"font-size:1.2em;"
>
MyMusicList
</a>
{% if request.user.is_authenticated %}
{% if request.user.is_authenticated %}
<a
class=
"w3-bar-item w3-button"
href=
"/profile/{{request.user.username}}"
><i
class=
"fa fa-user-circle-o"
aria-hidden=
"true"
></i>
Hi, {{request.user.username}}
</a>
<!-- <a class="w3-bar-item w3-button" href="/profile/{{request.user.username}}" style="float:right" ><i class="fa fa-user-circle-o" aria-hidden="true"></i></a> -->
<a
class=
"w3-bar-item w3-button"
href=
"{% url 'logout' %}"
style=
"float:right"
>
>Logout
</a>
<!-- <a class="w3-bar-item w3-button" href="{% url 'logout' %}" style="float:right">Logout</a> -->
<div
class=
"w3-dropdown-hover"
style=
"float:right;"
>
<button
id=
"user_dropdown"
class=
"w3-button"
><i
class=
"fa fa-user-circle-o"
aria-hidden=
"true"
></i>
{{request.user.username}}
</a></button>
<div
class=
"w3-dropdown-content w3-bar-block w3-card-4"
>
<a
href=
"/profile/{{request.user.username}}"
class=
" w3-bar-item w3-button"
>
View Profile
</a>
<a
href=
"{% url 'logout' %}"
class=
" w3-bar-item w3-button"
>
Logout
</a>
</div>
</div>
{% else %}
{% else %}
<a
href=
"{% url 'login' %}"
class=
"w3-bar-item w3-button"
>
Login
</a>
<div
style=
"float:right; "
>
<a
href=
"{% url 'signup' %}"
class=
"w3-bar-item w3-button"
>
Sign Up
</a>
<a
href=
"{% url 'login' %}"
class=
"w3-bar-item w3-button"
>
Login
</a>
<a
href=
"{% url 'signup' %}"
class=
"w3-bar-item w3-button"
>
Sign Up
</a>
</div>
{% endif %}
{% endif %}
<form
action=
"{% url 'search' %}"
method=
"get"
>
<form
action=
"{% url 'search' %}"
method=
"get"
>
<div
class=
"wrap"
>
<div
class=
"wrap"
>
<div
class=
"search"
>
<div
class=
"search"
>
<input
type=
"text"
class=
"w3-bar-item w3-input w3-black"
name=
"search"
placeholder=
"Search.."
>
<input
type=
"text"
class=
"w3-bar-item w3-input w3-black"
name=
"search"
style=
"width:30vw; color:pink;"
placeholder=
"Search.."
>
<input
id=
"searchbytype"
type=
"hidden"
name=
"searchtype"
value=
"album"
>
<input
id=
"searchbytype"
type=
"hidden"
name=
"searchtype"
value=
"album"
>
<button
class=
"w3-bar-item w3-button w3-green"
>
<i
class=
"fa fa-search"
aria-hidden=
"true"
></i></button>
<button
class=
"w3-bar-item w3-button w3-green"
>
<i
class=
"fa fa-search"
aria-hidden=
"true"
></i></button>
</div>
</div>
...
...
templates/search.html
View file @
ebd70c01
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<header
class=
"w3-container w3-green"
>
<header
class=
"w3-container w3-green"
>
<h3><a
href=
"/album/{{i.id}}"
>
{{i.album_name}}
</a></h3>
<h3><a
href=
"/album/{{i.id}}"
>
{{i.album_name}}
</a></h3>
</header>
</header>
<div
class=
"w3-container w3-black"
>
<div
class=
"w3-container
w3-opacity
w3-black"
>
<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>
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
<h3><a
href=
"/artist/{{i.id}}"
>
{{i.name}}
</a></h3>
<h3><a
href=
"/artist/{{i.id}}"
>
{{i.name}}
</a></h3>
</header>
</header>
<div
class=
"w3-container"
>
<div
class=
"w3-container
w3-opacity w3-black
"
>
{% for j in albums %}
{% for j in albums %}
<p>
<tab>
<p>
<tab>
{% if j.artist.name == i.name %}
{% if j.artist.name == i.name %}
...
@@ -47,11 +47,11 @@
...
@@ -47,11 +47,11 @@
{% if type == "song" %}
{% if type == "song" %}
<header
class=
"w3-container w3-
green
"
>
<header
class=
"w3-container w3-
yellow
"
>
<h3>
{{i.song_name}}
</h3>
<h3>
{{i.song_name}}
</h3>
</header>
</header>
<div
class=
"w3-container"
>
<div
class=
"w3-container
w3-opacity w3-black
"
>
<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>
...
...
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