Skip to content

Commit

Permalink
component: When user login is missing, show name.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitshur committed Feb 12, 2018
1 parent aee7fee commit 8ad0f08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions component/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ type User struct {
func (u User) Render() []*html.Node {
// TODO: Make this much nicer.
// <a class="black" href="{{.HTMLURL}}"><strong>{{.Login}}</strong></a>
if u.User.Login == "" {
return []*html.Node{htmlg.Text(u.User.Name)}
}
a := &html.Node{
Type: html.ElementNode, Data: atom.A.String(),
Attr: []html.Attribute{
Expand Down

0 comments on commit 8ad0f08

Please sign in to comment.