Use preferred title settings
This commit is contained in:
parent
d58530aafc
commit
f088a4324e
@ -1,17 +1,17 @@
|
||||
component SoundTrack(track *arn.SoundTrack)
|
||||
component SoundTrack(track *arn.SoundTrack, user *arn.User)
|
||||
.soundtrack.mountable(id=track.ID)
|
||||
SoundTrackContent(track)
|
||||
SoundTrackFooter(track)
|
||||
SoundTrackContent(track, user)
|
||||
SoundTrackFooter(track, user)
|
||||
|
||||
component SoundTrackMini(track *arn.SoundTrack)
|
||||
component SoundTrackMini(track *arn.SoundTrack, user *arn.User)
|
||||
.soundtrack.mountable(id=track.ID)
|
||||
SoundTrackContent(track)
|
||||
SoundTrackMiniFooter(track)
|
||||
SoundTrackContent(track, user)
|
||||
SoundTrackMiniFooter(track, user)
|
||||
|
||||
component SoundTrackContent(track *arn.SoundTrack)
|
||||
component SoundTrackContent(track *arn.SoundTrack, user *arn.User)
|
||||
.soundtrack-content
|
||||
if track.MainAnime() != nil
|
||||
a.soundtrack-anime-link(href="/anime/" + track.MainAnime().ID, title=track.MainAnime().Title.ByUser(nil))
|
||||
a.soundtrack-anime-link(href="/anime/" + track.MainAnime().ID, title=track.MainAnime().Title.ByUser(user))
|
||||
img.soundtrack-anime-image.lazy(data-src=track.MainAnime().ImageLink("medium"), data-webp="true", data-color=track.MainAnime().AverageColor(), alt=track.MainAnime().Title.Canonical)
|
||||
|
||||
SoundTrackMedia(track)
|
||||
@ -31,23 +31,23 @@ component SoundTrackMedia(track *arn.SoundTrack)
|
||||
else
|
||||
ExternalMedia(track.Media[0])
|
||||
|
||||
component SoundTrackFooter(track *arn.SoundTrack)
|
||||
component SoundTrackFooter(track *arn.SoundTrack, user *arn.User)
|
||||
.soundtrack-footer
|
||||
if track.Title.ByUser(nil) == ""
|
||||
if track.Title.ByUser(user) == ""
|
||||
a(href=track.Link() + "/edit") untitled
|
||||
else
|
||||
a(href=track.Link())= track.Title.ByUser(nil)
|
||||
a(href=track.Link())= track.Title.ByUser(user)
|
||||
span posted
|
||||
span.utc-date.no-tip(data-date=track.Created)
|
||||
span by
|
||||
a(href=track.Creator().Link())= track.Creator().Nick + " "
|
||||
|
||||
component SoundTrackMiniFooter(track *arn.SoundTrack)
|
||||
component SoundTrackMiniFooter(track *arn.SoundTrack, user *arn.User)
|
||||
.soundtrack-footer
|
||||
if track.Title.ByUser(nil) == ""
|
||||
if track.Title.ByUser(user) == ""
|
||||
a(href=track.Link() + "/edit") untitled
|
||||
else
|
||||
a(href=track.Link())= track.Title.ByUser(nil)
|
||||
a(href=track.Link())= track.Title.ByUser(user)
|
||||
|
||||
component ExternalMedia(media *arn.ExternalMedia)
|
||||
iframe.lazy(data-src=media.EmbedLink(), allowfullscreen="allowfullscreen")
|
@ -1,9 +1,9 @@
|
||||
component Character(character *arn.Character, user *arn.User)
|
||||
a.character(href="/character/" + character.ID)
|
||||
img.character-image-medium.lazy(data-src=character.ImageLink("medium"), data-webp="true", data-color=character.AverageColor(), alt=character.Name.Canonical)
|
||||
img.character-image-medium.lazy(data-src=character.ImageLink("medium"), data-webp="true", data-color=character.AverageColor(), alt=character.Name.ByUser(user))
|
||||
.image-title
|
||||
.image-title-text= character.Name.Canonical
|
||||
.image-title-text= character.Name.ByUser(user)
|
||||
|
||||
component CharacterSmall(character *arn.Character, user *arn.User)
|
||||
a.character.tip(href="/character/" + character.ID, aria-label=character.Name.Canonical)
|
||||
img.character-image-small.lazy(data-src=character.ImageLink("small"), data-webp="true", data-color=character.AverageColor(), alt=character.Name.Canonical)
|
||||
a.character.tip(href="/character/" + character.ID, aria-label=character.Name.ByUser(user))
|
||||
img.character-image-small.lazy(data-src=character.ImageLink("small"), data-webp="true", data-color=character.AverageColor(), alt=character.Name.ByUser(user))
|
@ -10,4 +10,4 @@ component AnimeTracks(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.User
|
||||
|
||||
.soundtracks.anime-soundtracks
|
||||
each track in tracks
|
||||
SoundTrackMini(track)
|
||||
SoundTrackMini(track, user)
|
@ -52,9 +52,10 @@ func GetEmptySearch(ctx *aero.Context) string {
|
||||
func Anime(ctx *aero.Context) string {
|
||||
term := ctx.Get("term")
|
||||
term = strings.TrimPrefix(term, "/")
|
||||
user := utils.GetUser(ctx)
|
||||
|
||||
animes := search.Anime(term, maxAnime)
|
||||
return ctx.HTML(components.AnimeSearchResults(animes))
|
||||
return ctx.HTML(components.AnimeSearchResults(animes, user))
|
||||
}
|
||||
|
||||
// Characters search.
|
||||
|
@ -8,7 +8,7 @@ component SearchResults(term string, users []*arn.User, animes []*arn.Anime, pos
|
||||
span Anime
|
||||
|
||||
#anime-search-results
|
||||
AnimeSearchResults(animes)
|
||||
AnimeSearchResults(animes, user)
|
||||
|
||||
.widget
|
||||
h3.widget-title
|
||||
@ -58,14 +58,14 @@ component SearchResults(term string, users []*arn.User, animes []*arn.Anime, pos
|
||||
#user-search-results
|
||||
UserSearchResults(users)
|
||||
|
||||
component AnimeSearchResults(animes []*arn.Anime)
|
||||
component AnimeSearchResults(animes []*arn.Anime, user *arn.User)
|
||||
if len(animes) == 0
|
||||
p.no-search-results.mountable No anime found.
|
||||
else
|
||||
.profile-watching-list.anime-search
|
||||
each anime in animes
|
||||
a.profile-watching-list-item.tip.mountable(href=anime.Link(), aria-label=anime.Title.Canonical, data-mountable-type="anime")
|
||||
img.anime-cover-image.anime-search-result.lazy(data-src=anime.ImageLink("small"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.Canonical)
|
||||
a.profile-watching-list-item.tip.mountable(href=anime.Link(), aria-label=anime.Title.ByUser(user), data-mountable-type="anime")
|
||||
img.anime-cover-image.anime-search-result.lazy(data-src=anime.ImageLink("small"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user))
|
||||
|
||||
component CharacterSearchResults(characters []*arn.Character, user *arn.User)
|
||||
if len(characters) == 0
|
||||
|
@ -23,7 +23,7 @@ component SoundTracks(tracks []*arn.SoundTrack, nextIndex int, tag string, user
|
||||
|
||||
component SoundTracksScrollable(tracks []*arn.SoundTrack, user *arn.User)
|
||||
each track in tracks
|
||||
SoundTrack(track)
|
||||
SoundTrack(track, user)
|
||||
|
||||
component SoundTracksTabs(tag string)
|
||||
.tab-groups
|
||||
|
Loading…
Reference in New Issue
Block a user