Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/templates/_badgemenu.html
Steindór 4f11748da1 Header fixes (#863)
* Put the mascot into the cookie as well, major js cleanup

* Update en-us.all.json

* removed redundant translation

* made the dropdown menu look and function better

* fixed responsiveness issue

* made this look better with the /g/ theme
2017-06-01 08:37:27 +10:00

23 lignes
1,1 Kio
HTML

{{define "badge_user"}}
{{with .User}}
<div class="h-user">
{{if gt .ID 0}}
<button href="#" class="nav-btn">
<div class="user-avatar small"><img src="https://www.gravatar.com/avatar/{{ .MD5 }}?s=50"></div>
<span class="user-info" title="{{.Username}}"><span class="hide-md">{{.Username}}</span></span>
</button>
<div class="user-menu">
<a class="nav-btn" href="{{ genRoute "user_profile" "id" (print .ID) "username" .Username }}">{{call $.T "profile"}}</a>
<a class="nav-btn" href="{{ genRoute "user_notifications" }}">{{ call $.T "my_notifications"}} <span class="badge">{{ .GetUnreadNotifications }}</span></a>
<a class="nav-btn" href="{{ genRoute "user_profile_edit" "id" (print .ID) "username" .Username }}">{{call $.T "settings"}}</a>
{{if HasAdmin . }}<a class="nav-btn" href="{{ genRoute "mod_index" }}">{{call $.T "moderation"}}</a>{{end}}
<a class="nav-btn" href="{{ genRoute "user_logout" }}">{{ call $.T "sign_out"}}</a></li>
</div>
{{ else }}
<a href="{{ genRoute "user_login" }}" class="nav-btn">
{{ call $.T "signin" }}<span class="caret"></span>
</a>
{{end}}
</div>
{{end}}
{{end}}