From 05101aca28afd4026e0b4e784c253fcfe6e841e1 Mon Sep 17 00:00:00 2001 From: frekk <frekk@ucc.asn.au> Date: Sat, 26 Jan 2019 17:54:45 +0800 Subject: [PATCH] update templates --- src/templates/base.html | 8 ++++++-- src/templates/done.html | 37 ------------------------------------- src/templates/home.html | 6 +++++- src/templates/thanks.html | 15 +++++++-------- 4 files changed, 18 insertions(+), 48 deletions(-) delete mode 100644 src/templates/done.html diff --git a/src/templates/base.html b/src/templates/base.html index 9b2a749..e152ae9 100644 --- a/src/templates/base.html +++ b/src/templates/base.html @@ -32,17 +32,21 @@ {% with url_name=request.resolver_match.url_name %} {% if request.member %} <a class="navtab {% if url_name == 'home' %}active{% endif %}" href="{% url "memberdb:home" %}">Member home</a> - {% else %} - <a class="navtab {% if url_name == 'register' %}active{% endif %}" href="{% url "memberdb:register" %}">Register</a> {% endif %} + <a class="navtab {% if url_name == 'register' %}active{% endif %}" href="{% url "memberdb:register" %}">Register</a> {% if not request.user.is_authenticated %} <a class="navtab {% if url_name == 'login' %}active{% endif %}" href="{% url "memberdb:login" %}">Login</a> {% else %} <a class="navtab {% if url_name == 'renew' %}active{% endif %}" href="{% url "memberdb:renew" %}">Renew membership</a> + {% if request.user.is_staff %} <a class="navtab {% block adminactive %}{% endblock %}" href="{% url "admin:index" %}">Admin site</a> {% endif %} + + {% endif %} + + {% if request.user.is_authenticated or request.member %} <a class="navtab {% if url_name == 'logout' %}active{% endif %}" href="{% url "memberdb:logout" %}">Logout</a> {% endif %} {% endwith %} diff --git a/src/templates/done.html b/src/templates/done.html deleted file mode 100644 index 23c3a6e..0000000 --- a/src/templates/done.html +++ /dev/null @@ -1,37 +0,0 @@ -{% extends "base.html" %} -{% load static %} - -{% block title %}UCC Payment Gateway{% endblock %} - -{% block extrahead %} -<!-- link to the SqPaymentForm library --> -<script type="text/javascript" src="https://js.squareup.com/v2/paymentform"></script> - -{# bring the location IDs into javascript so the next bits know about them #} -<script type="text/javascript"> -var applicationId = "{{ app_id }}"; -var locationId = "{{ loc_id }}"; -var amount = {{ payment.amount }}; -</script> - -<script type="text/javascript" src="{% static 'squarepay.js' %}"></script> -<link rel="stylesheet" type="text/css" href="{% static 'squarepay.css' %}"> -{% endblock %} - - -{% block content_title %}<h1>Checkout</h1>{% endblock %} -{% block content %} -<div class="form-container text-center"> - <div class="form-header"> - <span class="tips">{% block tips %}<b></b>{% endblock %}</span> - {% if payment.is_paid %}<span class="tips"> - <p><b>It appears you have already successfully attempted this payment.</b><br><br> - Note that you will not be charged twice if even you submit again.</p> - </span>{% endif %} - <noscript> - <span class="tips error">Please enable javascript to use the payment form.</span> - </noscript> - </div> -</div> -</div> -{% endblock %} diff --git a/src/templates/home.html b/src/templates/home.html index 0901a2d..5c86bb9 100644 --- a/src/templates/home.html +++ b/src/templates/home.html @@ -6,10 +6,14 @@ {% endblock %} {% block tips %} -{% if not object %} +{% if not request.member %} +{% if request.user.is_authenticated %} <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 %} +<b>Something went wrong and your membership details could not be retrieved.</b> Please try <a href="{% url 'memberdb:login' %}">logging in</a>. +{% endif %} +{% else %} You can see and modify some of your membership and account details below. {% endif %} {% endblock %} diff --git a/src/templates/thanks.html b/src/templates/thanks.html index 83648b1..a479a6c 100644 --- a/src/templates/thanks.html +++ b/src/templates/thanks.html @@ -4,19 +4,18 @@ <h1>Thanks!</h1> {% endblock %} -{% block tips %} -<b>Thanks for registering</b><br><br> -Once your registration has been approved, you will receive an email with instructions to activate your account. -{% endblock %} - {% block content %} <h3> - Go to the <a href="{% url 'memberdb:home' %}">Member Home</a> page to see and edit some of your details. + Use <a href="{{ login_url }}">this link</a> to access <i>Member Home</i> to see and edit your details, and to pay online for your membership. </h3> <p> - <b>You will continue to have access to this website during this browser session.</b> Alternatively, you can use <a href="{{ login_url }}">this link</a> to access your member details from anywhere for the next 7 days. +Once your registration has been approved, you will receive an email with instructions to activate your account. If you signed up as a student, this information will be sent to the student email address that you provided. </p> <p> - Once you receive your UCC login details, you will be able to login normally to access the site. +{% if request.user.is_authenticated %} <!-- the user is currently logged in, so they may have dispense credit --> +You can either pay online now using your existing dispense credit or using a credit/debit card by going to <a href="{{ login_url }}">Member Home</a>, or you can pay in person later. +{% else %} <!-- the user isn't logged in, but they can still pay --> +You can pay online now with a credit/debit card by going to <a href="{{ login_url }}">Member Home</a>. +{% endif %} </p> {% endblock %} -- GitLab