Adding the core applications code to the repository
This commit is contained in:
21
website/templates/base.html
Normal file
21
website/templates/base.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
{% load staticfiles %} {% load bootstrap3 %}
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<title>{% block title %}La maraude{% endblock %}</title>
|
||||
{% if stylesheets %}{% for stylesheet in stylesheets %}<link rel="stylesheet" type="text/css" href="{% static stylesheet %}" />{% endfor %}{% endif %}
|
||||
{# Load CSS and JavaScript #}{% bootstrap_css %}{% bootstrap_javascript %}
|
||||
</head>
|
||||
<body>
|
||||
{% block globalnav %}{% endblock %}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
{% block panels %}<div class="col-md-12">{% endblock %}
|
||||
{% bootstrap_messages %}
|
||||
<div class="page-header"><h1>{% block page_header %}Header{% endblock %}</h1></div>
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
19
website/templates/base_site.html
Normal file
19
website/templates/base_site.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ page_title }}{% endblock %}
|
||||
{% block page_header %}{{ page_header }} <small>{{ page_header_small }}</small>{% endblock %}
|
||||
|
||||
{% block globalnav %}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{% include "navbar.html" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block panels %}
|
||||
{% if panels %}<div class="col-md-2">{{ panels }}</div><div class="col-md-10">
|
||||
{% else %}{{ block.super }}{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}{% include content_template %}{% endblock %}
|
||||
48
website/templates/login.html
Normal file
48
website/templates/login.html
Normal file
@@ -0,0 +1,48 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% load bootstrap3 %}
|
||||
|
||||
{# Tweak columns layout for login box %}
|
||||
{% block panels %}<div class="col-md-8 col-md-offset-2">{% endblock %}
|
||||
|
||||
{% block page_header %}
|
||||
<div class="jumbotron bg-warning">
|
||||
<h2>ALSA - Projet Maraude</h2>
|
||||
<p>Description de la maraude...</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading"><h3 class="panel-title">Connexion</h3></div>
|
||||
<div class="panel-body text-center">
|
||||
{% if user.is_authenticated %}
|
||||
<p>Bienvenue {{ user.first_name|default:user.username }} !</p>
|
||||
{% if next %}
|
||||
<div class="alert alert-warning"><p>Votre compte ne donne pas accès à cette page. Veuillez vous
|
||||
connecter avec un autre compte.</p></div>
|
||||
<a href="{% url 'logout' %}" class="btn btn-danger">Déconnexion</a>
|
||||
{% else %}
|
||||
<div class="btn-group">
|
||||
<a href="{% url 'maraudes:index' %}" class="btn btn-primary">Entrer</a>
|
||||
{% if user.is_superuser %}
|
||||
<a href="admin/" class="btn btn-warning">Administration</a>
|
||||
{% endif %}
|
||||
<a href="{% url 'logout' %}" class="btn btn-danger">Déconnexion</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if next %}
|
||||
<div class="alert alert-danger"><p>Veuillez vous connecter pour accéder à cette page.</p></div>
|
||||
{% endif %}
|
||||
<form method="post" action="{% url 'django.contrib.auth.views.login' %}">
|
||||
{% csrf_token %}
|
||||
{% bootstrap_form form %}
|
||||
{% bootstrap_button "Connexion" button_type="submit" button_class="btn-lg btn-primary" %}
|
||||
<input type="hidden" name="next" value="{{ next|default:'/maraudes/' }}" />
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="panel-footer"><p>version: 0.01</p></div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
1
website/templates/logout.html
Normal file
1
website/templates/logout.html
Normal file
@@ -0,0 +1 @@
|
||||
<h1>{{ title }}</h1>
|
||||
38
website/templates/main.html
Normal file
38
website/templates/main.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{% load bootstrap3 %}
|
||||
|
||||
{% block content %}
|
||||
{% bootstrap_messages %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><h3 class="panel-title">Maraude ALSA</h3></div>
|
||||
<div class="panel-body text-center">
|
||||
{% if user.is_authenticated %}
|
||||
<p>Bienvenue {{ user }} !</p>
|
||||
<div class="btn-group">
|
||||
<a href="{% url 'maraudes:index' %}" class="btn btn-primary">Entrer</a>
|
||||
{% if user.is_superuser %}
|
||||
<a href="admin/" class="btn btn-warning">Administration</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% if form.errors %}
|
||||
<p>Your username and password didn't match. Please try again.</p>
|
||||
{% endif %}
|
||||
{% if next %}
|
||||
{% if user.is_authenticated %}
|
||||
<div class="alert alert-warning"><p>Your account doesn't have access to this page. To proceed,
|
||||
please login with an account that has access.</p></div>
|
||||
{% else %}
|
||||
<div class="alert alert-danger"><p>Veuillez vous connecter pour accéder à cette page.</p></div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<form method="post" action="{% url 'django.contrib.auth.views.login' %}">
|
||||
{% csrf_token %}
|
||||
{% bootstrap_form form %}
|
||||
{% bootstrap_button "Connexion" button_type="submit" button_class="btn-lg btn-primary" %}
|
||||
<input type="hidden" name="next" value="{{ next|default:'maraudes/' }}" />
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="panel-footer"><p>version: 0.01</p></div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
41
website/templates/navbar.html
Normal file
41
website/templates/navbar.html
Normal file
@@ -0,0 +1,41 @@
|
||||
{% load bootstrap3 %}{% load staticfiles %}
|
||||
<nav class="navbar navbar-default navbar-static-top">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<img alt="Logo Alsa" src="{% static 'alsa_logo.png' %}" class="img-rounded">
|
||||
</div>
|
||||
<ul class="nav navbar-nav navbar-left">{% for app in apps %}
|
||||
<li {% if app == active_app %} class="active" {%endif%}>
|
||||
<a href="/{{app.label}}/">{{ app.name|title }}</a>
|
||||
</li>{%endfor%}
|
||||
</ul>
|
||||
{% if prochaine_maraude_abs %}<p class="navbar-text">{% bootstrap_icon "calendar" %} <b>Prochaine maraude :</b>
|
||||
{% if prochaine_maraude_abs.date == now.date %} Aujourd'hui {% else %} {{ prochaine_maraude_abs.date }} {% endif %}
|
||||
- {{ prochaine_maraude_abs.heure_debut.hour }}h</p>{%endif%}
|
||||
<!-- Navbar Right Aligned elements -->
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<a id="UserMenu" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
{% bootstrap_icon "user" %} {{user}} <span class="caret"></span></a>
|
||||
<ul class="dropdown-menu" aria-labelledby="UserMenu">
|
||||
{% if user.is_authenticated %}{% if user.is_superuser %}<li><a href="/admin/">Administration</a></li>
|
||||
<li role="separator" class="divider"></li>{% endif %}
|
||||
<li><a href="{% url 'logout' %}">Déconnecter</a></li>{% endif %}
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Search form -->
|
||||
<form class="navbar-form navbar-right" role="search">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" placeholder="NotYetImplemented" />
|
||||
<span class="input-group-btn"><button class="btn btn-default" type="button"><i class="glyphicon glyphicon-search"></i></button></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</nav>
|
||||
Reference in New Issue
Block a user