From 7233f19b35fd8b8b70d50ebec004fc3c0e45eef9 Mon Sep 17 00:00:00 2001 From: frekk <frekk@ucc.asn.au> Date: Mon, 31 Dec 2018 00:58:59 +0800 Subject: [PATCH] make styling less awful and rejiggle templates --- gms/memberdb/static/main.css | 21 ++++++++++++++++----- gms/memberdb/static/shared.css | 27 +++++++++++++++++++++++++++ gms/memberdb/templates/base.html | 10 ++++++++-- gms/memberdb/templates/home.html | 14 +++++++++----- gms/memberdb/templates/login.html | 2 ++ gms/memberdb/templates/register.html | 8 ++++++-- gms/memberdb/templates/renew.html | 2 +- 7 files changed, 69 insertions(+), 15 deletions(-) diff --git a/gms/memberdb/static/main.css b/gms/memberdb/static/main.css index fc1d591..7c4859e 100644 --- a/gms/memberdb/static/main.css +++ b/gms/memberdb/static/main.css @@ -5,7 +5,7 @@ html { body { min-height: 100%; position: relative; - background-color: yellow; + background-color: #f8f8f8; font-family: Arial, Helvetica, sans-serif; margin: 0; } @@ -28,16 +28,27 @@ body { .form-container { background-color: #ffe; - border-style: 2px solid #8fc; + border: 2px solid #8fc; border-radius: 5px; padding: 20px; margin: 10px; } -.form-container .tips { - margin: 10px 10px 20px 10px; - color: #555; +.form-header { + text-align: center; + padding: 10px 10px 20px 10px; +} + +.form-header .tips { + color: #333; + font-weight: 400; + font-size: 17px; + border-radius: 10px; + background-color: #feb; + padding: 10px 10px 7px 10px; + display: inline-block; text-align: center; + line-height: 23px; } fieldset { diff --git a/gms/memberdb/static/shared.css b/gms/memberdb/static/shared.css index 9f88c34..dd85939 100644 --- a/gms/memberdb/static/shared.css +++ b/gms/memberdb/static/shared.css @@ -12,6 +12,33 @@ background-size: cover; } +/* MESSAGES & ERRORS */ +ul.messagelist { + padding: 0; + margin: 0; +} + +ul.messagelist li { + display: block; + font-weight: 400; + font-size: 13px; + padding: 10px 10px 10px 65px; + margin: 0 0 10px 0; + background: #dfd url(../img/icon-yes.svg) 40px 12px no-repeat; + background-size: 16px auto; + color: #333; +} + +ul.messagelist li.warning { + background: #ffc url(../img/icon-alert.svg) 40px 14px no-repeat; + background-size: 14px auto; +} + +ul.messagelist li.error { + background: #ffefef url(../img/icon-no.svg) 40px 12px no-repeat; + background-size: 16px auto; +} + .errornote { font-size: 14px; font-weight: 700; diff --git a/gms/memberdb/templates/base.html b/gms/memberdb/templates/base.html index af9bae8..3a26676 100644 --- a/gms/memberdb/templates/base.html +++ b/gms/memberdb/templates/base.html @@ -17,8 +17,6 @@ <!-- Header --> <div id="header"> - {% block header %}{% endblock %} - {% block navbar %} <nav> {% block branding %} @@ -41,6 +39,14 @@ {% endwith %} </nav> {% endblock %} + + {% block header %}{% endblock %} + + {% block messages %}{% if messages %} + <ul class="messagelist">{% for message in messages %} + <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message|capfirst }}</li> + {% endfor %}</ul> + {% endif %}{% endblock messages %} </div> <!-- END Header --> diff --git a/gms/memberdb/templates/home.html b/gms/memberdb/templates/home.html index 2336bfe..86f4520 100644 --- a/gms/memberdb/templates/home.html +++ b/gms/memberdb/templates/home.html @@ -6,10 +6,10 @@ {% block tips %} {% if not object %} -<b>Your account exists already but no membership information has yet been recorded in this system.</b> -<br>Please update/correct the details below as necessary. +<b>You have no member record associated with this account.</b><br> +Please <a href="{% url 'memberdb:renew' %}">renew your membership</a> to get started. {% else %} -Please confirm that the details below have not changed since your last registration or membership renewal. +You can see and modify some of your membership and account details below. {% endif %} {% endblock %} @@ -20,6 +20,10 @@ Please confirm that the details below have not changed since your last registrat </div> {% endblock %} -{% block action_url %}{% url 'memberdb:renew' %}{% endblock %} +{% block form %} +{% if object %} {{ block.super }} {% endif %} +{% endblock %} + +{% block action_url %}{% url 'memberdb:home' %}{% endblock %} -{% block action_text %}Renew{% endblock %} \ No newline at end of file +{% block action_text %}Update details{% endblock %} \ No newline at end of file diff --git a/gms/memberdb/templates/login.html b/gms/memberdb/templates/login.html index 3c2519a..e07df3b 100644 --- a/gms/memberdb/templates/login.html +++ b/gms/memberdb/templates/login.html @@ -15,6 +15,7 @@ <div class="form-container"> +<div class="form-header"> {% if form.errors and not form.non_field_errors %} <p class="errornote"> {% if form.errors.items|length == 1 %}Please correct the error below.{% else %}Please correct the errors below.{% endif %} @@ -39,6 +40,7 @@ If you do not have a UCC account yet, please apply for a membership by going to the <a href="{% url 'memberdb:register' %}">registration page</a>. {% endif %} </p> +</div> <form action="{% url 'memberdb:login' %}" method="post" id="login-form"> {% csrf_token %} diff --git a/gms/memberdb/templates/register.html b/gms/memberdb/templates/register.html index a18b87d..1aa7b76 100644 --- a/gms/memberdb/templates/register.html +++ b/gms/memberdb/templates/register.html @@ -6,12 +6,15 @@ {% block content %} <div class="form-container"> - <p class="tips"> + <div class="form-header"> + <span class="tips"> {% block tips %} Enter your details, and press "Register" when you are done.<br> Once your membership has been approved, you will receive an email with further instructions to activate your account. {% endblock %} - </p> + </span> + </div> + {% block form %} <form action="{% block action_url %}{% url 'memberdb:register' %}{% endblock %}" method="post"> {% csrf_token %} @@ -41,5 +44,6 @@ <input type="submit" class="default" value="{% block action_text %}Register{% endblock %}"> </div> </form> + {% endblock %} </div> {% endblock %} \ No newline at end of file diff --git a/gms/memberdb/templates/renew.html b/gms/memberdb/templates/renew.html index 1e6077f..8767da4 100644 --- a/gms/memberdb/templates/renew.html +++ b/gms/memberdb/templates/renew.html @@ -7,7 +7,7 @@ {% block tips %} {% if is_new %} <b>Your account exists already but no membership information has yet been recorded in this system.</b> -<br>Please update/correct the details below as necessary. +<br>Please update/correct the details below as necessary. Some have probably been filled for you. {% else %} Please confirm that the details below have not changed since your last registration or membership renewal. {% endif %} -- GitLab