Redesign
This commit is contained in:
parent
7cf3c2564b
commit
5801b3f4e1
@ -14,7 +14,7 @@ component GlobalPurchaseHistory(purchases []*arn.Purchase)
|
||||
th.history-date Date
|
||||
tbody
|
||||
each purchase in purchases
|
||||
tr.shop-item.mountable(data-item-id=purchase.ItemID)
|
||||
tr.shop-history-item.mountable(data-item-id=purchase.ItemID)
|
||||
td
|
||||
a.ajax(href=purchase.User().Link())= purchase.User().Nick
|
||||
PurchaseInfo(purchase)
|
@ -10,8 +10,8 @@ import (
|
||||
"github.com/animenotifier/notify.moe/utils"
|
||||
)
|
||||
|
||||
// const maxEpisodes = 26
|
||||
// const maxEpisodesLongSeries = 5
|
||||
const maxEpisodes = 26
|
||||
const maxEpisodesLongSeries = 10
|
||||
const maxDescriptionLength = 170
|
||||
|
||||
// Get anime page.
|
||||
@ -24,16 +24,17 @@ func Get(ctx *aero.Context) string {
|
||||
return ctx.Error(http.StatusNotFound, "Anime not found", err)
|
||||
}
|
||||
|
||||
episodes := anime.Episodes().Items
|
||||
// episodesReversed := false
|
||||
|
||||
// if len(anime.Episodes().Items) > maxEpisodes {
|
||||
// episodesReversed = true
|
||||
// anime.Episodes().Items = anime.Episodes().Items[len(anime.Episodes().Items)-maxEpisodesLongSeries:]
|
||||
if len(episodes) > maxEpisodes {
|
||||
// episodesReversed = true
|
||||
episodes = episodes[len(episodes)-maxEpisodesLongSeries:]
|
||||
|
||||
// for i, j := 0, len(anime.Episodes().Items)-1; i < j; i, j = i+1, j-1 {
|
||||
// anime.Episodes().Items[i], anime.Episodes().Items[j] = anime.Episodes().Items[j], anime.Episodes().Items[i]
|
||||
// }
|
||||
// }
|
||||
for i, j := 0, len(episodes)-1; i < j; i, j = i+1, j-1 {
|
||||
episodes[i], episodes[j] = episodes[j], episodes[i]
|
||||
}
|
||||
}
|
||||
|
||||
// Friends watching
|
||||
var friends []*arn.User
|
||||
@ -113,5 +114,5 @@ func Get(ctx *aero.Context) string {
|
||||
|
||||
ctx.Data = openGraph
|
||||
|
||||
return ctx.HTML(components.Anime(anime, tracks, friends, friendsAnimeListItems, user))
|
||||
return ctx.HTML(components.Anime(anime, tracks, episodes, friends, friendsAnimeListItems, user))
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
component Anime(anime *arn.Anime, tracks []*arn.SoundTrack, friends []*arn.User, listItems map[*arn.User]*arn.AnimeListItem, user *arn.User)
|
||||
component Anime(anime *arn.Anime, tracks []*arn.SoundTrack, episodes []*arn.AnimeEpisode, friends []*arn.User, listItems map[*arn.User]*arn.AnimeListItem, user *arn.User)
|
||||
.anime
|
||||
.anime-main-column
|
||||
AnimeMainColumn(anime, tracks, user)
|
||||
AnimeMainColumn(anime, tracks, episodes, user)
|
||||
.anime-side-column
|
||||
AnimeSideColumn(anime, friends, listItems, user)
|
||||
|
||||
component AnimeMainColumn(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.User)
|
||||
component AnimeMainColumn(anime *arn.Anime, tracks []*arn.SoundTrack, episodes []*arn.AnimeEpisode, user *arn.User)
|
||||
.anime-header(data-id=anime.ID)
|
||||
if anime.Image.Large != ""
|
||||
.anime-image-container.mountable
|
||||
@ -50,6 +50,7 @@ component AnimeMainColumn(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.
|
||||
AnimeCharacters(anime)
|
||||
AnimeRelations(anime, user)
|
||||
AnimeTracks(anime, tracks)
|
||||
AnimeEpisodes(episodes)
|
||||
|
||||
//- //- h3.anime-section-name Reviews
|
||||
//- //- p Coming soon.
|
||||
|
@ -19,5 +19,5 @@ func Episodes(ctx *aero.Context) string {
|
||||
return ctx.Error(http.StatusNotFound, "Anime not found", err)
|
||||
}
|
||||
|
||||
return ctx.HTML(components.AnimeEpisodes(anime))
|
||||
return ctx.HTML(components.AnimeEpisodes(anime.Episodes().Items))
|
||||
}
|
||||
|
@ -1,27 +1,26 @@
|
||||
component AnimeEpisodes(anime *arn.Anime)
|
||||
AnimeTabs(anime)
|
||||
|
||||
h3.anime-section-name Episodes
|
||||
|
||||
table.episodes
|
||||
tbody
|
||||
each episode in anime.Episodes().Items
|
||||
tr.episode.mountable
|
||||
td.episode-number
|
||||
if episode.Number != -1
|
||||
span= episode.Number
|
||||
td.episode-title
|
||||
if episode.Title.Japanese != ""
|
||||
Japanese(episode.Title.Japanese)
|
||||
else
|
||||
span -
|
||||
td.episode-actions
|
||||
for name, link := range episode.Links
|
||||
a(href=link, target="_blank", rel="noopener", title="Watch episode " + toString(episode.Number) + " on " + name)
|
||||
RawIcon("eye")
|
||||
//- a(href="https://translate.google.com/#ja/en/" + episode.Title.Japanese, target="_blank", rel="noopener")
|
||||
//- RawIcon("google")
|
||||
if validator.IsValidDate(episode.AiringDate.Start)
|
||||
td.episode-airing-date-start.utc-airing-date(data-start-date=episode.AiringDate.Start, data-end-date=episode.AiringDate.End, data-episode-number=episode.Number)= episode.AiringDate.StartDateHuman()
|
||||
else
|
||||
td.episode-airing-date-start
|
||||
component AnimeEpisodes(episodes []*arn.AnimeEpisode)
|
||||
if len(episodes) > 0
|
||||
.anime-section
|
||||
h3.anime-section-name Episodes
|
||||
table.episodes
|
||||
tbody
|
||||
each episode in episodes
|
||||
tr.episode.mountable
|
||||
td.episode-number
|
||||
if episode.Number != -1
|
||||
span= episode.Number
|
||||
td.episode-title
|
||||
if episode.Title.Japanese != ""
|
||||
Japanese(episode.Title.Japanese)
|
||||
else
|
||||
span -
|
||||
td.episode-actions
|
||||
for name, link := range episode.Links
|
||||
a(href=link, target="_blank", rel="noopener", title="Watch episode " + toString(episode.Number) + " on " + name)
|
||||
RawIcon("eye")
|
||||
//- a(href="https://translate.google.com/#ja/en/" + episode.Title.Japanese, target="_blank", rel="noopener")
|
||||
//- RawIcon("google")
|
||||
if validator.IsValidDate(episode.AiringDate.Start)
|
||||
td.episode-airing-date-start.utc-airing-date(data-start-date=episode.AiringDate.Start, data-end-date=episode.AiringDate.End, data-episode-number=episode.Number)= episode.AiringDate.StartDateHuman()
|
||||
else
|
||||
td.episode-airing-date-start
|
@ -6,8 +6,8 @@ import (
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
)
|
||||
|
||||
const maxUsers = 6 * 6
|
||||
const maxAnime = 5 * 6
|
||||
const maxUsers = 36
|
||||
const maxAnime = 26
|
||||
const maxPosts = 3
|
||||
const maxThreads = 3
|
||||
|
||||
|
@ -2,20 +2,6 @@ component SearchResults(term string, users []*arn.User, animeResults []*arn.Anim
|
||||
h1.page-title= "Search: " + term
|
||||
|
||||
.search
|
||||
.widget
|
||||
h3.widget-title
|
||||
Icon("user")
|
||||
span Users
|
||||
|
||||
.user-avatars.user-search
|
||||
if len(users) == 0
|
||||
p.no-search-results.mountable No users found.
|
||||
else
|
||||
each user in users
|
||||
.mountable(data-mountable-type="user")
|
||||
Avatar(user)
|
||||
//- a.ajax(href=user.Link())= user.Nick
|
||||
|
||||
.widget
|
||||
h3.widget-title
|
||||
Icon("tv")
|
||||
@ -28,7 +14,7 @@ component SearchResults(term string, users []*arn.User, animeResults []*arn.Anim
|
||||
each anime in animeResults
|
||||
a.profile-watching-list-item.mountable.ajax(href=anime.Link(), title=anime.Title.Canonical, data-mountable-type="anime")
|
||||
img.anime-cover-image.anime-search-result(src=anime.Image.Tiny, alt=anime.Title.Canonical)
|
||||
|
||||
|
||||
.widget
|
||||
h3.widget-title
|
||||
Icon("comment")
|
||||
@ -58,4 +44,18 @@ component SearchResults(term string, users []*arn.User, animeResults []*arn.Anim
|
||||
Icon("music")
|
||||
span Soundtracks
|
||||
|
||||
p.no-search-results.mountable Soundtrack search coming soon.
|
||||
p.no-search-results.mountable Soundtrack search coming soon.
|
||||
|
||||
.widget
|
||||
h3.widget-title
|
||||
Icon("user")
|
||||
span Users
|
||||
|
||||
.user-avatars.user-search
|
||||
if len(users) == 0
|
||||
p.no-search-results.mountable No users found.
|
||||
else
|
||||
each user in users
|
||||
.mountable(data-mountable-type="user")
|
||||
Avatar(user)
|
||||
//- a.ajax(href=user.Link())= user.Nick
|
@ -16,7 +16,7 @@ component PurchaseHistory(purchases []*arn.Purchase, user *arn.User)
|
||||
th.history-date Date
|
||||
tbody
|
||||
each purchase in purchases
|
||||
tr.shop-item.mountable(data-item-id=purchase.ItemID)
|
||||
tr.shop-history-item.mountable(data-item-id=purchase.ItemID)
|
||||
PurchaseInfo(purchase)
|
||||
|
||||
component PurchaseInfo(purchase *arn.Purchase)
|
||||
|
@ -22,7 +22,7 @@ item-color-anime-support-ticket = hsl(217, 64%, 50%)
|
||||
display inline-block
|
||||
|
||||
// Colors
|
||||
.shop-item, .inventory-slot
|
||||
.shop-item, .inventory-slot, .shop-history-item
|
||||
[data-item-id="pro-account-3"]
|
||||
.item-icon
|
||||
color item-color-pro-account
|
||||
|
@ -269,7 +269,7 @@ export class AnimeNotifier {
|
||||
}
|
||||
|
||||
async updatePushUI() {
|
||||
if(!this.pushManager.pushSupported || !this.app.currentPath.includes("/settings")) {
|
||||
if(!this.pushManager.pushSupported || !this.app.currentPath.includes("/settings/notifications")) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,8 @@
|
||||
|
||||
#search
|
||||
background transparent
|
||||
border none
|
||||
box-shadow none
|
||||
border none !important
|
||||
box-shadow none !important
|
||||
font-size 1em
|
||||
padding 0
|
||||
width 0
|
||||
|
Loading…
Reference in New Issue
Block a user