Previously, the profile setting did nothing.

Signed-off-by: Franciszek Stachura <[email protected]>
---
Although thinking of it now, I'm not sure what people use this for
exactly. I guess it's useful when interacting with the API.

 pkg/web/patches.go    |  5 ++++-
 pkg/web/patches.templ | 11 +++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/pkg/web/patches.go b/pkg/web/patches.go
index fbc711c..4f5a2bd 100644
--- a/pkg/web/patches.go
+++ b/pkg/web/patches.go
@@ -38,7 +38,9 @@ func (h *webHandler) PatchList(w http.ResponseWriter, r 
*http.Request) {
                page = 1
        }
        perPage := h.cfg.Http.WebPageSize
-       if user := getWebUser(r); user != nil && user.ItemsPerPage > 0 {
+
+       user := getWebUser(r)
+       if user != nil && user.ItemsPerPage > 0 {
                perPage = user.ItemsPerPage
        }
        if perPage > h.cfg.Http.WebPageMax {
@@ -151,6 +153,7 @@ func (h *webHandler) PatchList(w http.ResponseWriter, r 
*http.Request) {
        data := patchListData{
                PC:          h.projectPageCtx(r, project),
                Project:     *project,
+               User:        user,
                Patches:     patches,
                Filters:     filters,
                Sort:        sort,
diff --git a/pkg/web/patches.templ b/pkg/web/patches.templ
index 9b3d9cb..833664d 100644
--- a/pkg/web/patches.templ
+++ b/pkg/web/patches.templ
@@ -16,6 +16,7 @@ import (
 type patchListData struct {
        PC          pageContext
        Project     db.Project
+       User        *db.User
        Patches     []db.Patch
        Filters     []appliedFilter
        Sort        string
@@ -176,6 +177,11 @@ templ patchListPage(d patchListData) {
                                                        if d.PC.User != nil {
                                                                <th 
class="checkbox"><input type="checkbox" title="Select all" 
id="select-all"/></th>
                                                        }
+                                                       if d.User != nil && 
d.User.ShowIds {
+                                                               <th>
+                                                                       ID
+                                                               </th>
+                                                       }
                                                        @sortHeader("Patch", 
"name", "", d)
                                                        <th 
class="col-series">Series</th>
                                                        <th class="col-tags">{ 
strings.Join(d.TagAbbrevs, "/") }</th>
@@ -248,6 +254,11 @@ templ patchRow(d *patchListData, p *db.Patch) {
                        <input type="checkbox" name="patch_id" value={ 
fmt.Sprintf("%d", p.ID) }/>
                </td>
        }
+       if d.User != nil && d.User.ShowIds {
+               <td>
+                       { p.ID }
+               </td>
+       }
        <td>
                <a href={ templ.SafeURL(patchURL(d.Project.Linkname, p.Msgid)) 
}>
                        { truncate(p.Name, 100) }
-- 
2.56.0

_______________________________________________
Patchwork mailing list
[email protected]
https://lists.ozlabs.org/listinfo/patchwork

Reply via email to