Polish up admin messages

This commit is contained in:
Andy Teijelo Pérez 2015-11-08 17:17:04 -05:00
parent 932c6929c4
commit d5fa80675f
2 changed files with 7 additions and 3 deletions

View file

@ -178,7 +178,9 @@ def admin():
if pass1 is None or \ if pass1 is None or \
pass2 is None or \ pass2 is None or \
pass1 != pass2: pass1 != pass2:
return render_template("admin.html", create_error=True, errormsg="Password do not match") return render_template("admin.html", create_error=True, errormsg="Passwords do not match")
if pass1 == '':
return render_template("admin.html", create_error=True, errormsg="Password cannot be empty")
create_user(username,pass1,creator) create_user(username,pass1,creator)
flash("User created successfully") flash("User created successfully")

View file

@ -12,7 +12,9 @@
{% if messages %} {% if messages %}
<ul class=flashes> <ul class=flashes>
{% for message in messages %} {% for message in messages %}
<li>{{ message }}</li> <div class="alert alert-info">
{{ message }}
</div>
{% endfor %} {% endfor %}
</ul> </ul>
{% endif %} {% endif %}
@ -42,7 +44,7 @@
</div> </div>
{% if create_error %} {% if create_error %}
<center> <center>
<p>Error: {{ errormsg }}</p> <div class="col-sm-offset-2 col-sm-10 alert alert-danger">{{ errormsg }}</div>
</center> </center>
{% endif %} {% endif %}
<div class="form-group"> <div class="form-group">