Skip to content

Commit

Permalink
Add links and status for omniauth
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Aug 10, 2015
1 parent dc32997 commit dd1fdad
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/gollum/frontend/templates/user.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div id="user">
<p>
{{#user_authed}}
{{user_name}} | {{user_provider}} | <strong><a href="/__omnigollum__/logout">[Logout]</a></strong>
{{/user_authed}}
{{^user_authed}}
not logged in | <strong><a href="/__omnigollum__/login">[Login]</a></strong>
{{/user_authed}}
<p>
</div>
8 changes: 8 additions & 0 deletions lib/gollum/public/gollum/css/gollum.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions lib/gollum/templates/layout.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<title>{{title}}</title>
</head>
<body>
{{< user}}
{{{yield}}}
Expand Down
12 changes: 12 additions & 0 deletions lib/gollum/views/layout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 comments on commit dd1fdad

@Tony2
Copy link

@Tony2 Tony2 commented on dd1fdad Jul 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please update this to work with gollum 5?

@remyd1
Copy link

@remyd1 remyd1 commented on dd1fdad Jan 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Tony2

You can take a look at my commit here. Do not care about modifications in app.rb, unless you want to manage users permissions.

Best regards,

Please sign in to comment.