Browse Source

changed layout and adjusted templates

master
Holger Frey 7 years ago
parent
commit
57d0b4b373
  1. 10
      ordr2/static/style.css
  2. 17
      ordr2/templates/account/forgot_password_email.jinja2
  3. 33
      ordr2/templates/account/forgot_password_form.jinja2
  4. 7
      ordr2/templates/account/login.jinja2
  5. 37
      ordr2/templates/account/password_resetted.jinja2
  6. 15
      ordr2/templates/account/register.jinja2
  7. 19
      ordr2/templates/account/registration_completed.jinja2
  8. 17
      ordr2/templates/account/registration_confirmation.jinja2
  9. 15
      ordr2/templates/account/reset_password.jinja2
  10. 16
      ordr2/templates/layout.jinja2
  11. 5
      ordr2/templates/pages/faq.jinja2
  12. 42
      ordr2/templates/pages/welcome.jinja2
  13. 14
      ordr2/views/account.py

10
ordr2/static/style.css

@ -32,6 +32,14 @@ main h1 {
} }
.deform-form-buttons{ .deform-form-buttons {
padding-top: 2rem; padding-top: 2rem;
} }
.form-group.has-error input {
border-color: #e32;
}
.form-group.has-error .form-text:nth-of-type(1) {
color: #e32 !important;
}

17
ordr2/templates/account/forgot_password_email.jinja2

