Browse Source

changed macro for horizontal white space

master
Holger Frey 7 years ago
parent
commit
c5180a6c57
  1. 4
      ordr2/static/style.css
  2. 13
      ordr2/templates/account/forgot_password_email.jinja2
  3. 30
      ordr2/templates/account/forgot_password_form.jinja2
  4. 49
      ordr2/templates/account/login.jinja2
  5. 13
      ordr2/templates/account/register.jinja2
  6. 15
      ordr2/templates/account/registration_completed.jinja2
  7. 14
      ordr2/templates/account/registration_confirmation.jinja2
  8. 12
      ordr2/templates/account/reset_password.jinja2
  9. 9
      ordr2/templates/layout.jinja2
  10. 15
      ordr2/templates/macros.jinja2
  11. 4
      ordr2/templates/pages/faq.jinja2
  12. 4
      ordr2/templates/pages/welcome.jinja2

4
ordr2/static/style.css

@ -43,3 +43,7 @@ main h1 { @@ -43,3 +43,7 @@ main h1 {
.form-group.has-error .form-text:nth-of-type(1) {
color: #e32 !important;
}
.form-group.has-error .form-text:nth-of-type(2) {
margin-top: -20px;
}

13
ordr2/templates/account/forgot_password_email.jinja2

@ -3,13 +3,10 @@ @@ -3,13 +3,10 @@
{% block title %} Ordr | Forgotten Password {% endblock title %}
{% block content %}
<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>
{{ macros.center_column_hack() }}
<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>
{{ macros.white_space_column('col-6') }}
{% endblock content %}

30
ordr2/templates/account/forgot_password_form.jinja2

@ -3,22 +3,20 @@ @@ -3,22 +3,20 @@
{% block title %} Ordr | Forgotten Password {% endblock title %}
{% block content %}
<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() }}">
<div class="form-group">
<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">
</div>
<div class="form-group">
<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>
</div>
</form>
<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() }}">
<div class="form-group">
<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">
</div>
</div>
{{ macros.center_column_hack() }}
<div class="form-group">
<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>
</div>
</form>
{{ macros.white_space_column('col-6') }}
{% endblock content %}

49
ordr2/templates/account/login.jinja2

@ -3,34 +3,35 @@ @@ -3,34 +3,35 @@
{% block title %} Ordr | Login Failed {% endblock title %}
{% block content %}
<h1>Try again…</h1>
<p class="alert alert-danger">You entered the wrong username or password.</p>
<h1>Try again…</h1>
<p class="alert alert-danger">You entered the wrong username or 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>
<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">
<label for="username" class="control-label">Username</label>
<div>
<input name="username" id="username" type="text" class="form-control">
</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">
<label for="password" class="control-label">Password</label>
<div>
<input name="password" id="password>" type="password" class="form-control">
</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>
<div class="form-group">
<div></div>
<div>
<button type="submit" class="btn btn-sm btn-primary">Log in</button>
</div>
</form>
</div>
</form>
<p>
If you forgot your password you can <a href="{{ request.resource_url(context, 'forgot-password') }}">reset it</a>.
</p>
{{ macros.center_column_hack() }}
<p>
If you forgot your password you can <a href="{{ request.resource_url(context, 'forgot-password') }}">reset it</a>.
</p>
{{ macros.white_space_column('col-6') }}
{% endblock content %}

13
ordr2/templates/account/register.jinja2

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

15
ordr2/templates/account/registration_completed.jinja2

@ -3,14 +3,11 @@ @@ -3,14 +3,11 @@
{% block title %} Ordr | Account Registration {% endblock title %}
{% block content %}
<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>
{{ macros.center_column_hack() }}
<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>
{{ macros.white_space_column('col-6') }}
{% endblock content %}

14
ordr2/templates/account/registration_confirmation.jinja2

@ -3,13 +3,11 @@ @@ -3,13 +3,11 @@
{% block title %} Ordr | Account Registration {% endblock title %}
{% block content %}
<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>
{{ macros.center_column_hack() }}
<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>
{{ macros.white_space_column('col-6') }}
{% endblock content %}

12
ordr2/templates/account/reset_password.jinja2

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

9
ordr2/templates/layout.jinja2

@ -85,7 +85,14 @@ @@ -85,7 +85,14 @@
{% block sidebar %} {% endblock sidebar %}
</div>
<div class="col">
{{ macros.flash_messages() }}
{% for queue in ('ok', 'warning', 'error') %}
{% for message in request.session.pop_flash(queue) %}
{% set css_class = 'danger' if queue == 'error' else queue %}
<div class="alert alert-{{ css_class }} role="alert">
{{message|safe}}
</div>
{% endfor %}
{% endfor %}
{% block content %}
<p>No content</p>

15
ordr2/templates/macros.jinja2

@ -1,14 +1,3 @@ @@ -1,14 +1,3 @@
{% macro flash_messages() -%}
{% for queue in ('ok', 'warning', 'error') %}
{% for message in request.session.pop_flash(queue) %}
{% set css_class = 'danger' if queue == 'error' else queue %}
<div class="alert alert-{{ css_class }} role="alert">
{{message|safe}}
</div>
{% endfor %}
{% endfor %}
{%- endmacro %}
{% macro center_column_hack() -%}
</div><div class="col-2"></div>
{% macro white_space_column(size='col-2') -%}
</div><div class="{{ size }}">
{%- endmacro %}

4
ordr2/templates/pages/faq.jinja2

@ -68,5 +68,7 @@ @@ -68,5 +68,7 @@
</section>
</div>
</div>
{{ macros.center_column_hack() }}
{{ macros.white_space_column() }}
{% endblock content %}

4
ordr2/templates/pages/welcome.jinja2

@ -25,5 +25,7 @@ @@ -25,5 +25,7 @@
<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>
{{ macros.center_column_hack() }}
{{ macros.white_space_column() }}
{% endblock content %}