1
0
mirror of https://github.com/bspeice/Melodia synced 2025-07-03 15:04:43 -04:00

Commit the login page

Contains some fixes, etc. in order to make the login page work.
This commit is contained in:
Bradlee Speice
2013-01-24 19:04:29 -05:00
parent e3e6a6e475
commit c5fec8cfd3
14 changed files with 132 additions and 44 deletions

85
web/views/templates/base Normal file
View File

@ -0,0 +1,85 @@
{% comment %}
List of block elements in this page:
page_title
navbar_title
navbar_content
sidebar
sidebar_content
body
body_content
scripts
global_scripts
page_scripts
{% endcomment %}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>{% block page_title %}{% endblock %}</title>
<link href="{{ STATIC_URL }}css/bootstrap.min.css" rel="stylesheet">
<style>
body {
padding-top: 60px; /* Make sure that there is a gap on the navbar. */
}
</style>
</head>
<body>
{# Navbar code #}
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">{% block navbar_title %}{% endblock %}</a>
{% block navbar_content %}{% endblock %}
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
{# Sidebar code #}
{# Note that the sidebar is its own block, so we can remove it if need be. #}
{% block sidebar %}
<div class="span3">
<div class="well sidebar-nav">
{% block sidebar_content %}{% endblock %}
</div>
</div>
{% endblock %}
{% block body %}
<div class="span9">
{% block body_content %}{% endblock %}
</div>
{% endblock %}
</div>
</div>
</body>
{# General scripts #}
{% block scripts %}
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/jquery-ui.min.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}js/bootstrap.min.js"></script>
{% block global_scripts %}
<script type="text/javascript">
{# Scripts used globally go here. #}
</script>
{% endblock %}
<script type="text/javascript">
{% block page_scripts %}
{# This block is used by each page if they want to add additional scripts. #}
{% endblock %}
</script>
{% endblock %}{# endblock scripts #}
</html>
<!-- vim: ft=htmldjango

33
web/views/templates/login Normal file
View File

@ -0,0 +1,33 @@
{% extends "base" %}
{% block page_title %}Login to Melodia{% endblock %}
{% block navbar_title %}Login to Melodia{% endblock %}
{# Specifying a blank sidebar, rather than sidebar_content, allows us to remove the sidebar entirely. #}
{% block sidebar %}{% endblock %}
{% block body %}
<center>
<form action="" method="post">
{% csrf_token %}
{# We display the elements ourselves, since we don't want to render errors #}
<p><label>Username:</label>
{{ auth_form.username }}
</p>
<p><label>Password:</label>
{{ auth_form.password }}
</p>
<button class="btn btn-primary">Login to Melodia</button>
</form>
{% if auth_form.non_field_errors %}
<div class="alert alert-error span4 offset4">{{ auth_form.non_field_errors }}</div>
{% endif %}
</center>
{% endblock %}
<!-- vim: ft=htmldjango

15
web/views/templates/main Normal file
View File

@ -0,0 +1,15 @@
{% extends "base" %}
{% block page_title %}Melodia Music Player{% endblock %}
{% block navbar_title %}Melodia{% endblock %}
{% block sidebar_content %}
<a href="#">Sidebar content goes here.</a>
{% endblock %}
{% block body_content %}
<h1>Welcome to Melodia!</h1>
{% endblock %}
<!-- vim: ft=htmldjango