Browse Source

changed layout and adjusted templates

master
Holger Frey 7 years ago
parent
commit
57d0b4b373
  1. 10
      ordr2/static/style.css
  2. 11
      ordr2/templates/account/forgot_password_email.jinja2
  3. 9
      ordr2/templates/account/forgot_password_form.jinja2
  4. 7
      ordr2/templates/account/login.jinja2
  5. 37
      ordr2/templates/account/password_resetted.jinja2
  6. 11
      ordr2/templates/account/register.jinja2
  7. 11
      ordr2/templates/account/registration_completed.jinja2
  8. 11
      ordr2/templates/account/registration_confirmation.jinja2
  9. 11
      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

10
ordr2/static/style.css

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

11
ordr2/templates/account/forgot_password_email.jinja2

@ -3,14 +3,13 @@ @@ -3,14 +3,13 @@
{% block title %} Ordr | Forgotten Password {% endblock title %}
{% block content %}
<div class="row">
<div class="col-2"></div>
<div class="col-5">
<div class="row">
<div class="col-6">
<h1>Password Reset Link</h1>
<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>
</div>
</div>
</div>
{{ macros.center_column_hack() }}
{% endblock content %}

9
ordr2/templates/account/forgot_password_form.jinja2

@ -3,9 +3,8 @@ @@ -3,9 +3,8 @@
{% block title %} Ordr | Forgotten Password {% endblock title %}
{% block content %}
<div class="row justify-content-center">
<div class="col-4">
<div class="row">
<div class="col-6">
<h1>Forgotten password?</h1>
<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() }}">
@ -19,5 +18,7 @@ @@ -19,5 +18,7 @@
</div>
</form>
</div>
</div>
</div>
{{ macros.center_column_hack() }}
{% endblock content %}

7
ordr2/templates/account/login.jinja2

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

37
ordr2/templates/account/password_resetted.jinja2

@ -1,37 +0,0 @@ @@ -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 %}

11
ordr2/templates/account/register.jinja2

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

11
ordr2/templates/account/registration_completed.jinja2

@ -3,15 +3,14 @@ @@ -3,15 +3,14 @@
{% block title %} Ordr | Account Registration {% endblock title %}
{% block content %}
<div class="row">
<div class="col-2"></div>
<div class="col-5">
<div class="row">
<div class="col-6">
<h1>Account Registration Completed</h1>
<p>Thank you for verifying your email address.</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>
</div>
</div>
</div>
{{ macros.center_column_hack() }}
{% endblock content %}

11
ordr2/templates/account/registration_confirmation.jinja2

@ -3,14 +3,13 @@ @@ -3,14 +3,13 @@
{% block title %} Ordr | Account Registration {% endblock title %}
{% block content %}
<div class="row">
<div class="col-2"></div>
<div class="col-5">
<div class="row">
<div class="col-6">
<h1>Verify Your Email Address</h1>
<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>
</div>
</div>
</div>
{{ macros.center_column_hack() }}
{% endblock content %}

11
ordr2/templates/account/reset_password.jinja2

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

10
ordr2/templates/layout.jinja2

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

5
ordr2/templates/pages/faq.jinja2

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

6
ordr2/templates/pages/welcome.jinja2

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

14
ordr2/views/account.py

@ -106,8 +106,8 @@ def registration_form_processing(context, request): @@ -106,8 +106,8 @@ def registration_form_processing(context, request):
# issue a warning on a short password
if len(appstruct['password']) < PROPOSED_PASSWORD_LENGTH:
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'))
@ -171,8 +171,8 @@ def forgot_password_form_processing(context, request): @@ -171,8 +171,8 @@ def forgot_password_form_processing(context, request):
)
if not account:
request.session.flash(
'warning',
'Username or email address unknown'
'Username or email address unknown',
'error'
)
return {}
@ -234,10 +234,10 @@ def reset_password_form_processing(context, request): @@ -234,10 +234,10 @@ def reset_password_form_processing(context, request):
# issue a warning on a short password
if len(appstruct['password']) < PROPOSED_PASSWORD_LENGTH:
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'))