1
0
mirror of https://github.com/janLo/wallabag-kindle-consumer synced 2026-06-19 19:08:00 +00:00

Make user register work.

Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
This commit is contained in:
2018-03-21 23:50:45 +01:00
parent 57a8851a55
commit b34dc4e97f
3 changed files with 149 additions and 24 deletions
@@ -4,21 +4,19 @@
{% block body %}
{{ forms.messages(errors=errors, messages=messages) }}
<div class="card">
<div class="card-header">Add or edit an account</div>
<div class="card-body">
<form method="post">
<form method="post" action="/">
<div class="row">
{{ forms.input('user', "Username", description='Your wallabag username at ' + wallabag_host) }}
{{ forms.input('password', "Password", type='password', description='Your wallabag password at ' + wallabag_host + ". The password will not be stored") }}
{{ forms.input('username', "Username", description='Your wallabag username at ' + wallabag_host, data=data, errors=errors) }}
{{ forms.input('password', "Password", type='password', description='Your wallabag password at ' + wallabag_host + ". The password will not be stored", data=data, errors=errors) }}
</div>
<div class="row">
{{ forms.input('clientId', "Client id", description='A valid client id') }}
{{ forms.input('clientSecret', "Client secret", description='A valid client secret ' + wallabag_host) }}
</div>
<div class="row">
{{ forms.input('kindleEmail', "Kindle Email", type='email', description='Your kindle email addess ' + wallabag_host) }}
{{ forms.input('notifyEmail', "Alt. Email",type='email', description='An alternative email where we can send any problems. ' + wallabag_host) }}
{{ forms.input('kindleEmail', "Kindle Email", type='email', description='Your kindle email addess ' + wallabag_host, data=data, errors=errors) }}
{{ forms.input('notifyEmail', "Alt. Email",type='email', description='An alternative email where we can send any problems. ' + wallabag_host, data=data, errors=errors) }}
</div>
<div class="row">
<div class="col-lg">
+21 -6
View File
@@ -1,7 +1,22 @@
{% macro input(id, label, type='text', description='', placeholder='') %}
<div class="form-group col-lg">
<label for="{{ id }}">{{ label }}</label>
<input type="{{ type }}" class="form-control form-control-sm" id="{{ id }}" aria-describedby="{{ id }}Help" placeholder="{{ placeholder }}">
<small id="{{ id }}Help" class="form-text text-muted">{{ description }}</small>
</div>
{% macro input(id, label, type='text', description='', placeholder='', data={}, errors={}) %}
<div class="form-group col-lg{% if id in errors %} is-invalid{% endif %}">
<label for="{{ id }}">{{ label }}</label>
<input name="{{ id }}" type="{{ type }}"
class="form-control form-control-sm{% if id in errors %} is-invalid{% endif %}" id="{{ id }}"
aria-describedby="{{ id }}Help" placeholder="{{ placeholder }}" value="{{ data[id]|default("") }}">
<small id="{{ id }}Help" class="form-text text-muted">{{ description }}</small>
</div>
{% endmacro %}
{% macro messages(errors, messages=[]) %}
{% for msg in errors.values() %}
<div class="alert alert-danger" role="alert">
{{ msg }}
</div>
{% endfor %}
{% for msg in messages %}
<div class="alert alert-primary" role="alert">
{{ msg }}
</div>
{% endfor %}
{% endmacro %}