This commit is contained in:
Eduard Urbach 2017-11-05 09:32:46 +01:00
parent 7cf3c2564b
commit 5801b3f4e1
11 changed files with 66 additions and 65 deletions

View File

@ -14,7 +14,7 @@ component GlobalPurchaseHistory(purchases []*arn.Purchase)
th.history-date Date th.history-date Date
tbody tbody
each purchase in purchases each purchase in purchases
tr.shop-item.mountable(data-item-id=purchase.ItemID) tr.shop-history-item.mountable(data-item-id=purchase.ItemID)
td td
a.ajax(href=purchase.User().Link())= purchase.User().Nick a.ajax(href=purchase.User().Link())= purchase.User().Nick
PurchaseInfo(purchase) PurchaseInfo(purchase)

View File

@ -10,8 +10,8 @@ import (
"github.com/animenotifier/notify.moe/utils" "github.com/animenotifier/notify.moe/utils"
) )
// const maxEpisodes = 26 const maxEpisodes = 26
// const maxEpisodesLongSeries = 5 const maxEpisodesLongSeries = 10
const maxDescriptionLength = 170 const maxDescriptionLength = 170
// Get anime page. // Get anime page.
@ -24,16 +24,17 @@ func Get(ctx *aero.Context) string {
return ctx.Error(http.StatusNotFound, "Anime not found", err) return ctx.Error(http.StatusNotFound, "Anime not found", err)
} }
episodes := anime.Episodes().Items
// episodesReversed := false // episodesReversed := false
// if len(anime.Episodes().Items) > maxEpisodes { if len(episodes) > maxEpisodes {
// episodesReversed = true // episodesReversed = true
// anime.Episodes().Items = anime.Episodes().Items[len(anime.Episodes().Items)-maxEpisodesLongSeries:] episodes = episodes[len(episodes)-maxEpisodesLongSeries:]
// for i, j := 0, len(anime.Episodes().Items)-1; i < j; i, j = i+1, j-1 { for i, j := 0, len(episodes)-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] episodes[i], episodes[j] = episodes[j], episodes[i]
// } }
// } }
// Friends watching // Friends watching
var friends []*arn.User var friends []*arn.User
@ -113,5 +114,5 @@ func Get(ctx *aero.Context) string {
ctx.Data = openGraph ctx.Data = openGraph
return ctx.HTML(components.Anime(anime, tracks, friends, friendsAnimeListItems, user)) return ctx.HTML(components.Anime(anime, tracks, episodes, friends, friendsAnimeListItems, user))
} }

View File

@ -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
.anime-main-column .anime-main-column
AnimeMainColumn(anime, tracks, user) AnimeMainColumn(anime, tracks, episodes, user)
.anime-side-column .anime-side-column
AnimeSideColumn(anime, friends, listItems, user) 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) .anime-header(data-id=anime.ID)
if anime.Image.Large != "" if anime.Image.Large != ""
.anime-image-container.mountable .anime-image-container.mountable
@ -50,6 +50,7 @@ component AnimeMainColumn(anime *arn.Anime, tracks []*arn.SoundTrack, user *arn.
AnimeCharacters(anime) AnimeCharacters(anime)
AnimeRelations(anime, user) AnimeRelations(anime, user)
AnimeTracks(anime, tracks) AnimeTracks(anime, tracks)
AnimeEpisodes(episodes)
//- //- h3.anime-section-name Reviews //- //- h3.anime-section-name Reviews
//- //- p Coming soon. //- //- p Coming soon.

View File

@ -19,5 +19,5 @@ func Episodes(ctx *aero.Context) string {
return ctx.Error(http.StatusNotFound, "Anime not found", err) return ctx.Error(http.StatusNotFound, "Anime not found", err)
} }
return ctx.HTML(components.AnimeEpisodes(anime)) return ctx.HTML(components.AnimeEpisodes(anime.Episodes().Items))
} }

View File

@ -1,11 +1,10 @@
component AnimeEpisodes(anime *arn.Anime) component AnimeEpisodes(episodes []*arn.AnimeEpisode)
AnimeTabs(anime) if len(episodes) > 0
.anime-section
h3.anime-section-name Episodes h3.anime-section-name Episodes
table.episodes table.episodes
tbody tbody
each episode in anime.Episodes().Items each episode in episodes
tr.episode.mountable tr.episode.mountable
td.episode-number td.episode-number
if episode.Number != -1 if episode.Number != -1

View File

@ -6,8 +6,8 @@ import (
"github.com/animenotifier/notify.moe/components" "github.com/animenotifier/notify.moe/components"
) )
const maxUsers = 6 * 6 const maxUsers = 36
const maxAnime = 5 * 6 const maxAnime = 26
const maxPosts = 3 const maxPosts = 3
const maxThreads = 3 const maxThreads = 3

View File

@ -2,20 +2,6 @@ component SearchResults(term string, users []*arn.User, animeResults []*arn.Anim
h1.page-title= "Search: " + term h1.page-title= "Search: " + term
.search .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 .widget
h3.widget-title h3.widget-title
Icon("tv") Icon("tv")
@ -59,3 +45,17 @@ component SearchResults(term string, users []*arn.User, animeResults []*arn.Anim
span Soundtracks 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

View File

@ -16,7 +16,7 @@ component PurchaseHistory(purchases []*arn.Purchase, user *arn.User)
th.history-date Date th.history-date Date
tbody tbody
each purchase in purchases 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) PurchaseInfo(purchase)
component PurchaseInfo(purchase *arn.Purchase) component PurchaseInfo(purchase *arn.Purchase)

View File

@ -22,7 +22,7 @@ item-color-anime-support-ticket = hsl(217, 64%, 50%)
display inline-block display inline-block
// Colors // Colors
.shop-item, .inventory-slot .shop-item, .inventory-slot, .shop-history-item
[data-item-id="pro-account-3"] [data-item-id="pro-account-3"]
.item-icon .item-icon
color item-color-pro-account color item-color-pro-account

View File

@ -269,7 +269,7 @@ export class AnimeNotifier {
} }
async updatePushUI() { async updatePushUI() {
if(!this.pushManager.pushSupported || !this.app.currentPath.includes("/settings")) { if(!this.pushManager.pushSupported || !this.app.currentPath.includes("/settings/notifications")) {
return return
} }

View File

@ -43,8 +43,8 @@
#search #search
background transparent background transparent
border none border none !important
box-shadow none box-shadow none !important
font-size 1em font-size 1em
padding 0 padding 0
width 0 width 0