Updated company pages

This commit is contained in:
Eduard Urbach 2018-03-02 00:17:27 +01:00
parent 700bf089bf
commit 99379a5aa4
2 changed files with 18 additions and 9 deletions

View File

@ -40,5 +40,8 @@ func Get(ctx *aero.Context) string {
} }
ctx.Data = openGraph ctx.Data = openGraph
return ctx.HTML(components.CompanyPage(company, user))
studioAnime, producedAnime, licensedAnime := company.Anime()
return ctx.HTML(components.CompanyPage(company, studioAnime, producedAnime, licensedAnime, user))
} }

View File

@ -1,4 +1,4 @@
component CompanyPage(company *arn.Company, user *arn.User) component CompanyPage(company *arn.Company, studioAnime, producedAnime, licensedAnime []*arn.Anime, user *arn.User)
CompanyTabs(company, user) CompanyTabs(company, user)
.company-page .company-page
@ -8,12 +8,9 @@ component CompanyPage(company *arn.Company, user *arn.User)
.company-description.mountable .company-description.mountable
div!= markdown.Render(company.Description) div!= markdown.Render(company.Description)
h3.mountable Anime CompanyAnime("Animated:", studioAnime, user)
CompanyAnime("Produced:", producedAnime, user)
.company-anime.mountable CompanyAnime("Licensed:", licensedAnime, user)
each anime in company.Anime()
a.company-anime-item.ajax(href=anime.Link(), title=anime.Title.ByUser(user))
img.company-anime-item-image.lazy(data-src=anime.Image("small"), data-webp="true", alt=anime.Title.ByUser(user))
.company-sidebar .company-sidebar
if company.Location.Latitude != 0 && company.Location.Longitude != 0 if company.Location.Latitude != 0 && company.Location.Longitude != 0
@ -39,6 +36,15 @@ component CompanyPage(company *arn.Company, user *arn.User)
//- each tag in company.Tags //- each tag in company.Tags
//- li= tag //- li= tag
component CompanyAnime(label string, animes []*arn.Anime, user *arn.User)
if len(animes) > 0
h3.mountable= label
.company-anime.mountable
each anime in animes
a.company-anime-item.ajax(href=anime.Link(), title=anime.Title.ByUser(user))
img.company-anime-item-image.lazy(data-src=anime.Image("small"), data-webp="true", alt=anime.Title.ByUser(user))
component CompanyTabs(company *arn.Company, user *arn.User) component CompanyTabs(company *arn.Company, user *arn.User)
.tabs .tabs
Tab("Company", "building", company.Link()) Tab("Company", "building", company.Link())