diff --git a/assets/pgo1.png b/assets/pgo1.png deleted file mode 100644 index 29765df..0000000 Binary files a/assets/pgo1.png and /dev/null differ diff --git a/assets/pgo2.png b/assets/pgo2.png deleted file mode 100644 index 2d1cf06..0000000 Binary files a/assets/pgo2.png and /dev/null differ diff --git a/pkg/app/handler/packages/overview.templ b/pkg/app/handler/packages/overview.templ index 0e18082..43632e2 100644 --- a/pkg/app/handler/packages/overview.templ +++ b/pkg/app/handler/packages/overview.templ @@ -3,7 +3,6 @@ package packages import "slices" import "strings" import "time" -import "soko/pkg/app/handler/packages/components" import "soko/pkg/app/utils" import "soko/pkg/models" @@ -133,7 +132,7 @@ templ maintainersList(maintainers []*models.Maintainer) { } } -templ overview(pkg *models.Package, userPreferences *models.UserPreferences) { +templ overview(pkg *models.Package) {
if len(pkg.Outdated) > 0 { @@ -393,10 +392,6 @@ templ overview(pkg *models.Package, userPreferences *models.UserPreferences) { }
- if userPreferences.Packages.Overview.Layout == "full" { -
- @components.Changelog(pkg.Atom, pkg.Commits) - }

diff --git a/pkg/app/handler/packages/show.go b/pkg/app/handler/packages/show.go index a3c71b7..718a2a6 100644 --- a/pkg/app/handler/packages/show.go +++ b/pkg/app/handler/packages/show.go @@ -109,9 +109,7 @@ func Show(w http.ResponseWriter, r *http.Request) { sortVersionsDesc(gpackage.Versions) - layout.Layout(gpackage.Atom, layout.Packages, - show(&gpackage, currentSubTab, utils.GetUserPreferences(r)), - ).Render(r.Context(), w) + layout.Layout(gpackage.Atom, layout.Packages, show(&gpackage, currentSubTab)).Render(r.Context(), w) } func updateSearchHistory(atom string, w http.ResponseWriter, r *http.Request) { diff --git a/pkg/app/handler/packages/show.templ b/pkg/app/handler/packages/show.templ index 6718ae0..64d99c9 100644 --- a/pkg/app/handler/packages/show.templ +++ b/pkg/app/handler/packages/show.templ @@ -132,7 +132,7 @@ func collectSecurityBugs(pkg *models.Package) (string, []*models.Bug) { return pkg.Atom, bugs } -templ show(pkg *models.Package, currentSubTab string, userPreferences models.UserPreferences) { +templ show(pkg *models.Package, currentSubTab string) { if currentSubTab == "Reverse Dependencies" { @tabbedHeader(pkg, "Dependencies") } else { @@ -156,7 +156,7 @@ templ show(pkg *models.Package, currentSubTab string, userPreferences models.Use case "Reverse Dependencies": @reverseDependencies(pkg) default: - @overview(pkg, &userPreferences) + @overview(pkg) }

diff --git a/pkg/app/handler/user/packages.templ b/pkg/app/handler/user/packages.templ deleted file mode 100644 index c9d8459..0000000 --- a/pkg/app/handler/user/packages.templ +++ /dev/null @@ -1,100 +0,0 @@ -package user - -import "encoding/base64" -import "encoding/json" -import "net/http" -import "time" -import "soko/pkg/app/utils" -import "soko/pkg/models" - -templ packages(preferences models.PackagesPreferences) { -
-
-

Layout

-
-
-
-
- Versions + Metadata (default) -
-
-
-
- - -
-
-
-
-
-
- Versions + Metadata + Changelog -
-
-
-
- - -
-
-
-
-
-
- - Reset to Defaults -
-
-
-
- -} - -func EditPackagesPreferences(w http.ResponseWriter, r *http.Request) { - - userPreferences := utils.GetUserPreferences(r) - - r.ParseForm() - - // Overview: Layout - overviewLayout := r.Form.Get("overview-layout") - if overviewLayout == "minimal" || overviewLayout == "full" { - userPreferences.Packages.Overview.Layout = overviewLayout - } - - // - // Store cookie - // - encodedUserPreferences, err := json.Marshal(&userPreferences.Packages) - if err == nil { - sEnc := base64.StdEncoding.EncodeToString(encodedUserPreferences) - addCookie(w, "userpref_packages", "/", sEnc, 365*24*time.Hour) - } - http.Redirect(w, r, "/user/preferences/packages", http.StatusSeeOther) -} - -func ResetPackages(w http.ResponseWriter, r *http.Request) { - userPreferences := utils.GetDefaultUserPreferences() - encodedUserPreferences, err := json.Marshal(&userPreferences.Packages) - if err == nil { - sEnc := base64.StdEncoding.EncodeToString(encodedUserPreferences) - addCookie(w, "userpref_packages", "/", sEnc, 365*24*time.Hour) - } - http.Redirect(w, r, "/user/preferences/packages", http.StatusSeeOther) -} diff --git a/pkg/app/handler/user/preferences.templ b/pkg/app/handler/user/preferences.templ index 9fe7031..2c39bad 100644 --- a/pkg/app/handler/user/preferences.templ +++ b/pkg/app/handler/user/preferences.templ @@ -30,8 +30,6 @@ templ show(currentSubTab string, preferences models.UserPreferences) { switch currentSubTab { case "General": @general(preferences.General) - case "Packages": - @packages(preferences.Packages) case "Maintainers": @maintainers(preferences.Maintainers) } diff --git a/pkg/app/serve.go b/pkg/app/serve.go index 7e627ad..8f71ae7 100644 --- a/pkg/app/serve.go +++ b/pkg/app/serve.go @@ -115,9 +115,6 @@ func Serve() { setRoute("/user/preferences/general/layout", user.General) setRoute("/user/preferences/general/reset", user.ResetGeneral) - setRoute("/user/preferences/packages/edit", user.EditPackagesPreferences) - setRoute("/user/preferences/packages/reset", user.ResetPackages) - setRoute("/user/preferences/maintainers/edit", user.Maintainers) setRoute("/user/preferences/maintainers/reset", user.ResetMaintainers) diff --git a/pkg/app/utils/userdata.go b/pkg/app/utils/userdata.go index dc4258b..13874f8 100644 --- a/pkg/app/utils/userdata.go +++ b/pkg/app/utils/userdata.go @@ -22,14 +22,6 @@ func GetUserPreferences(r *http.Request) models.UserPreferences { } } - cookie, err = r.Cookie("userpref_packages") - if err == nil { - cookieValue, err := b64.StdEncoding.DecodeString(cookie.Value) - if err == nil { - json.Unmarshal(cookieValue, &userPreferences.Packages) - } - } - cookie, err = r.Cookie("userpref_maintainers") if err == nil { cookieValue, err := b64.StdEncoding.DecodeString(cookie.Value) @@ -38,6 +30,7 @@ func GetUserPreferences(r *http.Request) models.UserPreferences { } } + // old cookie: userpref_packages // old cookie: userpref_useflags // old cookie: userpref_arches diff --git a/pkg/models/userpreferences.go b/pkg/models/userpreferences.go index ba22a46..0db7107 100644 --- a/pkg/models/userpreferences.go +++ b/pkg/models/userpreferences.go @@ -4,7 +4,6 @@ package models type UserPreferences struct { General GeneralPreferences - Packages PackagesPreferences Maintainers MaintainersPreferences } @@ -12,14 +11,6 @@ type GeneralPreferences struct { LandingPageLayout string } -type PackagesPreferences struct { - Overview PackagesOverviewPreferences -} - -type PackagesOverviewPreferences struct { - Layout string -} - type MaintainersPreferences struct { IncludeProjectPackages bool ExcludedProjects []string @@ -31,14 +22,10 @@ var AllArches = [...]string{"alpha", "amd64", "arm", "arm64", "hppa", "ia64", "m func GetDefaultUserPreferences() UserPreferences { userPreferences := UserPreferences{} userPreferences.General = GeneralPreferences{} - userPreferences.Packages = PackagesPreferences{} - userPreferences.Packages.Overview = PackagesOverviewPreferences{} userPreferences.Maintainers = MaintainersPreferences{} userPreferences.General.LandingPageLayout = "classic" - userPreferences.Packages.Overview.Layout = "minimal" - userPreferences.Maintainers.IncludeProjectPackages = false userPreferences.Maintainers.ExcludedProjects = []string{} @@ -51,8 +38,4 @@ func (u *UserPreferences) Sanitize() { if !(u.General.LandingPageLayout == "classic" || u.General.LandingPageLayout == "full") { u.General.LandingPageLayout = defaultUserPreferences.General.LandingPageLayout } - - if !(u.Packages.Overview.Layout == "minimal" || u.Packages.Overview.Layout == "full") { - u.Packages.Overview.Layout = defaultUserPreferences.Packages.Overview.Layout - } }