From 984ab31d3348c8261614d3ef43e10bcf065910ed Mon Sep 17 00:00:00 2001
From: Adarnof
Date: Sat, 31 Oct 2015 17:59:27 -0400
Subject: [PATCH] changed templates to reflect corp or alliance toggle created
context processors for IS_CORP, ALLIANCE_ID and ALLIANCE_NAME variables
Signed-off-by: Adarnof
---
alliance_auth/settings.py.example | 3 +++
templates/public/login.html | 9 ++++++---
templates/public/register.html | 6 +++++-
templates/registered/addapikey.html | 19 +++++++++++++------
templates/registered/corpstats.html | 6 +++++-
templates/registered/dashboard.html | 8 ++++++--
templates/registered/groups.html | 6 +++++-
templates/registered/services.html | 6 +++++-
.../registration/password_reset_complete.html | 6 +++++-
.../registration/password_reset_confirm.html | 7 +++++--
.../registration/password_reset_form.html | 6 +++++-
util/context_processors.py | 9 ++++++++-
12 files changed, 71 insertions(+), 20 deletions(-)
diff --git a/alliance_auth/settings.py.example b/alliance_auth/settings.py.example
index 9c7a6a2c..d86a64df 100755
--- a/alliance_auth/settings.py.example
+++ b/alliance_auth/settings.py.example
@@ -112,8 +112,11 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.tz',
'django.contrib.messages.context_processors.messages',
'django.core.context_processors.request',
+ 'util.context_processors.is_corp',
'util.context_processors.corp_id',
'util.context_processors.corp_name',
+ 'util.context_processors.alliance_id',
+ 'util.context_processors.alliance_name',
'util.context_processors.jabber_url',
'util.context_processors.domain_url'
)
diff --git a/templates/public/login.html b/templates/public/login.html
index 364536bb..c6e05a8f 100644
--- a/templates/public/login.html
+++ b/templates/public/login.html
@@ -10,9 +10,12 @@
-
- {{ CORP_NAME }} - Login
-
+ {% if IS_CORP %}
+ {{ CORP_NAME }} - Login
+ {% else %}
+ {{ ALLIANCE_NAME }} - Login
+ {% endif %}
+
diff --git a/templates/public/register.html b/templates/public/register.html
index d6e9a881..e61547ad 100644
--- a/templates/public/register.html
+++ b/templates/public/register.html
@@ -10,7 +10,11 @@
- {{ CORP_NAME }} - Login
+ {% if IS_CORP %}
+ {{ CORP_NAME }} - Login
+ {% else %}
+ {{ ALLIANCE_NAME }} - Login
+ {% endif %}
diff --git a/templates/registered/addapikey.html b/templates/registered/addapikey.html
index d39478c3..1f802162 100644
--- a/templates/registered/addapikey.html
+++ b/templates/registered/addapikey.html
@@ -23,12 +23,19 @@
href="https://community.eveonline.com/support/api-key/CreatePredefined?accessMask=268435455">Create
a full API key
-
-
- NOTE: If you are part of the corp do not check "Blue" this is for people who are blue to the
- corp
- but are not in it. Blue access is limited.
-
+ {% if IS_CORP %}
+
+ NOTE: If you are part of the corp do not check "Blue", this is for people who are blue to the
+ corp
+ but are not in it. Blue access is limited.
+
+ {% else %}
+
+ NOTE: If you are part of the alliance do not check "Blue", this is for people who are blue to the
+ alliance
+ but are not in it. Blue access is limited.
+
+ {% endif %}
Do not change the accessmask or deselect options or it will not work
diff --git a/templates/registered/corpstats.html b/templates/registered/corpstats.html
index b5db3f77..050dc2ee 100755
--- a/templates/registered/corpstats.html
+++ b/templates/registered/corpstats.html
@@ -67,7 +67,11 @@
{% else %}
- Not part of the corporation
+ {% if IS_CORP %}
+ You are not in the corporation.
+ {% else %}
+ You are not in the alliance.
+ {% endif %}
{% endif %}
{% endblock content %}
diff --git a/templates/registered/dashboard.html b/templates/registered/dashboard.html
index a35fa91b..8cc27ea5 100644
--- a/templates/registered/dashboard.html
+++ b/templates/registered/dashboard.html
@@ -1,6 +1,6 @@
{% extends "public/base.html" %}
{% block title %}Alliance Auth{% endblock %}
-{% block page_title %}Something something here{% endblock page_title %}
+{% block page_title %}Dashboard{% endblock page_title %}
{% block content %}
@@ -59,7 +59,11 @@
{% else %}
- Not part of the corporation
+ {% if IS_CORP %}
+ Not part of the corporation.
+ {% else %}
+ Not part of the alliance.
+ {% endif %}
{% endif %}
{% endblock content %}
diff --git a/templates/registered/groups.html b/templates/registered/groups.html
index 82f25822..49ebe67a 100644
--- a/templates/registered/groups.html
+++ b/templates/registered/groups.html
@@ -52,7 +52,11 @@
{% endfor %}
{% else %}
- You are not in the corporation
+ {% if IS_CORP %}
+ You are not in the corporation.
+ {% else %}
+ You are not in the alliance.
+ {% endif %}
{% endif %}
diff --git a/templates/registered/services.html b/templates/registered/services.html
index 90eb0fe8..81935390 100755
--- a/templates/registered/services.html
+++ b/templates/registered/services.html
@@ -300,7 +300,11 @@
{% endif %}
{% else %}
- You are not in the corporation
+ {% if IS_CORP %}
+ You are not in the corporation.
+ {% else %}
+ You are not in the alliance.
+ {% endif %}
{% endif %}
diff --git a/templates/registration/password_reset_complete.html b/templates/registration/password_reset_complete.html
index dd2d7597..0f904ed8 100644
--- a/templates/registration/password_reset_complete.html
+++ b/templates/registration/password_reset_complete.html
@@ -12,7 +12,11 @@
- {{ CORP_NAME }} - Login
+ {% if IS_CORP %}
+ {{ CORP_NAME }} - Login
+ {% else %}
+ {{ ALLIANCE_NAME }} - Login
+ {% endif %}
diff --git a/templates/registration/password_reset_confirm.html b/templates/registration/password_reset_confirm.html
index 13d5d062..14c81116 100644
--- a/templates/registration/password_reset_confirm.html
+++ b/templates/registration/password_reset_confirm.html
@@ -12,8 +12,11 @@
- {{ CORP_NAME }} - Login
-
+ {% if IS_CORP %}
+ {{ CORP_NAME }} - Login
+ {% else %}
+ {{ ALLIANCE_NAME }} - Login
+ {% endif %}
diff --git a/templates/registration/password_reset_form.html b/templates/registration/password_reset_form.html
index 1bdbc9e4..4470f79d 100644
--- a/templates/registration/password_reset_form.html
+++ b/templates/registration/password_reset_form.html
@@ -12,7 +12,11 @@
- {{ CORP_NAME }} - Login
+ {% if IS_CORP %}
+ {{ CORP_NAME }} - Login
+ {% else %}
+ {{ ALLIANCE_NAME }} - Login
+ {% endif %}
diff --git a/util/context_processors.py b/util/context_processors.py
index e20f5568..1e188065 100755
--- a/util/context_processors.py
+++ b/util/context_processors.py
@@ -2,13 +2,20 @@ from django.conf import settings
from django.utils import timezone
+def is_corp(request):
+ return {'IS_CORP': settings.IS_CORP}
+
def corp_id(request):
return {'CORP_ID': settings.CORP_ID}
-
def corp_name(request):
return {'CORP_NAME': settings.CORP_NAME}
+def alliance_id(request):
+ return {'ALLIANCE_ID': settings.ALLIANCE_ID}
+
+def alliance_name(request):
+ return {'ALLIANCE_NAME': settings.CORP_NAME}
def jabber_url(request):
return {'JABBER_URL': settings.JABBER_URL}