Début d'affichage.

This commit is contained in:
Klafyvel 2018-01-20 23:14:11 +01:00
parent 5dfa004a4f
commit e172c3e2e2
5 changed files with 44 additions and 0 deletions

View file

@ -16,6 +16,9 @@ Including another URLconf
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path
from . import views
urlpatterns = [ urlpatterns = [
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('', views.home),
] ]

10
site_tps/views.py Normal file
View file

@ -0,0 +1,10 @@
from django.shortcuts import render
from settings.models import SiteSettings
def home(request):
settings, _created = SiteSettings.objects.get_or_create()
return render(request, "home.html", {
'upload_allowed': settings.allow_upload,
'message': settings.home_message,
})

View file

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>NOM DE SITE</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">
</head>
<body>
{% include 'nav_bar.html' %}
{% block content %}{% endblock %}
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/js/bootstrap.min.js" integrity="sha384-a5N7Y/aK3qNeh15eJKGWxsqtnX/wWdSZSKp+81YjTmS15nvnvxKHuzaWwXHDli+4" crossorigin="anonymous"></script>
</body>
</html>

7
templates/home.html Normal file
View file

@ -0,0 +1,7 @@
{% extends 'base.html'%}
{% block content %}
<p> {{message|safe}} </p>
{% if not upload_allowed %}
<p>Les envois de contenu ne sont <em>pas autorisés</em> actuellement.</p>
{% endif %}
{% endblock %}

8
templates/nav_bar.html Normal file
View file

@ -0,0 +1,8 @@
<nav class="navbar navbar-default vbar-fixed-top navbar-inverse">
<div class="container">
<ul class="nav navbar-nav">
<li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
<li><a href="#">Link</a></li>
</ul>
</div>
</nav>