From 3ecce5419f4fee5e7777f3aadf1ec2b5142cea08 Mon Sep 17 00:00:00 2001 From: Elise <moreau.elise13@gmail.com> Date: Mon, 28 Sep 2020 13:46:10 +0200 Subject: [PATCH] format forms in log in and sign up --- public/assets/css/general.css | 7 ++++++ templates/user/create_user.twig | 2 ++ templates/user/log_in.twig | 39 +++++++++++++++++---------------- 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/public/assets/css/general.css b/public/assets/css/general.css index 93830f5..7837fa0 100644 --- a/public/assets/css/general.css +++ b/public/assets/css/general.css @@ -36,4 +36,11 @@ body, html { width: 350px; } +.form_format { + display: flex; + justify-content: center; + align-items: center; + min-height: calc(100vh - 240px); + +} \ No newline at end of file diff --git a/templates/user/create_user.twig b/templates/user/create_user.twig index 052983f..aabc7e0 100644 --- a/templates/user/create_user.twig +++ b/templates/user/create_user.twig @@ -1,5 +1,6 @@ {% extends 'common/layout.twig' %} {% block content %} +<div class="form_format"> <form class="ui form {% if formstatus %} {{formstatus}} {% endif %} " action="/users" method="post"> <h4 class="ui dividing header">Sign Up</h4> <div class="field"> @@ -42,4 +43,5 @@ </div> <input type="submit" class="ui submit button"> </form> +</div> {% endblock %} \ No newline at end of file diff --git a/templates/user/log_in.twig b/templates/user/log_in.twig index c6c9c50..eaa917f 100644 --- a/templates/user/log_in.twig +++ b/templates/user/log_in.twig @@ -1,24 +1,25 @@ {% extends 'common/layout.twig' %} {% block content %} -<form class="ui form {% if formstatus %} {{formstatus}} {% endif %} " action="/users/{{id}}" method="get"> -<h4 class="ui dividing header">Log In</h4> - <div class="field"> - <input type="text" name="username" id="username" placeholder="Username" value="{{username}}" required> - {% if username_formstatus %} - <div class="ui {{formstatus}} message"> - <p>Username unknown.</p> +<div class="form_format"> + <form class="ui form {% if formstatus %} {{formstatus}} {% endif %} " action="/users/{{id}}" method="get"> + <h4 class="ui dividing header">Log In</h4> + <div class="field"> + <input type="text" name="username" id="username" placeholder="Username" value="{{username}}" required> + {% if username_formstatus %} + <div class="ui {{formstatus}} message"> + <p>Username unknown.</p> + </div> + {% endif %} </div> - {% endif %} - </div> - <div class="field"> - <input type="password" name="password" id="password" placeholder="Password" required> - {% if username_formstatus %} - <div class="ui {{formstatus}} message"> - <p>Password incorrect.</p> + <div class="field"> + <input type="password" name="password" id="password" placeholder="Password" required> + {% if username_formstatus %} + <div class="ui {{formstatus}} message"> + <p>Password incorrect.</p> + </div> + {% endif %} </div> - {% endif %} - </div> - - <input type="submit" class="ui submit button"> -</form> + <input type="submit" class="ui submit button"> + </form> +</div> {% endblock %} \ No newline at end of file -- GitLab