71 lines
2.7 KiB
Plaintext

component CompanyPage(company *arn.Company, studioAnime, producedAnime, licensedAnime []*arn.Anime, closeCompanies []*arn.Company, distances map[string]float64, user *arn.User)
CompanyTabs(company, user)
.company-page
.company-header
h1.company-name.mountable= company.Name.English
.company-description.mountable
div!= markdown.Render(company.Description)
CompanyAnimes("Animated:", studioAnime, user)
CompanyAnimes("Produced:", producedAnime, user)
CompanyAnimes("Licensed:", licensedAnime, user)
.company-sidebar
if company.Location.Latitude != 0 && company.Location.Longitude != 0
h3.mountable Location
iframe.company-location.mountable(src="https://www.google.com/maps/embed/v1/place?q=" + toString(company.Location.Latitude) + "," + toString(company.Location.Longitude) + "&key=AIzaSyAsx6fhqRGaMLTixIJMIZBU4Mg6HJmvQf0")
if len(company.Links) > 0
h3.mountable Links
ul.mountable
each link in company.Links
li.mountable(data-mountable-type="company-link")
a(href=link.URL, target="_blank", rel="noopener")= link.Title
if len(closeCompanies) > 0
h3.mountable Within 1 km radius
ul.mountable
each closeCompany in closeCompanies
li.mountable(data-mountable-type="close-company")
a(href=closeCompany.Link())= closeCompany.Name.English
span.company-distance= fmt.Sprintf(" - %.0f m", distances[closeCompany.ID] * 1000)
//- if len(company.Name.Synonyms) > 0
//- h3 Synonyms
//- ul
//- each synonym in company.Name.Synonyms
//- li= synonym
//- if len(company.Tags) > 0
//- h3 Tags
//- ul
//- each tag in company.Tags
//- li= tag
component CompanyAnimes(label string, animes []*arn.Anime, user *arn.User)
if len(animes) > 0
if label != ""
h3.mountable= label
.company-anime.mountable
each anime in animes
CompanyAnime(anime, user)
component CompanyAnime(anime *arn.Anime, user *arn.User)
a.company-anime-item.tip(href=anime.Link(), aria-label=anime.Title.ByUser(user))
img.company-anime-item-image.lazy(data-src=anime.ImageLink("small"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user))
component CompanyAnimeNoTip(anime *arn.Anime, user *arn.User)
a.company-anime-item(href=anime.Link(), title=anime.Title.ByUser(user))
img.company-anime-item-image.lazy(data-src=anime.ImageLink("small"), data-webp="true", data-color=anime.AverageColor(), alt=anime.Title.ByUser(user))
component CompanyTabs(company *arn.Company, user *arn.User)
.tabs
Tab("Company", "building", company.Link())
if user != nil
Tab("Edit", "pencil", company.Link() + "/edit")
Tab("History", "history", company.Link() + "/history")