Commit ebd70c01 authored by Deion Menor's avatar Deion Menor

Add dropdown for profile/logout

parent 5eb0c603
# -*- 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 django.db import migrations, models
......@@ -20,6 +20,7 @@ class Migration(migrations.Migration):
('id', models.AutoField(primary_key=True, serialize=False)),
('album_name', models.CharField(max_length=64)),
('year', models.DecimalField(decimal_places=0, max_digits=4)),
('art', models.URLField(blank=True, null=True)),
],
),
migrations.CreateModel(
......@@ -30,22 +31,6 @@ class Migration(migrations.Migration):
('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=[
......@@ -58,38 +43,6 @@ class Migration(migrations.Migration):
('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',
......
......@@ -15,19 +15,33 @@
<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 %}
<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="{% url 'logout' %}" style="float:right">>Logout</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> -->
<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 %}
<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 style="float:right; ">
<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 %}
<form action="{% url 'search' %}" method="get">
<div class="wrap">
<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">
<button class="w3-bar-item w3-button w3-green"> <i class="fa fa-search" aria-hidden="true"></i></button>
</div>
......
......@@ -19,7 +19,7 @@
<header class="w3-container w3-green">
<h3><a href="/album/{{i.id}}">{{i.album_name}}</a></h3>
</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>
Year: {{i.year}} </p>
......@@ -33,7 +33,7 @@
<h3><a href="/artist/{{i.id}}">{{i.name}}</a></h3>
</header>
<div class="w3-container">
<div class="w3-container w3-opacity w3-black">
{% for j in albums %}
<p> <tab>
{% if j.artist.name == i.name %}
......@@ -47,11 +47,11 @@
{% if type == "song" %}
<header class="w3-container w3-green">
<header class="w3-container w3-yellow">
<h3>{{i.song_name}}</h3>
</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>
<p>Artist: <a href="/artist/{{i.artist.id}}">{{i.artist.name}}</a><br>
Year: {{i.album.year}} </p>
......
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