Transférer les fichiers vers 'app/templates'

This commit is contained in:
Filoji 2020-06-23 16:11:37 +02:00
parent 8737cdb6be
commit 6562d1302f
5 changed files with 100 additions and 0 deletions

37
app/templates/base.html Normal file
View File

@ -0,0 +1,37 @@
<html>
<head>
{% if title %}
<title>{{ title }} - {{ dico['nameApp'] }}</title>
{% else %}
<title>{{ dico['nameApp'] }}</title>
{% endif %}
</head>
<body>
<div>
{{ dico['nameApp'] }}
<a href="{{ url_for('home') }}">{{ dico['nameHome'] }}</a>
{% if userloged.is_authenticated == False %}
<a href="{{ url_for('login') }}">{{ dico['nameLogin'] }}</a>
{% else %}
<a href="{{ url_for('upload') }}">{{ dico['nameUpload'] }}</a>
<a href="{{ url_for('logout') }}">{{ dico['termLogout'] }}</a>
{% endif %}
{% if userloged.isAdmin == True %}
<a href="{{ url_for('register') }}">{{ dico['nameRegister'] }}</a>
{% endif %}
{{ userloged.username }}
<hr>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
{% block content %}
{% endblock %}
</div>
</body>
</html>

10
app/templates/home.html Normal file
View File

@ -0,0 +1,10 @@
{% extends 'base.html' %}
{% block content %}
<div>
<h1>Hi!</h1>
<p>This site is under development with the original name 'Pycloud'.<br>
It will be a cloud.
</p>
</div>
{% endblock %}

17
app/templates/login.html Normal file
View File

@ -0,0 +1,17 @@
{% extends 'base.html' %}
{% block content %}
<form action="" method="POST" enctype="multipart/form-data" novalidate>
{{ form.hidden_tag() }}
<p>
{{ form.username.label }}<br>
{{ form.username() }}</p>
<p>
{{ form.password.label }}<br>
{{ form.password() }}</p>
<p>
{{ form.remember_me() }}
{{ form.remember_me.label }}</p>
<p>{{ form.submit() }}</p>
</form>
{% endblock %}

View File

@ -0,0 +1,27 @@
{% extends 'base.html' %}
{% block content %}
<form action="" method="POST" enctype="multipart/form-data" novalidate>
{{ form.hidden_tag() }}
<p>
{{ form.username.label }}<br>
{{ form.username() }}
{% for error in form.username.errors %}
<br>{{ error }}
{% endfor %}
</p>
<p>
{{ form.password.label }}<br>
{{ form.password() }}
</p>
<p>
{{ form.repeatpassword.label }}<br>
{{ form.repeatpassword() }}
</p>
<p>
{{ form.isAdmin() }}
{{ form.isAdmin.label }}
</p>
<p>{{ form.submit() }}</p>
</form>
{% endblock %}

View File

@ -0,0 +1,9 @@
{% extends 'base.html' %}
{% block content %}
<form action="" method="POST" enctype="multipart/form-data" novalidate>
{{ form.hidden_tag() }}
<p>{{ form.uploadfile() }}</p>
<p>{{ form.submit() }}</p>
</form>
{% endblock %}