Commit fc8bea5f authored by erreur401's avatar erreur401

front mod (login and menu )

parent 7b39a2ce
{% extends "base.html" %}
{% block content %}
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<div class="alert alert-success alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h1>DASHBOARD</h1>
<div class="container">
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul class=flashes>
{% for message in messages %}
<div class="alert alert-success alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
<h3> dashboard for user {{current_user.email}}</h3>
{{ current_user.badges }}
<div class="badgesList">
<div class="row">
<div class="col-2">
<div class="badgeItem">
<div class="badgeImg">
<img src="{{ url_for('static', filename='img/chip.png')}}">
</div>
<span> Electronique </span>
</div>
</div>
<div class="col-2">
<div class="badgeItem">
<div class="badgeImg">
<img src="{{ url_for('static', filename='img/3dprint.png')}}">
</div>
<span> cnc </span>
</div>
</div>
<div class="col-2">
<div class="badgeItem">
<div class="badgeImg active">
<img src="{{ url_for('static', filename='img/cncico.png')}}">
</div>
<span> arduino </span>
</div>
</div>
<div class="col-2">
<div class="badgeItem">
<div class="badgeImg">
<img src="{{ url_for('static', filename='img/chip.png')}}">
</div>
<span> cnc </span>
</div>
</div>
<div class="col-2">
<div class="badgeItem">
<div class="badgeImg">
<img src="{{ url_for('static', filename='img/chip.png')}}">
</div>
<span> maker </span>
</div>
</div>
<div class="col-2">
<div class="badgeItem">
<div class="badgeImg active">
<img src="{{ url_for('static', filename='img/cncico.png')}}">
</div>
<span> arduino </span>
</div>
</div>
<div class="col-2">
<div class="badgeItem">
<div class="badgeImg fail">
<img src="{{ url_for('static', filename='img/chip.png')}}">
</div>
<span> cnc </span>
</div>
</div>
<div class="col-2">
<div class="badgeItem">
<div class="badgeImg">
<img src="{{ url_for('static', filename='img/chip.png')}}">
</div>
<span> maker </span>
</div>
</div>
</div>
{% endfor %}
</ul>
{% endif %}
{% endwith %}
<h1>dashboard for user {{current_user.email}}</h1>
LOGGED BEBE<br>
{{ current_user.email }}<br>
{{ current_user.badges }}
</div>
</div>
<style type="text/css">
.badgeImg{
border-radius: 50%;
background-color: #ecf0f1;
overflow: hidden;
flex: 1 0 auto;
height:auto;
position: relative;
}
.badgeImg.active{
background-color:#2ecc71;
}
.badgeImg.fail{
background-color:#e74c3c;
}
.badgeImg img{
width: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
.badgeImg:before {
content:'';
float:left;
padding-top:100%;
}
.badgeItem {
display: block;
text-align: center;
justify-content: space-around;
}
</style>
{% endblock %}
......@@ -18,11 +18,13 @@
<div class="col-xs-12 col-sm-12 col-md-5 col-lg-5 no-gutter">
<ul id="menuSecond">
<li class="item"><a href="/login">inscription</a></li>
{% if current_user.is_authenticated %}
<li><a href="/dashboard">logged in as: {{ current_user.email }}</a></li>
{% endif %}
<li><a href="/dashboard">Dashboard</a></li>
<li><a href="{{ url_for('security.logout') }}">Logout</a></li>
{% else %}
{% include "security/_menu.html" %}
{% endif %}
<li class="item"><a href="#">FR/NL</a></li>
</ul>
</div>
......
{% if security.registerable or security.recoverable or security.confirmable %}
<li><a href="{{ url_for_security('login') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">{{ _('Login') }}</a></li>
{% if security.registerable %}
<li><a href="{{ url_for_security('register') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">{{ _('Register') }}</a><br/></li>
{% endif %}
{% if security.recoverable %}
{% if security.registerable %}
<li><a href="{{ url_for_security('register') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">{{ _('Register') }}</a><br/></li>
<li><a href="{{ url_for_security('login') }}{% if 'next' in request.args %}?next={{ request.args.next|urlencode }}{% endif %}">{{ _('Login') }}</a></li>
{% endif %}
<!-- {% if security.recoverable %}
<li><a href="{{ url_for_security('forgot_password') }}">{{ _('Forgot password') }}</a><br/></li>
{% endif %}
{% endif %} -->
{% if security.confirmable %}
<li><a href="{{ url_for_security('send_confirmation') }}">{{ _('Confirm account') }}</a></li>
{% endif %}
......
......@@ -4,13 +4,24 @@
{% block content %}
{% include "security/_messages.html" %}
<h1>{{ _('Login') }}</h1>
<form action="{{ url_for_security('login') }}" method="POST" name="login_user_form">
<div class="container ">
<dir class="row no-gutters justify-content-md-center align-items-center">
<div class=" col col-12 col-sm-8 col-md-4 col-lg-4">
<form action="{{ url_for_security('login') }}" method="POST" name="login_user_form">
{{ login_user_form.hidden_tag() }}
{{ render_field_with_errors(login_user_form.email) }}
{{ render_field_with_errors(login_user_form.password) }}
{% if security.recoverable %}
<a href="{{ url_for_security('forgot_password') }}">{{ _('Forgot password') }}</a><br/>
{% endif %}
{{ render_field_with_errors(login_user_form.remember) }}
{{ render_field(login_user_form.submit) }}
</form>
{# {% include "security/_menu.html" %}#}
</div>
</div>
</div>
{{ login_user_form.hidden_tag() }}
{{ render_field_with_errors(login_user_form.email) }}
{{ render_field_with_errors(login_user_form.password) }}
{{ render_field_with_errors(login_user_form.remember) }}
{{ render_field(login_user_form.submit) }}
</form>
{# {% include "security/_menu.html" %}#}
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment