Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Removing updates sections capitalization
Browse files Browse the repository at this point in the history
Using normal font weight for product card titles
  • Loading branch information
boggydigital committed Oct 3, 2024
1 parent ef9867b commit 2264d47
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 43 deletions.
2 changes: 1 addition & 1 deletion rest/compton_pages/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

const (
filterSearchTitle = "Filter & Search"
filterSearchTitle = "Filter & search"
)

func Search(query map[string][]string, ids []string, from, to int, rdx kevlar.ReadableRedux) compton.Element {
Expand Down
1 change: 1 addition & 0 deletions rest/gaugin_elements/product_card/style/product-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: var(--fw-n);
}

& li.labels {
Expand Down
52 changes: 10 additions & 42 deletions rest/get_updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"github.com/arelate/gaugin/rest/compton_pages"
"github.com/boggydigital/kevlar"
"golang.org/x/exp/maps"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"net/http"
"sort"
"strconv"
Expand All @@ -21,6 +19,15 @@ const (
updatedProductsLimit = 24 // divisible by 2,3,4,6
)

var sectionTitles = map[string]string{
"new in store": "Store additions",
"new in account": "Purchased recently",
"new in wishlist": "Wishlist additions",
"released today": "Today's releases",
"updates in account": "Updated installers",
"updates in news": "Steam news",
}

func GetUpdates(w http.ResponseWriter, r *http.Request) {

// GET /updates
Expand Down Expand Up @@ -97,36 +104,11 @@ func GetUpdates(w http.ResponseWriter, r *http.Request) {
}
}

//gaugin_middleware.DefaultHeaders(w)

// section order will be based on full title ("new in ...", "updates in ...")
// so not changed after concise update titles change
// so the order won't be changed after expanding titles
sections := maps.Keys(updates)
sort.Strings(sections)

var caser = cases.Title(language.English)

sectionTitles := make(map[string]string)
for t, _ := range updates {
st := t
switch t {
case "new in store":
st = "Store additions"
case "new in account":
st = "Purchased recently"
case "new in wishlist":
st = "Wishlist additions"
case "released today":
st = "Today's releases"
case "updates in account":
st = "Installers updated"
case "updates in news":
st = "Steam news"
}

sectionTitles[t] = caser.String(st)
}

tagNamesRedux, err := getRedux(http.DefaultClient, "", true, vangogh_local_data.TagNameProperty)
if err != nil {
http.Error(w, nod.Error(err).Error(), http.StatusInternalServerError)
Expand All @@ -139,18 +121,4 @@ func GetUpdates(w http.ResponseWriter, r *http.Request) {
if err := updatesPage.WriteContent(w); err != nil {
http.Error(w, nod.Error(err).Error(), http.StatusInternalServerError)
}

//if err := app.RenderGroup(
// stencil_app.NavUpdates,
// sections,
// updates,
// sectionTitles,
// updateTotals,
// updated,
// r.URL,
// rdx,
// w); err != nil {
// http.Error(w, nod.Error(err).Error(), http.StatusInternalServerError)
// return
//}
}

0 comments on commit 2264d47

Please sign in to comment.