Add static and templates

This commit is contained in:
Gabriel Augendre 2016-06-03 19:33:12 +02:00
parent c5eea4cfb4
commit f4516604bf
No known key found for this signature in database
GPG key ID: D2B6A5B41FC438B1
6 changed files with 107 additions and 0 deletions

0
refunds/static/.gitkeep Normal file
View file

View file

@ -0,0 +1,7 @@
{% extends 'base.html' %}
{% block title %}About{% endblock %}
{% block content %}
<h1>About</h1>
<p>This page is under construct and will be updated as soon as possible.</p>
{% endblock %}

View file

@ -0,0 +1,9 @@
{% extends 'base.html' %}
{% block title %}Home{% endblock %}
{% block content %}
<h1>Gab's thoughts</h1>
<p class="lead">Welcome to my blog. I hope you will enjoy your journey here.</p>
<p>This blog is about creating websites with Django, a Python framework designed for web.</p>
<p>Feel free to start by exploring my <a href="{% url 'posts_latest' %}">latest blog entries</a>.</p>
{% endblock %}

15
static/default_style.css Normal file
View file

@ -0,0 +1,15 @@
html {
position: relative;
min-height: 100%;
font-size: 16px;
}
body {
font-size: 1rem;
font-family: 'Open Sans', sans-serif;
line-height: 1.5;
}
h1 {
font-weight: bold;
}

33
templates/base.html Normal file
View file

@ -0,0 +1,33 @@
{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Gab's thoughts &bull; {% block title %}{% endblock %}</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block style %}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700">
<link rel="stylesheet" href="{% static 'default_style.css' %}">
{% endblock style %}
</head>
<body>
{% include 'navbar.html' %}
<div class="container">
{% block content %}
{% endblock %}
</div>
{% block javascript %}
<script src="https://code.jquery.com/jquery-2.2.3.min.js"
integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
crossorigin="anonymous"></script>
{% endblock javascript %}
</body>
</html>

43
templates/navbar.html Normal file
View file

@ -0,0 +1,43 @@
<nav class="navbar navbar-default">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="{% url 'blog_home' %}">Gab's thoughts</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a href="{% url 'posts_latest' %}">Blog posts</a></li>
<li><a href="{% url 'blog_about' %}">About</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
{% if not user.is_authenticated %}
<li><a href="{% url 'auth_login' %}?next={{ request.path }}">Login</a></li>
{% elif user.is_staff %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false">
{% firstof user.get_full_name user.username %} <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="{% url 'posts_drafts' %}">Drafts</a></li>
<li><a href="{% url 'admin:index' %}">Admin</a></li>
<li role="separator" class="divider"></li>
<li><a href="{% url 'auth_logout' %}?next={{ request.path }}">Logout</a></li>
</ul>
</li>
{% else %}
<li><a href="{% url 'auth_logout' %}?next={{ request.path }}">Logout</a></li>
{% endif %}
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>