update to bootstrap 4
This commit is contained in:
85
templates/_base.html
Normal file
85
templates/_base.html
Normal file
@@ -0,0 +1,85 @@
|
||||
{% load static %}<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>carom - {% block title %}TITLE SETZEN{% endblock %}</title>
|
||||
<meta name="description" content="carom billard management">
|
||||
<meta name="author" content="Robert Einsle <robert@einsle.de>">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
{% block header %}
|
||||
{% endblock %}
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://fonts.googleapis.com/css?family=Peralta" rel="stylesheet">
|
||||
<link href="{% static 'css/bootstrap.min.css' %}" rel="stylesheet" type="text/css">
|
||||
<link href="{% static 'css/billard.css' %}" rel="stylesheet" type="text/css">
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="{% static 'js/html5shiv.min.js' %}"></script>
|
||||
<script src="{% static 'js/respond.min.js' %}" type="text/javascript"></script>
|
||||
<![endif]-->
|
||||
{% block stylesheet %}{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}
|
||||
<div class="wrapper">
|
||||
<nav class="navbar navbar-expand-sm navbar-dark bg-dark">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{% url 'index' %}">carom</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#mainMenu"
|
||||
aria-controls="mainMenu" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="mainMenu">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{% url 'billard:location_index' %}">Standorte</a>
|
||||
</li>
|
||||
{% if user.is_superuser %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/admin">Administration</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% if user.is_authenticated %}
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="userMenu" data-toggle="dropdown"
|
||||
aria-haspopup="true" aria-expanded="false">
|
||||
{{ user.username }}
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userMenu">
|
||||
<a class="dropdown-item" href="#">My account</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="{% url 'logout' %}">Log out</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<form class="form-inline ml-auto">
|
||||
<a href="{% url 'login' %}" class="btn btn-outline-secondary">Log in</a>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container-fluid">
|
||||
<ol class="breadcrumb my-4">
|
||||
{% block breadcrumb %}
|
||||
{% endblock breadcrumb %}
|
||||
</ol>
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</div>
|
||||
<div class="push"></div>
|
||||
</div>
|
||||
{% endblock body %}
|
||||
<script src="{% static 'js/jquery-3.3.1.min.js' %}" type="text/javascript"></script>
|
||||
<script src="{% static 'js/popper.min.js' %}" type="text/javascript"></script>
|
||||
<script src="{% static 'js/bootstrap.min.js' %}" type="text/javascript"></script>
|
||||
<script src="{% static 'js/carom.js' %}" type="text/javascript"></script>
|
||||
{% block js %}
|
||||
{% endblock %}
|
||||
</body>
|
||||
</html>
|
17
templates/_base_accounts.html
Normal file
17
templates/_base_accounts.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends '_base.html' %}
|
||||
|
||||
{% load static %}
|
||||
|
||||
{% block stylesheet %}
|
||||
<link rel="stylesheet" href="{% static 'css/login.css' %}">
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
<h1 class="text-center logo my-4">
|
||||
<a href="{% url 'billard:location_index' %}">carom</a>
|
||||
</h1>
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% endblock %}
|
26
templates/includes/form.html
Normal file
26
templates/includes/form.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% load form_tags widget_tweaks %}
|
||||
|
||||
{% if form.non_field_errors %}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{% for error in form.non_field_errors %}
|
||||
<p{% if forloop.last %} class="mb-0"{% endif %}>{{ error }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% for field in form %}
|
||||
<div class="form-group">
|
||||
{{ field.label_tag }}
|
||||
{% render_field field class=field|input_class %}
|
||||
{% for error in field.errors %}
|
||||
<div class="invalid-feedback">
|
||||
{{ error }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if field.help_text %}
|
||||
<small class="form-text text-muted">
|
||||
{{ field.help_text|safe }}
|
||||
</small>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
21
templates/registration/login.html
Normal file
21
templates/registration/login.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{% extends '_base_accounts.html' %}
|
||||
|
||||
{% block title %}login{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-4 col-md-6 col-sm-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Log in</h3>
|
||||
<form method="post" novalidate>
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="next" value="{{ next }}">
|
||||
{% include 'includes/form.html' %}
|
||||
<button type="submit" class="btn btn-primary btn-block">Log in</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user