diff --git a/rest/compton_data/product_properties.go b/rest/compton_data/product_properties.go index 5fc7fa46..43464705 100644 --- a/rest/compton_data/product_properties.go +++ b/rest/compton_data/product_properties.go @@ -5,19 +5,12 @@ import ( ) var ProductProperties = []string{ - vangogh_local_data.TitleProperty, - - vangogh_local_data.DehydratedImageProperty, - vangogh_local_data.ImageProperty, - vangogh_local_data.ProductTypeProperty, vangogh_local_data.TagIdProperty, vangogh_local_data.LocalTagsProperty, vangogh_local_data.WishlistedProperty, - vangogh_local_data.DiscountPercentageProperty, vangogh_local_data.PriceProperty, - vangogh_local_data.BasePriceProperty, vangogh_local_data.OperatingSystemsProperty, vangogh_local_data.HLTBPlatformsProperty, vangogh_local_data.RatingProperty, @@ -45,31 +38,9 @@ var ProductProperties = []string{ vangogh_local_data.RequiresGamesProperty, vangogh_local_data.IsRequiredByGamesProperty, - vangogh_local_data.StoreUrlProperty, - vangogh_local_data.ForumUrlProperty, - vangogh_local_data.SupportUrlProperty, - vangogh_local_data.SteamAppIdProperty, - vangogh_local_data.PCGWPageIdProperty, - vangogh_local_data.HLTBIdProperty, - vangogh_local_data.IGDBIdProperty, - vangogh_local_data.StrategyWikiIdProperty, - vangogh_local_data.MobyGamesIdProperty, - vangogh_local_data.WikipediaIdProperty, - vangogh_local_data.WineHQIdProperty, - vangogh_local_data.VNDBIdProperty, - vangogh_local_data.IGNWikiSlugProperty, - vangogh_local_data.HLTBHoursToCompleteMainProperty, vangogh_local_data.HLTBHoursToCompletePlusProperty, vangogh_local_data.HLTBHoursToComplete100Property, - - vangogh_local_data.OwnedProperty, - vangogh_local_data.IsFreeProperty, - vangogh_local_data.IsDiscountedProperty, - vangogh_local_data.PreOrderProperty, - vangogh_local_data.ComingSoonProperty, - vangogh_local_data.InDevelopmentProperty, - vangogh_local_data.ValidationResultProperty, } var ProductExternalLinksProperties = []string{ @@ -77,33 +48,3 @@ var ProductExternalLinksProperties = []string{ GauginSteamLinksProperty, GauginOtherLinksProperty, } - -var ProductHiddenProperties = []string{ - vangogh_local_data.TitleProperty, - vangogh_local_data.DehydratedImageProperty, - vangogh_local_data.ImageProperty, - vangogh_local_data.OwnedProperty, - vangogh_local_data.ValidationResultProperty, - vangogh_local_data.ProductTypeProperty, - vangogh_local_data.ComingSoonProperty, - vangogh_local_data.PreOrderProperty, - vangogh_local_data.InDevelopmentProperty, - vangogh_local_data.IsFreeProperty, - vangogh_local_data.IsDiscountedProperty, - vangogh_local_data.BasePriceProperty, - vangogh_local_data.DiscountPercentageProperty, - vangogh_local_data.ValidationResultProperty, - vangogh_local_data.StoreUrlProperty, - vangogh_local_data.ForumUrlProperty, - vangogh_local_data.SupportUrlProperty, - vangogh_local_data.SteamAppIdProperty, - vangogh_local_data.PCGWPageIdProperty, - vangogh_local_data.HLTBIdProperty, - vangogh_local_data.IGDBIdProperty, - vangogh_local_data.StrategyWikiIdProperty, - vangogh_local_data.MobyGamesIdProperty, - vangogh_local_data.WikipediaIdProperty, - vangogh_local_data.WineHQIdProperty, - vangogh_local_data.VNDBIdProperty, - vangogh_local_data.IGNWikiSlugProperty, -} diff --git a/rest/compton_data/section_styles.go b/rest/compton_data/section_styles.go index 6814b9fb..8e191d0c 100644 --- a/rest/compton_data/section_styles.go +++ b/rest/compton_data/section_styles.go @@ -10,5 +10,5 @@ var SectionStyles = map[string]string{ SteamNewsSection: "steam-news.css", SteamReviewsSection: "steam-reviews.css", SteamDeckSection: "steam-deck.css", - DownloadsSection: "downloads.css", + DownloadsSection: "", } diff --git a/rest/compton_data/section_titles.go b/rest/compton_data/section_titles.go index fb1bb808..0f31999a 100644 --- a/rest/compton_data/section_titles.go +++ b/rest/compton_data/section_titles.go @@ -1,16 +1,16 @@ package compton_data const ( - ChangelogSection = "changelog" - DescriptionSection = "description" - DownloadsSection = "downloads" - ExternalLinksSection = "links" PropertiesSection = "properties" + ExternalLinksSection = "links" + DescriptionSection = "description" + ChangelogSection = "changelog" ScreenshotsSection = "screenshots" + VideosSection = "videos" SteamNewsSection = "steam-news" SteamReviewsSection = "steam-reviews" SteamDeckSection = "steam-deck" - VideosSection = "videos" + DownloadsSection = "downloads" ) var SectionTitles = map[string]string{ @@ -25,16 +25,3 @@ var SectionTitles = map[string]string{ SteamDeckSection: "Steam Deck", VideosSection: "Videos", } - -var SectionsTitlesOrder = []string{ - SectionTitles[PropertiesSection], - SectionTitles[ExternalLinksSection], - SectionTitles[DescriptionSection], - SectionTitles[ChangelogSection], - SectionTitles[ScreenshotsSection], - SectionTitles[VideosSection], - SectionTitles[SteamNewsSection], - SectionTitles[SteamReviewsSection], - SectionTitles[SteamDeckSection], - SectionTitles[DownloadsSection], -} diff --git a/rest/compton_fragments/product_properties.go b/rest/compton_fragments/product_properties.go index eba6c818..567037e4 100644 --- a/rest/compton_fragments/product_properties.go +++ b/rest/compton_fragments/product_properties.go @@ -26,9 +26,6 @@ func ProductProperties(r compton.Registrar, id string, rdx kevlar.ReadableRedux) grid := compton.GridItems(r).JustifyContent(align.Center) for _, property := range compton_data.ProductProperties { - if slices.Contains(compton_data.ProductHiddenProperties, property) { - continue - } if property == vangogh_local_data.OperatingSystemsProperty { if tv := operatingSystemsTitleValues(r, id, rdx); tv != nil { diff --git a/rest/compton_pages/downloads.go b/rest/compton_pages/downloads.go index 81a229b0..ff3d54ea 100644 --- a/rest/compton_pages/downloads.go +++ b/rest/compton_pages/downloads.go @@ -35,6 +35,13 @@ var downloadTypesStrings = map[vangogh_local_data.DownloadType]string{ vangogh_local_data.Movie: "Movie", } +var downloadTypesColors = map[vangogh_local_data.DownloadType]color.Color{ + vangogh_local_data.Installer: color.Purple, + vangogh_local_data.DLC: color.Indigo, + vangogh_local_data.Extra: color.Orange, + vangogh_local_data.Movie: color.Red, +} + // Downloads will present available installers, DLCs in the following hierarchy: // - Operating system heading - Installers and DLCs (separately) // - title_values list of downloads by version @@ -161,7 +168,7 @@ func operatingSystemHeading(r compton.Registrar, os vangogh_local_data.Operating func downloadVariant(r compton.Registrar, dv *DownloadVariant) compton.Element { fr := compton.Frow(r). - Icon(dv.dlType.String()). + IconColor(downloadTypesColors[dv.dlType]). Heading(downloadTypesStrings[dv.dlType]) if dv.langCode != "" { diff --git a/rest/compton_pages/product.go b/rest/compton_pages/product.go index 0259de54..f243fc32 100644 --- a/rest/compton_pages/product.go +++ b/rest/compton_pages/product.go @@ -55,11 +55,11 @@ func Product(id string, rdx kevlar.ReadableRedux, hasSections []string, extLinks /* Product details sections */ - for _, section := range hasSections { + for ii, section := range hasSections { sectionTitle := compton_data.SectionTitles[section] summaryHeading := compton.DSTitle(p, sectionTitle) - detailsSummary := compton.DSLarge(p, summaryHeading, section == compton_data.PropertiesSection). + detailsSummary := compton.DSLarge(p, summaryHeading, ii == 0). BackgroundColor(color.Highlight). ForegroundColor(color.Foreground). MarkerColor(color.Gray). diff --git a/rest/compton_styles/downloads.css b/rest/compton_styles/downloads.css deleted file mode 100644 index 62c8f20e..00000000 --- a/rest/compton_styles/downloads.css +++ /dev/null @@ -1,22 +0,0 @@ -svg { - width: var(--s-n); - height: var(--s-n); - - &.installer { - color: var(--c-purple); - } - - &.downloadable-content { - color: var(--c-indigo); - } - - &.extra { - color: var(--c-orange); - } -} - -.version { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} diff --git a/rest/get_search.go b/rest/get_search.go index 562f12cf..bd6ba434 100644 --- a/rest/get_search.go +++ b/rest/get_search.go @@ -63,8 +63,9 @@ func GetSearch(w http.ResponseWriter, r *http.Request) { } desc := q.Get(vangogh_local_data.DescendingProperty) == "true" - var err error found := rdx.Match(q) + + var err error ids, err = rdx.Sort(found, desc, sort, vangogh_local_data.TitleProperty, vangogh_local_data.ProductTypeProperty) if err != nil { http.Error(w, nod.Error(err).Error(), http.StatusInternalServerError)