Commit 9ef16622 authored by Brian Guadalupe's avatar Brian Guadalupe

Merge branch 'test' into 'master'

Adds preliminary design and static file loading support

See merge request brian/mymusiclist!1
parents 1938e131 dd56a2a7
.DS_Store
*.pyc
*.sqlite
No preview for this file type
.signup_form{
color: black;
}
#nav_bar{
position:fixed;
width : 100vw;
list-style-type: none;
background-color: grey;
overflow: hidden;
margin : -15px;
margin-top: -70px;
padding: 0px;
height : 50px;
}
#nav_bar_items {
float: left;
display: block;
color: white;
font-size: 20;
padding: 8px 10px;
letter-spacing: 3px;
text-decoration: none;
}
li a:hover, .active{
background-color: black;
}
body {
color: white;
margin: 15px;
margin-top: 70px;
background-image: url(/files/images/background.jpg);
background-position: left top;
background-size: cover;
}
\ No newline at end of file
......@@ -100,6 +100,13 @@ AUTH_PASSWORD_VALIDATORS = [
},
]
STATICFILES_FINDERS = [
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
]
STATICFILES_DIRS = [
os.path.join(BASE_DIR, "files"),
]
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
......@@ -118,6 +125,7 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/'
STATIC_URL = '/files/'
STATIC_ROOT = '/files/'
LOGIN_REDIRECT_URL = '/'
......@@ -17,6 +17,7 @@ from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from core import views as core_views
"""import * pls"""
urlpatterns = [
url(r'^login/$', auth_views.login, {'template_name': 'login.html'}, name='login'),
......
{% load static %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{% block title %}MyMusicList{% endblock %}</title>
<link rel="stylesheet" href="{% static 'css/mymusiclist.css' %}">
</head>
<body>
<header>
<h1>MyMusicList</h1>
{% if user.is_authenticated %}
Hi {{ user.username }}!
<a href="{% url 'logout' %}">logout</a>
<ul id='nav_bar'>
<li id='nav_bar_items'><a id='nav_bar_items' href="/">MyMusicList</a></li>
<li id='nav_bar_items'><a id='nav_bar_items' href="/profile/{{user.username}}">Hi, {{user.username}}</a></li>
<li id='nav_bar_items' style="float:right"><a id='nav_bar_items' href="{% url 'logout' %}">Logout</a></li>
</ul>
{% else %}
<a href="{% url 'login' %}">login</a>
<a href="{% url 'signup' %}">sign up</a>
<ul id='nav_bar'>
<li id='nav_bar_items'><a id='nav_bar_items' href="/">MyMusicList</a></li>
<li id='nav_bar_items'><a id='nav_bar_items' href="{% url 'login' %}">Login</a></li>
<li id='nav_bar_items'><a id='nav_bar_items' href="{% url 'signup' %}">Sign Up</a></li>
</ul>
{% endif %}
</header>
<main>
......
......@@ -5,6 +5,5 @@
{% block content %}
<h2>Home</h2>
{% if user.is_authenticated %}
<a href="/profile/{{user.username}}">View your profile</a>
{% endif %}
{% endblock %}
......@@ -4,6 +4,7 @@
{% block content %}
<h2>Logged out</h2>
<p>You have been successfully logged out.</p>
<p><a href="{% url 'login' %}">Log in</a> again.</p>
<p>
You have been successfully logged out. <br> Please login again.
</p>
{% endblock %}
......@@ -3,10 +3,10 @@
{% block title %}Login{% endblock %}
{% block content %}
<h2>Login</h2>
<h2 id='login_login'>Login</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Login</button>
<button type="submit" id='login_submit'>Login</button>
</form>
{% endblock %}
......@@ -2,9 +2,11 @@
{% block content %}
<h2>Sign up</h2>
<div class='signup_form'>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Sign up</button>
</form>
</div>
{% 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