2017-06-28 13:42:38 +02:00
{{ import "csrf" }}
{{block badge_user()}}
< div class = "h-user" >
2017-07-24 07:03:43 +02:00
{{if User.ID > 0 }}
< button href = "#" class = "nav-btn" >
< div class = "user-avatar small" >
< img src = "https://www.gravatar.com/avatar/{{ User.MD5 }}?s=50" / >
2017-10-29 01:22:14 +02:00
{{if User.GetUnreadNotifications() > 0}}< span > {{User.GetUnreadNotifications()}}< / span > {{end}}
2017-07-24 07:03:43 +02:00
< / div >
< span class = "user-info" title = "{{ User.Username}}" >
< span class = "hide-md" > {{User.Username}}< / span >
< / span >
< / button >
< div class = "user-menu" >
< a class = "nav-btn" href = "/user/{{ User.ID }}/{{ User.Username }}" > {{ T("profile")}}< / a >
2017-08-14 07:37:37 +02:00
< a class = "nav-btn notif" href = "/notifications" >
2017-07-24 07:03:43 +02:00
{{ T("my_notifications")}}
2017-08-14 07:37:37 +02:00
{{if User.GetUnreadNotifications() > 0}}< span class = "badge" > ({{ User.GetUnreadNotifications() }})< / span > {{end}}
2017-07-24 07:03:43 +02:00
< / a >
< a class = "nav-btn" href = "/user/{{ User.ID }}/{{ User.Username }}/edit" >
{{ T("settings")}}
< / a >
{{if User.HasAdmin()}}
< a class = "nav-btn" href = "/mod" > {{ T("moderation")}}< / a >
{{end}}
< form action = "/logout" method = "POST" >
{{ yield csrf_field() }}
< input type = "hidden" value = "{{ URL.String() }}" name = "redirectTo" / >
2017-07-28 05:46:40 +02:00
< input class = "nav-btn" type = "submit" name = "logout" value = "{{ T(" sign_out " ) } } " / >
2017-07-24 07:03:43 +02:00
< / form >
< / div >
{{ else }}
2017-08-12 09:20:47 +02:00
< a href = "/login?redirectTo={{ URL.String() }}" class = "nav-btn log-in" style = "width:auto;" title = "{{ T(" signin " ) } } " >
< div class = "icon-user" > < / div >
2017-08-03 22:07:42 +02:00
< span > {{ T("signin") }}< / span >
2017-07-24 07:03:43 +02:00
< / a > {{end}}
2017-06-28 13:42:38 +02:00
< / div >
{{end}}