summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2014-04-23 16:03:29 +0000
committerMagnus Hagander2014-04-23 16:03:29 +0000
commit330e4e876049b79ed6599275e35f1849a521b388 (patch)
treefffb28376ad92446cd5ef4182caeb8fa5f6327b9
parentfc9cb67d40a349c0b0fd6a4d4fa29a81c6363564 (diff)
Include login link on all pages
On-demand login can be confusing for some...
-rw-r--r--pgcommitfest/commitfest/templates/base.html6
-rw-r--r--pgcommitfest/settings.py6
2 files changed, 11 insertions, 1 deletions
diff --git a/pgcommitfest/commitfest/templates/base.html b/pgcommitfest/commitfest/templates/base.html
index e0bcf9a..940b2bf 100644
--- a/pgcommitfest/commitfest/templates/base.html
+++ b/pgcommitfest/commitfest/templates/base.html
@@ -15,9 +15,13 @@
<li><a href="{{c.href}}">{{c.title}}</a> <span class="divider">/</span></li>
{%endfor%}
<li class="active">{{title}}</li>
+ <li class="pull-right active">
{%if user.is_authenticated%}
- <li class="pull-right active">Logged in as {{user}} (<a href="/https/git.postgresql.org/account/logout/">log out</a>{%if user.is_staff%} or access <a href="/https/git.postgresql.org/admin/">administration</a>{%endif%})</li>
+ Logged in as {{user}} (<a href="/https/git.postgresql.org/account/logout/">log out</a>{%if user.is_staff%} or access <a href="/https/git.postgresql.org/admin/">administration</a>{%endif%})
+{%else%}
+ <a href="/https/git.postgresql.org/account/login/?next={{request.path}}">Log in</a>
{%endif%}
+ </li>
</ul>
<h1>{{title}}</h1>
diff --git a/pgcommitfest/settings.py b/pgcommitfest/settings.py
index 3f7a043..5ccf8b9 100644
--- a/pgcommitfest/settings.py
+++ b/pgcommitfest/settings.py
@@ -1,4 +1,5 @@
# Django settings for pgcommitfest project.
+from django.conf import global_settings
DEBUG = False
TEMPLATE_DEBUG = DEBUG
@@ -109,6 +110,11 @@ TEMPLATE_DIRS = (
'../global_template/',
)
+
+TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
+ 'django.core.context_processors.request',
+)
+
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',