diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2024-02-26 20:04:09 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2024-02-26 20:04:09 +0200 |
commit | 961e052b9dc74e68baa4ab01c1685b8babcdfd65 (patch) | |
tree | 9a0c0d48f090415aef65bff169a3369f2526801d | |
parent | app/maintainer: add changelog atom feed (diff) | |
download | soko-961e052b9dc74e68baa4ab01c1685b8babcdfd65.tar.gz soko-961e052b9dc74e68baa4ab01c1685b8babcdfd65.tar.bz2 soko-961e052b9dc74e68baa4ab01c1685b8babcdfd65.zip |
templ: format all files
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r-- | pkg/api/graphql/graphiql/graphiql.templ | 4 | ||||
-rw-r--r-- | pkg/app/handler/about/index.templ | 61 | ||||
-rw-r--r-- | pkg/app/handler/about/status.templ | 4 | ||||
-rw-r--r-- | pkg/app/handler/maintainer/browse.templ | 16 | ||||
-rw-r--r-- | pkg/app/handler/maintainer/show.templ | 30 | ||||
-rw-r--r-- | pkg/app/handler/packages/search.templ | 2 | ||||
-rw-r--r-- | pkg/app/handler/useflags/expand.templ | 2 | ||||
-rw-r--r-- | pkg/app/handler/useflags/global.templ | 2 | ||||
-rw-r--r-- | pkg/app/handler/useflags/local.templ | 2 | ||||
-rw-r--r-- | pkg/app/handler/user/preferences.templ | 4 |
10 files changed, 64 insertions, 63 deletions
diff --git a/pkg/api/graphql/graphiql/graphiql.templ b/pkg/api/graphql/graphiql/graphiql.templ index 0b3399d..c392a54 100644 --- a/pkg/api/graphql/graphiql/graphiql.templ +++ b/pkg/api/graphql/graphiql/graphiql.templ @@ -22,12 +22,12 @@ templ show() { Loading... </div> <script src="https://unpkg.com/graphiql@0.17.5/graphiql.min.js" type="application/javascript"></script> - @templ.Raw(`<script>window.graphqlEndpoint = '` + config.GraphiqlEndpoint() + `';</script>`) + @templ.Raw(`<script>window.graphqlEndpoint = '` + config.GraphiqlEndpoint() + `';</script>`) <script src="/assets/graphiql.js" type="application/javascript"></script> </body> </html> } func Show(w http.ResponseWriter, r *http.Request) { - show().Render(r.Context(), w) + show().Render(r.Context(), w) } diff --git a/pkg/app/handler/about/index.templ b/pkg/app/handler/about/index.templ index bbb60e1..033b09a 100644 --- a/pkg/app/handler/about/index.templ +++ b/pkg/app/handler/about/index.templ @@ -17,39 +17,40 @@ func getCommitId() string { } func versionText() string { - commitId := getCommitId() - version := config.Version() - if commitId == "" { - return "Currently " + version + " is running." - } - return "Currently " + version + " is running, based on commit " + commitId + "." + commitId := getCommitId() + version := config.Version() + if commitId == "" { + return "Currently " + version + " is running." + } + return "Currently " + version + " is running, based on commit " + commitId + "." } templ index() { - <div class="container mb-5"> - <div class="row"> - <div class="col-12 text-center"> - <h1 class="px-3 pt-5 pb-1" style="font-size: 3em;">About packages.gentoo.org</h1> - <span style="font-size: 90%;" class="text-muted"> - Feel free to <a href="/about/feedback">get in touch</a> { "if" } you have any questions that are not answered on this page.<br/> - And welcome to the new packages.gentoo.org! - </span> - </div> - <div class="col-12 mt-5 pt-4"> - <h2>FAQ</h2> - <dl> - <dt>Which version is currently running?</dt> - <dd>{ versionText() }</dd> - <br /> - <dt>How often is the site updated?</dt> - <dd> - Updates are scheduled <strong>every 5 minutes now</strong>. - You can find the last time an import task was started in the footer. - </dd> - </dl> - </div> - </div> - </div> + <div class="container mb-5"> + <div class="row"> + <div class="col-12 text-center"> + <h1 class="px-3 pt-5 pb-1" style="font-size: 3em;">About packages.gentoo.org</h1> + <span style="font-size: 90%;" class="text-muted"> + Feel free to <a href="/about/feedback">get in touch</a> { "if" } you have any questions that are not answered on this page. + <br/> + And welcome to the new packages.gentoo.org! + </span> + </div> + <div class="col-12 mt-5 pt-4"> + <h2>FAQ</h2> + <dl> + <dt>Which version is currently running?</dt> + <dd>{ versionText() }</dd> + <br/> + <dt>How often is the site updated?</dt> + <dd> + Updates are scheduled <strong>every 5 minutes now</strong>. + You can find the last time an import task was started in the footer. + </dd> + </dl> + </div> + </div> + </div> } // Index shows the landing page of the about pages diff --git a/pkg/app/handler/about/status.templ b/pkg/app/handler/about/status.templ index de976d7..3c9193b 100644 --- a/pkg/app/handler/about/status.templ +++ b/pkg/app/handler/about/status.templ @@ -43,7 +43,7 @@ templ status(applications []*models.Application) { // Status shows the sync status of updater func Status(w http.ResponseWriter, r *http.Request) { - var applicationData []*models.Application + var applicationData []*models.Application database.DBCon.Model(&applicationData).Order("id").Column("id", "last_update").Select() - layout.Layout("About", "about", status(applicationData)).Render(r.Context(), w) + layout.Layout("About", "about", status(applicationData)).Render(r.Context(), w) } diff --git a/pkg/app/handler/maintainer/browse.templ b/pkg/app/handler/maintainer/browse.templ index 6ba40a2..f7bc8b6 100644 --- a/pkg/app/handler/maintainer/browse.templ +++ b/pkg/app/handler/maintainer/browse.templ @@ -66,12 +66,12 @@ var browseViewTabs = []layout.SubTab{ } func renderBrowsePage(w http.ResponseWriter, r *http.Request, title string, dbType string) { - var maintainers []*models.Maintainer + var maintainers []*models.Maintainer err := database.DBCon.Model(&maintainers). - Where("type = ?", dbType). - Order("name"). - Select() - if err != nil { + Where("type = ?", dbType). + Order("name"). + Select() + if err != nil { http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) return @@ -82,13 +82,13 @@ func renderBrowsePage(w http.ResponseWriter, r *http.Request, title string, dbTy } func BrowseProjects(w http.ResponseWriter, r *http.Request) { - renderBrowsePage(w, r, "Gentoo Projects", "project") + renderBrowsePage(w, r, "Gentoo Projects", "project") } func BrowseDevs(w http.ResponseWriter, r *http.Request) { - renderBrowsePage(w, r, "Gentoo Developers", "gentoo-developer") + renderBrowsePage(w, r, "Gentoo Developers", "gentoo-developer") } func BrowseProxyDevs(w http.ResponseWriter, r *http.Request) { - renderBrowsePage(w, r, "Proxied Maintainers", "proxied-maintainer") + renderBrowsePage(w, r, "Proxied Maintainers", "proxied-maintainer") } diff --git a/pkg/app/handler/maintainer/show.templ b/pkg/app/handler/maintainer/show.templ index a7f74d5..4923cbf 100644 --- a/pkg/app/handler/maintainer/show.templ +++ b/pkg/app/handler/maintainer/show.templ @@ -202,26 +202,26 @@ templ showPackages(packages []*models.Package, maintainer *models.Maintainer) { } if len(maintainer.Projects) > 0 { <h4> - <a class="collapseLink" style="color:#000000;" data-toggle="collapse" href="#collapseProjects" role="button" aria-expanded="false" aria-controls="collapseProjects"> - Projects - </a> - </h4> - <div class="collapse show" id="collapseProjects"> - <dl> - for _, project := range maintainer.Projects { - <dd class="ml-3 mb-0"><a href={ templ.URL("/maintainer/" + project.Email) }>{ project.Name }</a></dd> + <a class="collapseLink" style="color:#000000;" data-toggle="collapse" href="#collapseProjects" role="button" aria-expanded="false" aria-controls="collapseProjects"> + Projects + </a> + </h4> + <div class="collapse show" id="collapseProjects"> + <dl> + for _, project := range maintainer.Projects { + <dd class="ml-3 mb-0"><a href={ templ.URL("/maintainer/" + project.Email) }>{ project.Name }</a></dd> } - </dl> - </div> + </dl> + </div> } if len(packages) > 0 { <h4 class="mt-4"> - <a class="collapseLink" style="color:#000000;" data-toggle="collapse" href="#collapseShortcuts" role="button" aria-expanded="false" aria-controls="collapseShortcuts"> - Shortcuts - </a> - </h4> + <a class="collapseLink" style="color:#000000;" data-toggle="collapse" href="#collapseShortcuts" role="button" aria-expanded="false" aria-controls="collapseShortcuts"> + Shortcuts + </a> + </h4> <div class="collapse show" id="collapseShortcuts"> - <dl> + <dl> for i, pkg := range packages { if i == 0 || pkg.Category != packages[i-1].Category { <dd class="ml-3 mb-0"> diff --git a/pkg/app/handler/packages/search.templ b/pkg/app/handler/packages/search.templ index a42e5b3..6fb168f 100644 --- a/pkg/app/handler/packages/search.templ +++ b/pkg/app/handler/packages/search.templ @@ -53,7 +53,7 @@ templ search(query string, packages []models.Package) { </div> </form> </div> - <script src="/assets/index.js"></script> + <script src="/assets/index.js"></script> } </div> </div> diff --git a/pkg/app/handler/useflags/expand.templ b/pkg/app/handler/useflags/expand.templ index 82581f2..c73d95b 100644 --- a/pkg/app/handler/useflags/expand.templ +++ b/pkg/app/handler/useflags/expand.templ @@ -49,7 +49,7 @@ func Expand(w http.ResponseWriter, r *http.Request) { err := database.DBCon.Model(&useflags). Where("scope = 'use_expand'"). Order("use_expand", "name"). - Column("use_expand", "name", "description"). + Column("use_expand", "name", "description"). Select() if err != nil && err != pg.ErrNoRows { http.Error(w, http.StatusText(http.StatusInternalServerError), diff --git a/pkg/app/handler/useflags/global.templ b/pkg/app/handler/useflags/global.templ index 46fe1f0..edfcda2 100644 --- a/pkg/app/handler/useflags/global.templ +++ b/pkg/app/handler/useflags/global.templ @@ -33,7 +33,7 @@ func Global(w http.ResponseWriter, r *http.Request) { err := database.DBCon.Model(&useflags). Where("scope = 'global'"). Order("name"). - Column("name", "description"). + Column("name", "description"). Select() if err != nil && err != pg.ErrNoRows { http.Error(w, http.StatusText(http.StatusInternalServerError), diff --git a/pkg/app/handler/useflags/local.templ b/pkg/app/handler/useflags/local.templ index 01a7544..cdc4a53 100644 --- a/pkg/app/handler/useflags/local.templ +++ b/pkg/app/handler/useflags/local.templ @@ -37,7 +37,7 @@ func Local(w http.ResponseWriter, r *http.Request) { err := database.DBCon.Model(&useflags). Where("scope = 'local'"). Order("package", "name"). - Column("package", "name", "description"). + Column("package", "name", "description"). Select() if err != nil && err != pg.ErrNoRows { http.Error(w, http.StatusText(http.StatusInternalServerError), diff --git a/pkg/app/handler/user/preferences.templ b/pkg/app/handler/user/preferences.templ index 0b33d5c..b64dc19 100644 --- a/pkg/app/handler/user/preferences.templ +++ b/pkg/app/handler/user/preferences.templ @@ -41,7 +41,7 @@ templ show(currentSubTab string, preferences models.UserPreferences) { case "General": @general(preferences.General) case "Packages": - @packages(preferences.Packages) + @packages(preferences.Packages) case "Maintainers": @maintainers(preferences.Maintainers) case "USE flags": @@ -74,7 +74,7 @@ templ sortableScript() { func Preferences(currentSubTab string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { layout.TabbedLayout("User", "preferences", "Preferences", "fa fa-fw fa-cog", "You can customize the page contents to your needs here", viewTabs, - currentSubTab, show(currentSubTab, utils.GetUserPreferences(r))).Render(r.Context(), w) + currentSubTab, show(currentSubTab, utils.GetUserPreferences(r))).Render(r.Context(), w) } } |