This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
The following commit(s) were added to refs/heads/master by this push:
new 069baca Allow configuring an icon for auth options
069baca is described below
commit 069baca05ae48b6979a73db8348cbd28283896b1
Author: Marcus Christie <[email protected]>
AuthorDate: Fri Jul 26 11:53:55 2019 -0400
Allow configuring an icon for auth options
---
.../django_airavata_auth/partials/externals_login_form.html | 5 +++++
.../django_airavata_auth/partials/username_password_login_form.html | 5 +++++
django_airavata/settings.py | 4 ++++
3 files changed, 14 insertions(+)
diff --git
a/django_airavata/apps/auth/templates/django_airavata_auth/partials/externals_login_form.html
b/django_airavata/apps/auth/templates/django_airavata_auth/partials/externals_login_form.html
index c28cb3b..0548481 100644
---
a/django_airavata/apps/auth/templates/django_airavata_auth/partials/externals_login_form.html
+++
b/django_airavata/apps/auth/templates/django_airavata_auth/partials/externals_login_form.html
@@ -1,3 +1,5 @@
+{% load static %}
+
<div class="row">
<div class="col">
<div class="card">
@@ -11,6 +13,9 @@
href="{% url 'django_airavata_auth:redirect_login'
external.idp_alias %}"
{% endif %}
class="btn btn-primary btn-block mt-3">
+ {% if external.logo %}
+ <img src="{% static external.logo %}"/>
+ {% endif %}
Sign in with {{ external.name }}
</a>
{% endfor %}
diff --git
a/django_airavata/apps/auth/templates/django_airavata_auth/partials/username_password_login_form.html
b/django_airavata/apps/auth/templates/django_airavata_auth/partials/username_password_login_form.html
index 27e4394..70c89ae 100644
---
a/django_airavata/apps/auth/templates/django_airavata_auth/partials/username_password_login_form.html
+++
b/django_airavata/apps/auth/templates/django_airavata_auth/partials/username_password_login_form.html
@@ -1,3 +1,5 @@
+{% load static %}
+
<div class="row">
<div class="col">
<div class="card">
@@ -22,6 +24,9 @@
<input type="hidden" name="login_type" value="{{
login_type }}"/>
{% endif %}
<button type="submit" class="btn btn-primary btn-block">
+ {% if options.password.logo %}
+ <img src="{% static options.password.logo %}"/>
+ {% endif %}
Sign in with {{ options.password.name|default:"a
username and password" }}
</button>
</form>
diff --git a/django_airavata/settings.py b/django_airavata/settings.py
index 07e07fd..bb5ab3f 100644
--- a/django_airavata/settings.py
+++ b/django_airavata/settings.py
@@ -253,12 +253,16 @@ AUTHENTICATION_OPTIONS = {
# Control whether username/password authentication is allowed
'password': {
'name': 'your account',
+ # Static path to image
+ # 'logo': '/static/path/to/image'
},
# Can have multiple external logins
# 'external': [
# {
# 'idp_alias': 'cilogon',
# 'name': 'CILogon',
+ # # Static path to image
+ # 'logo': 'path/to/image'
# }
# ]
}