Hide edit button when not authorized

This commit is contained in:
Eduard Urbach 2018-04-10 21:28:50 +02:00
parent 76831c469f
commit 1d658a9e76

View File

@ -11,10 +11,11 @@ component CharacterDetails(character *arn.Character, characterAnime []*arn.Anime
.character-image-container.mountable
img.character-image-fullsize(src=character.ImageLink("large"), alt=character.Name.Canonical)
.buttons
a.button(href=character.Link() + "/edit")
Icon("pencil")
span Edit character
if user != nil && (user.Role == "editor" || user.Role == "admin")
.buttons
a.button(href=character.Link() + "/edit")
Icon("pencil")
span Edit character
.character-description-container
h1.character-name.mountable= character.Name.Canonical