@ -3,14 +3,13 @@
{% block title %} Ordr | Forgotten Password {% endblock title %} {% block title %} Ordr | Forgotten Password {% endblock title %}
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col-2"></div> <div class="col-6">
<div class="col-5"> <h1>Password Reset Link</h1>
<p>To reset your password, an email has been sent to you.</p>
<h1>Password Reset Link</h1> <p>Please follow the link in the email to set a new password.</p>
<p>To reset your password, an email has been sent to you.</p> </div>
<p>Please follow the link in the email to set a new password.</p>
</div> </div>
</div> {{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

33
ordr2/templates/account/forgot_password_form.jinja2

@ -3,21 +3,22 @@
{% block title %} Ordr | Forgotten Password {% endblock title %} {% block title %} Ordr | Forgotten Password {% endblock title %}
{% block content %} {% block content %}
<div class="row justify-content-center"> <div class="row">
<div class="col-4"> <div class="col-6">
<h1>Forgotten password?</h1>
<h1>Forgotten password?</h1> <form action="{{ request.resource_url(request.root, 'account', 'forgot-password') }}" method="POST" id="forgotten-password-form" class="form">
<form action="{{ request.resource_url(request.root, 'account', 'forgot-password') }}" method="POST" id="forgotten-password-form" class="form"> <input type="hidden" name="csrf_token" value="{{ get_csrf_token() }}">
<input type="hidden" name="csrf_token" value="{{ get_csrf_token() }}"> <div class="form-group">
<div class="form-group"> <label for="username_or_email" class="form-control-label">Username or Email:</label>
<label for="username_or_email" class="form-control-label">Username or Email:</label> <input name="username_or_email" id="username_or_email" type="text" class="form-control">
<input name="username_or_email" id="username_or_email" type="text" class="form-control"> </div>
</div> <div class="form-group">
<div class="form-group"> <button type="submit" name="submit" class="btn btn-sm btn-primary">Reset Password</button>
<button type="submit" name="submit" class="btn btn-sm btn-primary">Reset Password</button> <button type="submit" name="cancel" class="btn btn-sm btn-secondary">Cancel</button>
<button type="submit" name="cancel" class="btn btn-sm btn-secondary">Cancel</button> </div>
</div> </form>
</form> </div>
</div> </div>
</div> {{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

7
ordr2/templates/account/login.jinja2

@ -3,9 +3,6 @@
{% block title %} Ordr | Login Failed {% endblock title %} {% block title %} Ordr | Login Failed {% endblock title %}
{% block content %} {% block content %}
<div class="row justify-content-center">
<div class="col-8">
<h1>Try again…</h1> <h1>Try again…</h1>
<p class="alert alert-danger">You entered the wrong username or password.</p> <p class="alert alert-danger">You entered the wrong username or password.</p>
@ -34,6 +31,6 @@
<p> <p>
If you forgot your password you can <a href="{{ request.resource_url(context, 'forgot-password') }}">reset it</a>. If you forgot your password you can <a href="{{ request.resource_url(context, 'forgot-password') }}">reset it</a>.
</p> </p>
</div> {{ macros.center_column_hack() }}
</div>
{% endblock content %} {% endblock content %}

37
ordr2/templates/account/password_resetted.jinja2

@ -1,37 +0,0 @@
{% extends "ordr2:templates/layout.jinja2" %}
{% block title %} Ordr | Reset Password {% endblock title %}
{% block content %}
<div class="row">
<div class="col-2"></div>
<div class="col-5">
<h1>Password Reset Successful</h1>
<p>You can now log on with your new password</p>
<form action="{{ request.resource_url(request.root, 'account', 'login') }}" method="POST" id="login-form">
<input type="hidden" name="csrf_token" value="{{ get_csrf_token() }}">
<div class="form-group row">
<label for="username" class="col-2">Username</label>
<div class="col-6">
<input name="username" id="username" type="text" class="form-control">
</div>
</div>
<div class="form-group row">
<label for="password" class="col-2">Password</label>
<div class="col-6">
<input name="password" id="password>" type="password" class="form-control">
</div>
</div>
<div class="form-group row">
<div class="col-2"></div>
<div class="col-6">
<button type="submit" class="btn btn-sm btn-primary">Log in</button>
</div>
</div>
</form>
</div>
</div>
{% endblock content %}

15
ordr2/templates/account/register.jinja2

@ -3,13 +3,12 @@
{% block title %} Ordr | Account Registration {% endblock title %} {% block title %} Ordr | Account Registration {% endblock title %}
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col-2"></div> <div class="col-6">
<div class="col-5"> <h1>Account Registration</h1>
{{ form.render()|safe }}
<h1>Account Registration</h1> </div>
{{ form.render()|safe }}
</div> </div>
</div> {{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

19
ordr2/templates/account/registration_completed.jinja2

@ -3,15 +3,14 @@
{% block title %} Ordr | Account Registration {% endblock title %} {% block title %} Ordr | Account Registration {% endblock title %}
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col-2"></div> <div class="col-6">
<div class="col-5"> <h1>Account Registration Completed</h1>
<p>Thank you for verifying your email address.</p>
<h1>Account Registration Completed</h1> <p>Before you can start ordering, an administrator must activate your account</p>
<p>Thank you for verifying your email address.</p> <p>You'll receive an email when your account is activated</p>
<p>Before you can start ordering, an administrator must activate your account</p> </div>
<p>You'll receive an email when your account is activated</p>
</div> </div>
</div> {{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

17
ordr2/templates/account/registration_confirmation.jinja2

@ -3,14 +3,13 @@
{% block title %} Ordr | Account Registration {% endblock title %} {% block title %} Ordr | Account Registration {% endblock title %}
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col-2"></div> <div class="col-6">
<div class="col-5"> <h1>Verify Your Email Address</h1>
<p>To complete the registration process an email has been sent to you.</p>
<h1>Verify Your Email Address</h1> <p>Please follow the link in the email to verify your address and complete the registration process</p>
<p>To complete the registration process an email has been sent to you.</p> </div>
<p>Please follow the link in the email to verify your address and complete the registration process</p>
</div> </div>
</div> {{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

15
ordr2/templates/account/reset_password.jinja2

@ -3,13 +3,12 @@
{% block title %} Ordr | Reset Password {% endblock title %} {% block title %} Ordr | Reset Password {% endblock title %}
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="col-2"></div> <div class="col-6">
<div class="col-5"> <h1>Reset Your Password</h1>
{{ form.render()|safe }}
<h1>Reset Your Password</h1> </div>
{{ form.render()|safe }}
</div> </div>
</div> {{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

16
ordr2/templates/layout.jinja2

@ -1,3 +1,5 @@
{% import 'ordr2:templates/macros.jinja2' as macros with context %}
<!DOCTYPE html> <!DOCTYPE html>
<html lang="{{ request.locale_name }}"> <html lang="{{ request.locale_name }}">
@ -78,9 +80,17 @@
</header> </header>
<main class="container-fluid"> <main class="container-fluid">
{% block content %} <div class="row">
<p>No content</p> <div class="col-2">
{% endblock content %} {% block sidebar %} {% endblock sidebar %}
</div>
<div class="col">
{{ macros.flash_messages() }}
{% block content %}
<p>No content</p>
{% endblock content %}
</div>
</main> </main>

5
ordr2/templates/pages/faq.jinja2

@ -3,8 +3,7 @@
{% block title %} Ordr | FAQ {% endblock title %} {% block title %} Ordr | FAQ {% endblock title %}
{% block content %} {% block content %}
<div class="row justify-content-center o2-faqs"> <div class="o2-faqs">
<div class="col-8">
<h1>Frequently Asked Questions</h1> <h1>Frequently Asked Questions</h1>
<div class="card"> <div class="card">
@ -69,5 +68,5 @@
</section> </section>
</div> </div>
</div> </div>
</div> {{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

42
ordr2/templates/pages/welcome.jinja2

@ -3,31 +3,27 @@
{% block title %} Ordr | Welcome {% endblock title %} {% block title %} Ordr | Welcome {% endblock title %}
{% block content %} {% block content %}
<div class="row justify-content-center"> <div class="jumbotron">
<div class="col-8"> <h1>Welcome to <span class="brand">ordr</span>!</h1>
<p class="lead">An order management system to simplify your shopping for laboratory supplies.</p>
<p>
<strong>What can order do for you?</strong> It will simplify the process of ordering laboratory supplies by using the power of the newest web technologies. Interested? Just follow the three steps below!
</p>
</div>
<div class="jumbotron"> <div class="row">
<h1>Welcome to <span class="brand">ordr</span>!</h1> <div class="col-4">
<p class="lead">An order management system to simplify your shopping for laboratory supplies.</p> <h2>1. Register</h2>
<p> <p>Registration is easy as 1-2-3. Just fill out the form on <?php echo anchor('account/register', 'this page');?> and as soon as an admin has activated your account the shopping can begin!</p>
<strong>What can order do for you?</strong> It will simplify the process of ordering laboratory supplies by using the power of the newest web technologies. Interested? Just follow the three steps below!
</p>
</div> </div>
<div class="col-4">
<div class="row"> <h2>2. Place an Order</h2>
<div class="col-4"> <p>A lot of the chemicals, supllies and so forth are already stored in the database, so you don't have to fill out the order form your self!</p>
<h2>1. Register</h2> </div>
<p>Registration is easy as 1-2-3. Just fill out the form on <?php echo anchor('account/register', 'this page');?> and as soon as an admin has activated your account the shopping can begin!</p> <div class="col-4">
</div> <h2>3. Get notified</h2>
<div class="col-4"> <p>As soons as your purchase has arrived you will automatically get notified. Or you can use the orders overview to check what the working status is.</p>
<h2>2. Place an Order</h2>
<p>A lot of the chemicals, supllies and so forth are already stored in the database, so you don't have to fill out the order form your self!</p>
</div>
<div class="col-4">
<h2>3. Get notified</h2>
<p>As soons as your purchase has arrived you will automatically get notified. Or you can use the orders overview to check what the working status is.</p>
</div>
</div> </div>
</div> </div>
</div> {{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

14
ordr2/views/account.py

@ -106,8 +106,8 @@ def registration_form_processing(context, request):
# issue a warning on a short password # issue a warning on a short password
if len(appstruct['password']) < PROPOSED_PASSWORD_LENGTH: if len(appstruct['password']) < PROPOSED_PASSWORD_LENGTH:
request.session.flash( request.session.flash(
'warning', 'You should really consider a longer password',
'You should really consider a longer password' 'warning'
) )
return HTTPFound(request.resource_url(context, 'registered')) return HTTPFound(request.resource_url(context, 'registered'))
@ -171,8 +171,8 @@ def forgot_password_form_processing(context, request):
) )
if not account: if not account:
request.session.flash( request.session.flash(
'warning', 'Username or email address unknown',
'Username or email address unknown' 'error'
) )
return {} return {}
@ -234,10 +234,10 @@ def reset_password_form_processing(context, request):
# issue a warning on a short password # issue a warning on a short password
if len(appstruct['password']) < PROPOSED_PASSWORD_LENGTH: if len(appstruct['password']) < PROPOSED_PASSWORD_LENGTH:
request.session.flash( request.session.flash(
'warning', 'You should really consider a longer password',
'You should really consider a longer password' 'warning'
) )
request.session.flash('OK', 'Your password was changed' ) request.session.flash('Your password was changed', 'ok')
return HTTPFound(request.resource_url(context.__parent__, 'login')) return HTTPFound(request.resource_url(context.__parent__, 'login'))