From dd1fdad59d9f12bfe637704c0101af96aaa1a7e4 Mon Sep 17 00:00:00 2001 From: Arran Cudbard-Bell Date: Wed, 9 May 2012 16:01:13 +0200 Subject: [PATCH] Add links and status for omniauth --- lib/gollum/frontend/templates/user.mustache | 10 ++++++++++ lib/gollum/public/gollum/css/gollum.css | 8 ++++++++ lib/gollum/templates/layout.mustache | 1 + lib/gollum/views/layout.rb | 12 ++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 lib/gollum/frontend/templates/user.mustache diff --git a/lib/gollum/frontend/templates/user.mustache b/lib/gollum/frontend/templates/user.mustache new file mode 100644 index 000000000..5d91f5708 --- /dev/null +++ b/lib/gollum/frontend/templates/user.mustache @@ -0,0 +1,10 @@ +
+

+ {{#user_authed}} + {{user_name}} | {{user_provider}} | [Logout] + {{/user_authed}} + {{^user_authed}} + not logged in | [Login] + {{/user_authed}} +

+

diff --git a/lib/gollum/public/gollum/css/gollum.css b/lib/gollum/public/gollum/css/gollum.css index cd577b788..f1d714f35 100755 --- a/lib/gollum/public/gollum/css/gollum.css +++ b/lib/gollum/public/gollum/css/gollum.css @@ -42,6 +42,14 @@ a:hover, a:visited { text-decoration: underline; } +/* @section user */ +#user p { + text-align: right; + padding-right:0.5em; + font-size: .8em; + line-height: 2.0em; + color: #999; +} /* @section head */ #head { diff --git a/lib/gollum/templates/layout.mustache b/lib/gollum/templates/layout.mustache index 3165df9b9..8adea8d04 100644 --- a/lib/gollum/templates/layout.mustache +++ b/lib/gollum/templates/layout.mustache @@ -60,6 +60,7 @@ {{title}} +{{< user}} {{{yield}}} diff --git a/lib/gollum/views/layout.rb b/lib/gollum/views/layout.rb index d6de73936..bb955f351 100644 --- a/lib/gollum/views/layout.rb +++ b/lib/gollum/views/layout.rb @@ -40,6 +40,18 @@ def js # custom js @js end + # Passthrough additional omniauth parameters for status bar + def user_authed + @user_authed + end + + def user_provider + @user.provider + end + + def user_name + @user.name + end end end end