Browse Source

changed layout and adjusted templates

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

8
ordr2/static/style.css

@ -35,3 +35,11 @@ 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;
}

7
ordr2/templates/account/forgot_password_email.jinja2

@ -4,13 +4,12 @@
{% 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> <h1>Password Reset Link</h1>
<p>To reset your password, an email has been sent to you.</p> <p>To reset your password, an email has been sent to you.</p>
<p>Please follow the link in the email to set a new password.</p> <p>Please follow the link in the email to set a new password.</p>
</div> </div>
</div> </div>
{{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

7
ordr2/templates/account/forgot_password_form.jinja2

@ -3,9 +3,8 @@
{% 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() }}">
@ -20,4 +19,6 @@
</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 %}

7
ordr2/templates/account/register.jinja2

@ -4,12 +4,11 @@
{% 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> <h1>Account Registration</h1>
{{ form.render()|safe }} {{ form.render()|safe }}
</div> </div>
</div> </div>
{{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

7
ordr2/templates/account/registration_completed.jinja2

@ -4,14 +4,13 @@
{% 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> <h1>Account Registration Completed</h1>
<p>Thank you for verifying your email address.</p> <p>Thank you for verifying your email address.</p>
<p>Before you can start ordering, an administrator must activate your account</p> <p>Before you can start ordering, an administrator must activate your account</p>
<p>You'll receive an email when your account is activated</p> <p>You'll receive an email when your account is activated</p>
</div> </div>
</div> </div>
{{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

7
ordr2/templates/account/registration_confirmation.jinja2

@ -4,13 +4,12 @@
{% 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> <h1>Verify Your Email Address</h1>
<p>To complete the registration process an email has been sent to you.</p> <p>To complete the registration process an email has been sent to you.</p>
<p>Please follow the link in the email to verify your address and complete the registration process</p> <p>Please follow the link in the email to verify your address and complete the registration process</p>
</div> </div>
</div> </div>
{{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

7
ordr2/templates/account/reset_password.jinja2

@ -4,12 +4,11 @@
{% 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> <h1>Reset Your Password</h1>
{{ form.render()|safe }} {{ form.render()|safe }}
</div> </div>
</div> </div>
{{ macros.center_column_hack() }}
{% endblock content %} {% endblock content %}

10
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">
<div class="row">
<div class="col-2">
{% block sidebar %} {% endblock sidebar %}
</div>
<div class="col">
{{ macros.flash_messages() }}
{% block content %} {% block content %}
<p>No content</p> <p>No content</p>
{% endblock content %} {% 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 %}

6
ordr2/templates/pages/welcome.jinja2

@ -3,9 +3,6 @@
{% block title %} Ordr | Welcome {% endblock title %} {% block title %} Ordr | Welcome {% endblock title %}
{% block content %} {% block content %}
<div class="row justify-content-center">
<div class="col-8">
<div class="jumbotron"> <div class="jumbotron">
<h1>Welcome to <span class="brand">ordr</span>!</h1> <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 class="lead">An order management system to simplify your shopping for laboratory supplies.</p>
@ -28,6 +25,5 @@
<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> <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> {{ macros.center_column_hack() }}
</div>
{% 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'))