Added tooltips to edit interface images (closes #179)

This commit is contained in:
Eduard Urbach 2018-07-08 13:20:52 +09:00
parent a2a9af3c1a
commit 7504ae84c3
2 changed files with 4 additions and 4 deletions

View File

@ -214,7 +214,7 @@ func renderStringField(b *bytes.Buffer, v *reflect.Value, field reflect.StructFi
anime, err := arn.GetAnime(animeID)
if err == nil {
b.WriteString(components.EditFormImagePreview(anime.Link(), anime.ImageLink("small"), true))
b.WriteString(components.EditFormImagePreview(anime.Link(), anime.ImageLink("small"), true, anime.Title.ByUser(nil)))
}
case "Character":
@ -222,7 +222,7 @@ func renderStringField(b *bytes.Buffer, v *reflect.Value, field reflect.StructFi
character, err := arn.GetCharacter(characterID)
if err == nil {
b.WriteString(components.EditFormImagePreview(character.Link(), character.ImageLink("medium"), false))
b.WriteString(components.EditFormImagePreview(character.Link(), character.ImageLink("medium"), true, character.Name.ByUser(nil)))
}
case "":

View File

@ -1,3 +1,3 @@
component EditFormImagePreview(link string, imageURL string, webp bool)
a(href=link, target="_blank")
component EditFormImagePreview(link string, imageURL string, webp bool, title string)
a.tip(href=link, target="_blank", aria-label=title)
img.lazy(data-src=imageURL, alt="Preview", data-webp=webp)