BlueGit

timfa bluegit

Merge branch 'cursor/openbaar-profiel-674d' into 'stage'

timfa

Authored 2026-10-23 · 3 weeks ago

Hash
9787ad7b97fac8facec6026b6da31f74cbc1b4df
Pipeline
Passed
11 files changed +157 −18
internal/server/api_http.go +21 −4
@@ -29,6 +29,7 @@ const (
29 29 authUser apiAuth = iota
30 30 authPublic
31 31 authRelease
32 authOptional
32 33 )
33 34
34 35 type apiHandler func(*Server, http.ResponseWriter, *http.Request)
@@ -94,6 +95,10 @@ func (s *Server) serveAPI(w http.ResponseWriter, r *http.Request, rt apiRoute) {
94 95 actor, ok := r.Context().Value(actorKey{}).(apiActor)
95 96 if !ok {
96 97 tok := tokenFrom(r)
98 if tok == "" && rt.Auth == authOptional {
99 rt.Handler(s, w, r)
100 return
101 }
97 102 if tok == "" || !strings.HasPrefix(tok, "bg_") {
98 103 s.writeAPIErr(w, r, fail(http.StatusUnauthorized, i18n.E("err.apiAuth")))
99 104 return
@@ -254,7 +259,17 @@ func openAPIDoc() map[string]any {
254 259 "summary": rt.Summary,
255 260 "responses": map[string]any{"200": map[string]any{"description": "OK"}, "default": map[string]any{"description": "Error", "content": map[string]any{"application/json": map[string]any{"schema": map[string]any{"$ref": "#/components/schemas/Error"}}}}},
256 261 }
257 if rt.Auth != authPublic {
262 switch rt.Auth {
263 case authPublic:
264 case authOptional:
265 op["description"] = "Public. Without a token the viewer is anonymous and only sees public repositories and groups. A valid token includes private items that account may see. Contributions follow the same filter."
266 op["security"] = []any{
267 map[string]any{},
268 map[string]any{"bearer": []any{}},
269 map[string]any{"privateToken": []any{}},
270 map[string]any{"basic": []any{}},
271 }
272 default:
258 273 op["security"] = []any{
259 274 map[string]any{"bearer": []any{}},
260 275 map[string]any{"privateToken": []any{}},
@@ -322,11 +337,13 @@ func apiIndex() []byte {
322 337 routes := []row{{Method: http.MethodGet, Path: "/api/v1/openapi.json", Summary: "OpenAPI document", Auth: "public"}}
323 338 for _, rt := range apiCatalog {
324 339 auth := "token"
325 if rt.Auth == authPublic {
340 switch rt.Auth {
341 case authPublic:
326 342 auth = "public"
327 }
328 if rt.Auth == authRelease {
343 case authRelease:
329 344 auth = "token_or_job"
345 case authOptional:
346 auth = "public_or_token"
330 347 }
331 348 routes = append(routes, row{Method: rt.Method, Path: rt.Path, Summary: rt.Summary, Auth: auth})
332 349 }
@@ -29,6 +29,7 @@ const (
29 authUser apiAuth = iota
29 authUser apiAuth = iota
30 authPublic
30 authPublic
31 authRelease
31 authRelease
32 authOptional
32)
33)
33
34
34type apiHandler func(*Server, http.ResponseWriter, *http.Request)
35type apiHandler func(*Server, http.ResponseWriter, *http.Request)
@@ -94,6 +95,10 @@ func (s *Server) serveAPI(w http.ResponseWriter, r *http.Request, rt apiRoute) {
94 actor, ok := r.Context().Value(actorKey{}).(apiActor)
95 actor, ok := r.Context().Value(actorKey{}).(apiActor)
95 if !ok {
96 if !ok {
96 tok := tokenFrom(r)
97 tok := tokenFrom(r)
98 if tok == "" && rt.Auth == authOptional {
99 rt.Handler(s, w, r)
100 return
101 }
97 if tok == "" || !strings.HasPrefix(tok, "bg_") {
102 if tok == "" || !strings.HasPrefix(tok, "bg_") {
98 s.writeAPIErr(w, r, fail(http.StatusUnauthorized, i18n.E("err.apiAuth")))
103 s.writeAPIErr(w, r, fail(http.StatusUnauthorized, i18n.E("err.apiAuth")))
99 return
104 return
@@ -254,7 +259,17 @@ func openAPIDoc() map[string]any {
254 "summary": rt.Summary,
259 "summary": rt.Summary,
255 "responses": map[string]any{"200": map[string]any{"description": "OK"}, "default": map[string]any{"description": "Error", "content": map[string]any{"application/json": map[string]any{"schema": map[string]any{"$ref": "#/components/schemas/Error"}}}}},
260 "responses": map[string]any{"200": map[string]any{"description": "OK"}, "default": map[string]any{"description": "Error", "content": map[string]any{"application/json": map[string]any{"schema": map[string]any{"$ref": "#/components/schemas/Error"}}}}},
256 }
261 }
257 if rt.Auth != authPublic {
262 switch rt.Auth {
263 case authPublic:
264 case authOptional:
265 op["description"] = "Public. Without a token the viewer is anonymous and only sees public repositories and groups. A valid token includes private items that account may see. Contributions follow the same filter."
266 op["security"] = []any{
267 map[string]any{},
268 map[string]any{"bearer": []any{}},
269 map[string]any{"privateToken": []any{}},
270 map[string]any{"basic": []any{}},
271 }
272 default:
258 op["security"] = []any{
273 op["security"] = []any{
259 map[string]any{"bearer": []any{}},
274 map[string]any{"bearer": []any{}},
260 map[string]any{"privateToken": []any{}},
275 map[string]any{"privateToken": []any{}},
@@ -322,11 +337,13 @@ func apiIndex() []byte {
322 routes := []row{{Method: http.MethodGet, Path: "/api/v1/openapi.json", Summary: "OpenAPI document", Auth: "public"}}
337 routes := []row{{Method: http.MethodGet, Path: "/api/v1/openapi.json", Summary: "OpenAPI document", Auth: "public"}}
323 for _, rt := range apiCatalog {
338 for _, rt := range apiCatalog {
324 auth := "token"
339 auth := "token"
325 if rt.Auth == authPublic {
340 switch rt.Auth {
341 case authPublic:
326 auth = "public"
342 auth = "public"
327 }
343 case authRelease:
328 if rt.Auth == authRelease {
329 auth = "token_or_job"
344 auth = "token_or_job"
345 case authOptional:
346 auth = "public_or_token"
330 }
347 }
331 routes = append(routes, row{Method: rt.Method, Path: rt.Path, Summary: rt.Summary, Auth: auth})
348 routes = append(routes, row{Method: rt.Method, Path: rt.Path, Summary: rt.Summary, Auth: auth})
332 }
349 }
internal/server/api_openapi.go +1 −1
@@ -287,7 +287,7 @@ func apiSchemas() map[string]any {
287 287 "branch_filter": str("Branch filter. Empty matches every branch."),
288 288 "active": boolean("Hook is enabled."),
289 289 }),
290 "User": obj("User. counts, repos and groups are present on GET /users/{username}. instance_admin and language are present for the signed-in user.", map[string]any{
290 "User": obj("User. counts, repos and groups are present on GET /users/{username}, which is public. Without a token only public repositories and groups are included, and contributions count only those repositories. instance_admin and language are present for the signed-in user.", map[string]any{
291 291 "id": integer("User id."),
292 292 "username": str("Username."),
293 293 "name": str("Display name. Empty when unset."),
@@ -287,7 +287,7 @@ func apiSchemas() map[string]any {
287 "branch_filter": str("Branch filter. Empty matches every branch."),
287 "branch_filter": str("Branch filter. Empty matches every branch."),
288 "active": boolean("Hook is enabled."),
288 "active": boolean("Hook is enabled."),
289 }),
289 }),
290 "User": obj("User. counts, repos and groups are present on GET /users/{username}. instance_admin and language are present for the signed-in user.", map[string]any{
290 "User": obj("User. counts, repos and groups are present on GET /users/{username}, which is public. Without a token only public repositories and groups are included, and contributions count only those repositories. instance_admin and language are present for the signed-in user.", map[string]any{
291 "id": integer("User id."),
291 "id": integer("User id."),
292 "username": str("Username."),
292 "username": str("Username."),
293 "name": str("Display name. Empty when unset."),
293 "name": str("Display name. Empty when unset."),
internal/server/api_openapi_test.go +12 −0
@@ -74,6 +74,18 @@ func TestOpenAPISchemas(t *testing.T) {
74 74 assertBody(t, paths, "/user", "put", "UserUpdate")
75 75 assertResp(t, paths, "/user", "get", "200", "#/components/schemas/User")
76 76 assertResp(t, paths, "/users/{username}", "get", "200", "#/components/schemas/User")
77 op := paths["/users/{username}"].(map[string]any)["get"].(map[string]any)
78 sec, _ := op["security"].([]any)
79 optional := false
80 for _, item := range sec {
81 req, _ := item.(map[string]any)
82 if len(req) == 0 {
83 optional = true
84 }
85 }
86 if !optional {
87 t.Fatal("GET /users/{username} moet zonder token mogen")
88 }
77 89 }
78 90
79 91 func TestResourceWebURL(t *testing.T) {
@@ -74,6 +74,18 @@ func TestOpenAPISchemas(t *testing.T) {
74 assertBody(t, paths, "/user", "put", "UserUpdate")
74 assertBody(t, paths, "/user", "put", "UserUpdate")
75 assertResp(t, paths, "/user", "get", "200", "#/components/schemas/User")
75 assertResp(t, paths, "/user", "get", "200", "#/components/schemas/User")
76 assertResp(t, paths, "/users/{username}", "get", "200", "#/components/schemas/User")
76 assertResp(t, paths, "/users/{username}", "get", "200", "#/components/schemas/User")
77 op := paths["/users/{username}"].(map[string]any)["get"].(map[string]any)
78 sec, _ := op["security"].([]any)
79 optional := false
80 for _, item := range sec {
81 req, _ := item.(map[string]any)
82 if len(req) == 0 {
83 optional = true
84 }
85 }
86 if !optional {
87 t.Fatal("GET /users/{username} moet zonder token mogen")
88 }
77}
89}
78
90
79func TestResourceWebURL(t *testing.T) {
91func TestResourceWebURL(t *testing.T) {
internal/server/api_routes.go +1 −1
@@ -13,7 +13,7 @@ var apiCatalog = []apiRoute{
13 13 {http.MethodGet, "/api/v1/user", access.ScopeRead, authUser, "Current user", (*Server).apiGetUser},
14 14 {http.MethodPut, "/api/v1/user", access.ScopeWrite, authUser, "Update profile", (*Server).apiPutUser},
15 15 {http.MethodGet, "/api/v1/user/export", access.ScopeRead, authUser, "Export account", (*Server).apiExport},
16 {http.MethodGet, "/api/v1/users/{username}", access.ScopeRead, authUser, "User profile", (*Server).apiUserByName},
16 {http.MethodGet, "/api/v1/users/{username}", access.ScopeRead, authOptional, "User profile", (*Server).apiUserByName},
17 17 {http.MethodGet, "/api/v1/user/tokens", access.ScopeRead, authUser, "List access tokens", (*Server).apiListTokens},
18 18 {http.MethodPost, "/api/v1/user/tokens", access.ScopeWrite, authUser, "Create access token", (*Server).apiCreateToken},
19 19 {http.MethodDelete, "/api/v1/user/tokens/{id}", access.ScopeWrite, authUser, "Revoke access token", (*Server).apiDeleteToken},
@@ -13,7 +13,7 @@ var apiCatalog = []apiRoute{
13 {http.MethodGet, "/api/v1/user", access.ScopeRead, authUser, "Current user", (*Server).apiGetUser},
13 {http.MethodGet, "/api/v1/user", access.ScopeRead, authUser, "Current user", (*Server).apiGetUser},
14 {http.MethodPut, "/api/v1/user", access.ScopeWrite, authUser, "Update profile", (*Server).apiPutUser},
14 {http.MethodPut, "/api/v1/user", access.ScopeWrite, authUser, "Update profile", (*Server).apiPutUser},
15 {http.MethodGet, "/api/v1/user/export", access.ScopeRead, authUser, "Export account", (*Server).apiExport},
15 {http.MethodGet, "/api/v1/user/export", access.ScopeRead, authUser, "Export account", (*Server).apiExport},
16 {http.MethodGet, "/api/v1/users/{username}", access.ScopeRead, authUser, "User profile", (*Server).apiUserByName},
16 {http.MethodGet, "/api/v1/users/{username}", access.ScopeRead, authOptional, "User profile", (*Server).apiUserByName},
17 {http.MethodGet, "/api/v1/user/tokens", access.ScopeRead, authUser, "List access tokens", (*Server).apiListTokens},
17 {http.MethodGet, "/api/v1/user/tokens", access.ScopeRead, authUser, "List access tokens", (*Server).apiListTokens},
18 {http.MethodPost, "/api/v1/user/tokens", access.ScopeWrite, authUser, "Create access token", (*Server).apiCreateToken},
18 {http.MethodPost, "/api/v1/user/tokens", access.ScopeWrite, authUser, "Create access token", (*Server).apiCreateToken},
19 {http.MethodDelete, "/api/v1/user/tokens/{id}", access.ScopeWrite, authUser, "Revoke access token", (*Server).apiDeleteToken},
19 {http.MethodDelete, "/api/v1/user/tokens/{id}", access.ScopeWrite, authUser, "Revoke access token", (*Server).apiDeleteToken},
internal/server/flow_list.go +9 −6
@@ -61,6 +61,7 @@ type FlowRow struct {
61 61 Draft bool
62 62 Confidential bool
63 63 Labels []store.Label
64 People []AccountLink
64 65 Extra string
65 66 }
66 67
@@ -182,12 +183,13 @@ func (s *Server) flowIssues(r *http.Request, repo store.Repo, b *IssueBoard, all
182 183 rows := make([]FlowRow, 0, len(shown))
183 184 for _, iss := range shown {
184 185 name, href := s.flowAuthor(r, iss.Author, people)
185 extra := strings.Join(iss.Assignees, ", ")
186 if iss.Milestone != "" {
187 if extra != "" {
188 extra += " · "
186 var assigned []AccountLink
187 for _, who := range iss.Assignees {
188 n, href := s.flowAuthor(r, who, people)
189 if n == "" {
190 continue
189 191 }
190 extra += iss.Milestone
192 assigned = append(assigned, AccountLink{Name: n, URL: href})
191 193 }
192 194 row := FlowRow{
193 195 Href: base + "/" + strconv.FormatInt(iss.Number, 10),
@@ -201,7 +203,8 @@ func (s *Server) flowIssues(r *http.Request, repo store.Repo, b *IssueBoard, all
201 203 AuthorURL: href,
202 204 Confidential: iss.Confidential,
203 205 Labels: iss.Labels,
204 Extra: extra,
206 People: assigned,
207 Extra: iss.Milestone,
205 208 }
206 209 if row.State == "open" {
207 210 if notes, err := s.Store.ListIssueNotes(r.Context(), iss.ID); err == nil {
@@ -61,6 +61,7 @@ type FlowRow struct {
61 Draft bool
61 Draft bool
62 Confidential bool
62 Confidential bool
63 Labels []store.Label
63 Labels []store.Label
64 People []AccountLink
64 Extra string
65 Extra string
65}
66}
66
67
@@ -182,12 +183,13 @@ func (s *Server) flowIssues(r *http.Request, repo store.Repo, b *IssueBoard, all
182 rows := make([]FlowRow, 0, len(shown))
183 rows := make([]FlowRow, 0, len(shown))
183 for _, iss := range shown {
184 for _, iss := range shown {
184 name, href := s.flowAuthor(r, iss.Author, people)
185 name, href := s.flowAuthor(r, iss.Author, people)
185 extra := strings.Join(iss.Assignees, ", ")
186 var assigned []AccountLink
186 if iss.Milestone != "" {
187 for _, who := range iss.Assignees {
187 if extra != "" {
188 n, href := s.flowAuthor(r, who, people)
188 extra += " · "
189 if n == "" {
190 continue
189 }
191 }
190 extra += iss.Milestone
192 assigned = append(assigned, AccountLink{Name: n, URL: href})
191 }
193 }
192 row := FlowRow{
194 row := FlowRow{
193 Href: base + "/" + strconv.FormatInt(iss.Number, 10),
195 Href: base + "/" + strconv.FormatInt(iss.Number, 10),
@@ -201,7 +203,8 @@ func (s *Server) flowIssues(r *http.Request, repo store.Repo, b *IssueBoard, all
201 AuthorURL: href,
203 AuthorURL: href,
202 Confidential: iss.Confidential,
204 Confidential: iss.Confidential,
203 Labels: iss.Labels,
205 Labels: iss.Labels,
204 Extra: extra,
206 People: assigned,
207 Extra: iss.Milestone,
205 }
208 }
206 if row.State == "open" {
209 if row.State == "open" {
207 if notes, err := s.Store.ListIssueNotes(r.Context(), iss.ID); err == nil {
210 if notes, err := s.Store.ListIssueNotes(r.Context(), iss.ID); err == nil {
internal/server/issues.go +19 −0
@@ -66,6 +66,7 @@ type IssueRow struct {
66 66 Due string
67 67 When string
68 68 Assignees string
69 People []AccountLink
69 70 Labels []store.Label
70 71 HTML template.HTML
71 72 }
@@ -456,10 +457,28 @@ func (s *Server) issueRow(r *http.Request, repo store.Repo, iss store.Issue) Iss
456 457 if iss.Author != "" {
457 458 url = "/users/" + iss.Author
458 459 }
460 var people []AccountLink
461 for _, name := range iss.Assignees {
462 name = strings.TrimSpace(name)
463 if name == "" {
464 continue
465 }
466 link := AccountLink{Name: name}
467 if u, err := s.Store.UserByUsername(r.Context(), name); err == nil && u.ID != 0 {
468 if display := strings.TrimSpace(u.DisplayName); display != "" {
469 link.Name = display
470 } else {
471 link.Name = u.Username
472 }
473 link.URL = "/users/" + u.Username
474 }
475 people = append(people, link)
476 }
459 477 return IssueRow{
460 478 Number: iss.Number, Title: iss.Title, Status: iss.Status, Author: iss.Author, AuthorURL: url,
461 479 Confidential: iss.Confidential, Milestone: iss.Milestone, Due: iss.DueOn,
462 480 When: i18n.FormatDate(s.langOf(r), iss.CreatedAt), Assignees: strings.Join(iss.Assignees, ", "),
481 People: people,
463 482 Labels: iss.Labels, HTML: template.HTML(markdown.Render(iss.Description, "", "", "/"+repo.FullPath())),
464 483 }
465 484 }
@@ -66,6 +66,7 @@ type IssueRow struct {
66 Due string
66 Due string
67 When string
67 When string
68 Assignees string
68 Assignees string
69 People []AccountLink
69 Labels []store.Label
70 Labels []store.Label
70 HTML template.HTML
71 HTML template.HTML
71}
72}
@@ -456,10 +457,28 @@ func (s *Server) issueRow(r *http.Request, repo store.Repo, iss store.Issue) Iss
456 if iss.Author != "" {
457 if iss.Author != "" {
457 url = "/users/" + iss.Author
458 url = "/users/" + iss.Author
458 }
459 }
460 var people []AccountLink
461 for _, name := range iss.Assignees {
462 name = strings.TrimSpace(name)
463 if name == "" {
464 continue
465 }
466 link := AccountLink{Name: name}
467 if u, err := s.Store.UserByUsername(r.Context(), name); err == nil && u.ID != 0 {
468 if display := strings.TrimSpace(u.DisplayName); display != "" {
469 link.Name = display
470 } else {
471 link.Name = u.Username
472 }
473 link.URL = "/users/" + u.Username
474 }
475 people = append(people, link)
476 }
459 return IssueRow{
477 return IssueRow{
460 Number: iss.Number, Title: iss.Title, Status: iss.Status, Author: iss.Author, AuthorURL: url,
478 Number: iss.Number, Title: iss.Title, Status: iss.Status, Author: iss.Author, AuthorURL: url,
461 Confidential: iss.Confidential, Milestone: iss.Milestone, Due: iss.DueOn,
479 Confidential: iss.Confidential, Milestone: iss.Milestone, Due: iss.DueOn,
462 When: i18n.FormatDate(s.langOf(r), iss.CreatedAt), Assignees: strings.Join(iss.Assignees, ", "),
480 When: i18n.FormatDate(s.langOf(r), iss.CreatedAt), Assignees: strings.Join(iss.Assignees, ", "),
481 People: people,
463 Labels: iss.Labels, HTML: template.HTML(markdown.Render(iss.Description, "", "", "/"+repo.FullPath())),
482 Labels: iss.Labels, HTML: template.HTML(markdown.Render(iss.Description, "", "", "/"+repo.FullPath())),
464 }
483 }
465}
484}
internal/server/people.go +19 −0
@@ -8,9 +8,28 @@ import (
8 8
9 9 "gitlab.com/Timfa/bluegit/internal/gitrepo"
10 10 "gitlab.com/Timfa/bluegit/internal/i18n"
11 "gitlab.com/Timfa/bluegit/internal/names"
11 12 "gitlab.com/Timfa/bluegit/internal/store"
12 13 )
13 14
15 // userShort stuurt /<username> door naar /users/<username>.
16 // Het eerste paddeel is de gedeelde namespace van gebruikers en groepen
17 // (repositories staan op /<owner>/<repo>, groepen op /groups/<pad>).
18 // Vaste routes zoals /login blijven specifieker. Alleen een bestaande
19 // gebruiker krijgt een redirect; een groepsnaam of onbekende naam niet.
20 func (s *Server) userShort(w http.ResponseWriter, r *http.Request) {
21 name := strings.ToLower(strings.TrimSpace(r.PathValue("name")))
22 if names.ValidUsername(name) != nil {
23 http.NotFound(w, r)
24 return
25 }
26 if _, err := s.Store.UserByUsername(r.Context(), name); err != nil {
27 http.NotFound(w, r)
28 return
29 }
30 http.Redirect(w, r, "/users/"+name, http.StatusFound)
31 }
32
14 33 func (s *Server) profile(w http.ResponseWriter, r *http.Request) {
15 34 name := strings.ToLower(strings.TrimSpace(r.PathValue("username")))
16 35 u, err := s.Store.UserByUsername(r.Context(), name)
@@ -8,9 +8,28 @@ import (
8
8
9 "gitlab.com/Timfa/bluegit/internal/gitrepo"
9 "gitlab.com/Timfa/bluegit/internal/gitrepo"
10 "gitlab.com/Timfa/bluegit/internal/i18n"
10 "gitlab.com/Timfa/bluegit/internal/i18n"
11 "gitlab.com/Timfa/bluegit/internal/names"
11 "gitlab.com/Timfa/bluegit/internal/store"
12 "gitlab.com/Timfa/bluegit/internal/store"
12)
13)
13
14
15// userShort stuurt /<username> door naar /users/<username>.
16// Het eerste paddeel is de gedeelde namespace van gebruikers en groepen
17// (repositories staan op /<owner>/<repo>, groepen op /groups/<pad>).
18// Vaste routes zoals /login blijven specifieker. Alleen een bestaande
19// gebruiker krijgt een redirect; een groepsnaam of onbekende naam niet.
20func (s *Server) userShort(w http.ResponseWriter, r *http.Request) {
21 name := strings.ToLower(strings.TrimSpace(r.PathValue("name")))
22 if names.ValidUsername(name) != nil {
23 http.NotFound(w, r)
24 return
25 }
26 if _, err := s.Store.UserByUsername(r.Context(), name); err != nil {
27 http.NotFound(w, r)
28 return
29 }
30 http.Redirect(w, r, "/users/"+name, http.StatusFound)
31}
32
14func (s *Server) profile(w http.ResponseWriter, r *http.Request) {
33func (s *Server) profile(w http.ResponseWriter, r *http.Request) {
15 name := strings.ToLower(strings.TrimSpace(r.PathValue("username")))
34 name := strings.ToLower(strings.TrimSpace(r.PathValue("username")))
16 u, err := s.Store.UserByUsername(r.Context(), name)
35 u, err := s.Store.UserByUsername(r.Context(), name)
internal/server/profile_test.go +65 −4
@@ -73,12 +73,19 @@ func TestProfilePage(t *testing.T) {
73 73 if err := st.SetLogoMIME(ctx, "repo", zichtbaar.ID, "image/png"); err != nil {
74 74 t.Fatal(err)
75 75 }
76 if _, err := st.CreateRepo(ctx, "user", tim.ID, "geheim", "Geheim project", "master", "private"); err != nil {
76 geheim, err := st.CreateRepo(ctx, "user", tim.ID, "geheim", "Geheim project", "master", "private")
77 if err != nil {
77 78 t.Fatal(err)
78 79 }
79 80 if _, err := st.CreateRepo(ctx, "group", plein.ID, "gedeeld", "Groepsrepo", "master", "public"); err != nil {
80 81 t.Fatal(err)
81 82 }
83 if err := st.AddContributions(ctx, []store.Contribution{
84 {UserID: tim.ID, RepoID: zichtbaar.ID, Kind: "commit", Ref: "pub", At: time.Now()},
85 {UserID: tim.ID, RepoID: geheim.ID, Kind: "commit", Ref: "priv", At: time.Now()},
86 }); err != nil {
87 t.Fatal(err)
88 }
82 89 if err := st.SetMember(ctx, "repo", repoID(t, st, "tim", "geheim"), "ada", access.RoleDeveloper); err != nil {
83 90 t.Fatal(err)
84 91 }
@@ -130,6 +137,7 @@ func TestProfilePage(t *testing.T) {
130 137 `href="/groups/plein"`,
131 138 `<strong>1</strong> <span>Repositories</span>`,
132 139 `<strong>1</strong> <span>Groups</span>`,
140 `<strong>1</strong> <span>Contributions</span>`,
133 141 } {
134 142 if !strings.Contains(pub, want) {
135 143 t.Fatalf("openbaar profiel mist %q", want)
@@ -160,6 +168,7 @@ func TestProfilePage(t *testing.T) {
160 168 `href="/groups/kluis"`,
161 169 `<strong>2</strong> <span>Repositories</span>`,
162 170 `<strong>2</strong> <span>Groups</span>`,
171 `<strong>2</strong> <span>Contributions</span>`,
163 172 } {
164 173 if !strings.Contains(adaPage, want) {
165 174 t.Fatalf("ada ziet niet %q", want)
@@ -224,7 +233,7 @@ func TestProfilePage(t *testing.T) {
224 233 t.Fatalf("api zelf mist eigen velden: %#v", mine)
225 234 }
226 235 counts := mine["counts"].(map[string]any)
227 if counts["repos"] != 2.0 || counts["groups"] != 2.0 || counts["contributions"] != 0.0 {
236 if counts["repos"] != 2.0 || counts["groups"] != 2.0 || counts["contributions"] != 2.0 {
228 237 t.Fatalf("api tellingen: %#v", counts)
229 238 }
230 239 if !apiPaths(mine["repos"]).has("tim/zichtbaar", "tim/geheim") || apiPaths(mine["repos"]).has("plein/gedeeld") {
@@ -240,6 +249,32 @@ func TestProfilePage(t *testing.T) {
240 249 if !apiPaths(other["repos"]).has("tim/geheim") || !apiPaths(other["groups"]).has("kluis") {
241 250 t.Fatalf("api van ada mist privé: %#v %#v", other["repos"], other["groups"])
242 251 }
252 if other["counts"].(map[string]any)["contributions"] != 2.0 {
253 t.Fatalf("api van ada telt verborgen bijdragen niet mee: %#v", other["counts"])
254 }
255 pubAPI := apiGet(t, ts.URL+"/api/v1/users/tim", "")
256 if _, ok := pubAPI["instance_admin"]; ok || pubAPI["language"] != nil {
257 t.Fatalf("anonieme api toont privévelden: %#v", pubAPI)
258 }
259 if apiPaths(pubAPI["repos"]).has("tim/geheim") || apiPaths(pubAPI["groups"]).has("kluis") || !apiPaths(pubAPI["repos"]).has("tim/zichtbaar") {
260 t.Fatalf("anonieme api filter: %#v %#v", pubAPI["repos"], pubAPI["groups"])
261 }
262 if pubAPI["counts"].(map[string]any)["contributions"] != 1.0 {
263 t.Fatalf("anonieme api lekt privébijdragen: %#v", pubAPI["counts"])
264 }
265 badTok, err := http.NewRequest(http.MethodGet, ts.URL+"/api/v1/users/tim", nil)
266 if err != nil {
267 t.Fatal(err)
268 }
269 badTok.Header.Set("Authorization", "Bearer bg_nietgeldig")
270 res, err = http.DefaultClient.Do(badTok)
271 if err != nil {
272 t.Fatal(err)
273 }
274 if res.StatusCode != http.StatusUnauthorized {
275 t.Fatalf("ongeldig token %d", res.StatusCode)
276 }
277 _ = res.Body.Close()
243 278 req, err := http.NewRequest(http.MethodPut, ts.URL+"/api/v1/user", strings.NewReader(`{"bio":"alleen bio"}`))
244 279 if err != nil {
245 280 t.Fatal(err)
@@ -261,10 +296,34 @@ func TestProfilePage(t *testing.T) {
261 296 t.Fatal(err)
262 297 }
263 298 loc := res.Header.Get("Location")
264 if res.StatusCode != http.StatusNotFound || loc != "" {
299 if res.StatusCode != http.StatusFound || loc != "/users/tim" {
265 300 t.Fatalf("/tim is %d locatie %q", res.StatusCode, loc)
266 301 }
267 302 _ = res.Body.Close()
303 res, err = noredir.Get(ts.URL + "/plein")
304 if err != nil {
305 t.Fatal(err)
306 }
307 if res.StatusCode != http.StatusNotFound || res.Header.Get("Location") != "" {
308 t.Fatalf("groepsnaam /plein is %d locatie %q", res.StatusCode, res.Header.Get("Location"))
309 }
310 _ = res.Body.Close()
311 res, err = noredir.Get(ts.URL + "/tim/zichtbaar")
312 if err != nil {
313 t.Fatal(err)
314 }
315 if res.StatusCode == http.StatusFound && strings.HasPrefix(res.Header.Get("Location"), "/users/") {
316 t.Fatalf("repositorypad wijst naar een profiel: %s", res.Header.Get("Location"))
317 }
318 _ = res.Body.Close()
319 res, err = noredir.Get(ts.URL + "/login")
320 if err != nil {
321 t.Fatal(err)
322 }
323 if strings.Contains(res.Header.Get("Location"), "/users/") {
324 t.Fatalf("login wijst naar een profiel: %s", res.Header.Get("Location"))
325 }
326 _ = res.Body.Close()
268 327 res, err = anon.Get(ts.URL + "/users/nobody")
269 328 if err != nil {
270 329 t.Fatal(err)
@@ -291,7 +350,9 @@ func apiGet(t *testing.T, rawURL, token string) map[string]any {
291 350 if err != nil {
292 351 t.Fatal(err)
293 352 }
294 req.Header.Set("Authorization", "Bearer "+token)
353 if token != "" {
354 req.Header.Set("Authorization", "Bearer "+token)
355 }
295 356 res, err := http.DefaultClient.Do(req)
296 357 if err != nil {
297 358 t.Fatal(err)
@@ -73,12 +73,19 @@ func TestProfilePage(t *testing.T) {
73 if err := st.SetLogoMIME(ctx, "repo", zichtbaar.ID, "image/png"); err != nil {
73 if err := st.SetLogoMIME(ctx, "repo", zichtbaar.ID, "image/png"); err != nil {
74 t.Fatal(err)
74 t.Fatal(err)
75 }
75 }
76 if _, err := st.CreateRepo(ctx, "user", tim.ID, "geheim", "Geheim project", "master", "private"); err != nil {
76 geheim, err := st.CreateRepo(ctx, "user", tim.ID, "geheim", "Geheim project", "master", "private")
77 if err != nil {
77 t.Fatal(err)
78 t.Fatal(err)
78 }
79 }
79 if _, err := st.CreateRepo(ctx, "group", plein.ID, "gedeeld", "Groepsrepo", "master", "public"); err != nil {
80 if _, err := st.CreateRepo(ctx, "group", plein.ID, "gedeeld", "Groepsrepo", "master", "public"); err != nil {
80 t.Fatal(err)
81 t.Fatal(err)
81 }
82 }
83 if err := st.AddContributions(ctx, []store.Contribution{
84 {UserID: tim.ID, RepoID: zichtbaar.ID, Kind: "commit", Ref: "pub", At: time.Now()},
85 {UserID: tim.ID, RepoID: geheim.ID, Kind: "commit", Ref: "priv", At: time.Now()},
86 }); err != nil {
87 t.Fatal(err)
88 }
82 if err := st.SetMember(ctx, "repo", repoID(t, st, "tim", "geheim"), "ada", access.RoleDeveloper); err != nil {
89 if err := st.SetMember(ctx, "repo", repoID(t, st, "tim", "geheim"), "ada", access.RoleDeveloper); err != nil {
83 t.Fatal(err)
90 t.Fatal(err)
84 }
91 }
@@ -130,6 +137,7 @@ func TestProfilePage(t *testing.T) {
130 `href="/groups/plein"`,
137 `href="/groups/plein"`,
131 `<strong>1</strong> <span>Repositories</span>`,
138 `<strong>1</strong> <span>Repositories</span>`,
132 `<strong>1</strong> <span>Groups</span>`,
139 `<strong>1</strong> <span>Groups</span>`,
140 `<strong>1</strong> <span>Contributions</span>`,
133 } {
141 } {
134 if !strings.Contains(pub, want) {
142 if !strings.Contains(pub, want) {
135 t.Fatalf("openbaar profiel mist %q", want)
143 t.Fatalf("openbaar profiel mist %q", want)
@@ -160,6 +168,7 @@ func TestProfilePage(t *testing.T) {
160 `href="/groups/kluis"`,
168 `href="/groups/kluis"`,
161 `<strong>2</strong> <span>Repositories</span>`,
169 `<strong>2</strong> <span>Repositories</span>`,
162 `<strong>2</strong> <span>Groups</span>`,
170 `<strong>2</strong> <span>Groups</span>`,
171 `<strong>2</strong> <span>Contributions</span>`,
163 } {
172 } {
164 if !strings.Contains(adaPage, want) {
173 if !strings.Contains(adaPage, want) {
165 t.Fatalf("ada ziet niet %q", want)
174 t.Fatalf("ada ziet niet %q", want)
@@ -224,7 +233,7 @@ func TestProfilePage(t *testing.T) {
224 t.Fatalf("api zelf mist eigen velden: %#v", mine)
233 t.Fatalf("api zelf mist eigen velden: %#v", mine)
225 }
234 }
226 counts := mine["counts"].(map[string]any)
235 counts := mine["counts"].(map[string]any)
227 if counts["repos"] != 2.0 || counts["groups"] != 2.0 || counts["contributions"] != 0.0 {
236 if counts["repos"] != 2.0 || counts["groups"] != 2.0 || counts["contributions"] != 2.0 {
228 t.Fatalf("api tellingen: %#v", counts)
237 t.Fatalf("api tellingen: %#v", counts)
229 }
238 }
230 if !apiPaths(mine["repos"]).has("tim/zichtbaar", "tim/geheim") || apiPaths(mine["repos"]).has("plein/gedeeld") {
239 if !apiPaths(mine["repos"]).has("tim/zichtbaar", "tim/geheim") || apiPaths(mine["repos"]).has("plein/gedeeld") {
@@ -240,6 +249,32 @@ func TestProfilePage(t *testing.T) {
240 if !apiPaths(other["repos"]).has("tim/geheim") || !apiPaths(other["groups"]).has("kluis") {
249 if !apiPaths(other["repos"]).has("tim/geheim") || !apiPaths(other["groups"]).has("kluis") {
241 t.Fatalf("api van ada mist privé: %#v %#v", other["repos"], other["groups"])
250 t.Fatalf("api van ada mist privé: %#v %#v", other["repos"], other["groups"])
242 }
251 }
252 if other["counts"].(map[string]any)["contributions"] != 2.0 {
253 t.Fatalf("api van ada telt verborgen bijdragen niet mee: %#v", other["counts"])
254 }
255 pubAPI := apiGet(t, ts.URL+"/api/v1/users/tim", "")
256 if _, ok := pubAPI["instance_admin"]; ok || pubAPI["language"] != nil {
257 t.Fatalf("anonieme api toont privévelden: %#v", pubAPI)
258 }
259 if apiPaths(pubAPI["repos"]).has("tim/geheim") || apiPaths(pubAPI["groups"]).has("kluis") || !apiPaths(pubAPI["repos"]).has("tim/zichtbaar") {
260 t.Fatalf("anonieme api filter: %#v %#v", pubAPI["repos"], pubAPI["groups"])
261 }
262 if pubAPI["counts"].(map[string]any)["contributions"] != 1.0 {
263 t.Fatalf("anonieme api lekt privébijdragen: %#v", pubAPI["counts"])
264 }
265 badTok, err := http.NewRequest(http.MethodGet, ts.URL+"/api/v1/users/tim", nil)
266 if err != nil {
267 t.Fatal(err)
268 }
269 badTok.Header.Set("Authorization", "Bearer bg_nietgeldig")
270 res, err = http.DefaultClient.Do(badTok)
271 if err != nil {
272 t.Fatal(err)
273 }
274 if res.StatusCode != http.StatusUnauthorized {
275 t.Fatalf("ongeldig token %d", res.StatusCode)
276 }
277 _ = res.Body.Close()
243 req, err := http.NewRequest(http.MethodPut, ts.URL+"/api/v1/user", strings.NewReader(`{"bio":"alleen bio"}`))
278 req, err := http.NewRequest(http.MethodPut, ts.URL+"/api/v1/user", strings.NewReader(`{"bio":"alleen bio"}`))
244 if err != nil {
279 if err != nil {
245 t.Fatal(err)
280 t.Fatal(err)
@@ -261,10 +296,34 @@ func TestProfilePage(t *testing.T) {
261 t.Fatal(err)
296 t.Fatal(err)
262 }
297 }
263 loc := res.Header.Get("Location")
298 loc := res.Header.Get("Location")
264 if res.StatusCode != http.StatusNotFound || loc != "" {
299 if res.StatusCode != http.StatusFound || loc != "/users/tim" {
265 t.Fatalf("/tim is %d locatie %q", res.StatusCode, loc)
300 t.Fatalf("/tim is %d locatie %q", res.StatusCode, loc)
266 }
301 }
267 _ = res.Body.Close()
302 _ = res.Body.Close()
303 res, err = noredir.Get(ts.URL + "/plein")
304 if err != nil {
305 t.Fatal(err)
306 }
307 if res.StatusCode != http.StatusNotFound || res.Header.Get("Location") != "" {
308 t.Fatalf("groepsnaam /plein is %d locatie %q", res.StatusCode, res.Header.Get("Location"))
309 }
310 _ = res.Body.Close()
311 res, err = noredir.Get(ts.URL + "/tim/zichtbaar")
312 if err != nil {
313 t.Fatal(err)
314 }
315 if res.StatusCode == http.StatusFound && strings.HasPrefix(res.Header.Get("Location"), "/users/") {
316 t.Fatalf("repositorypad wijst naar een profiel: %s", res.Header.Get("Location"))
317 }
318 _ = res.Body.Close()
319 res, err = noredir.Get(ts.URL + "/login")
320 if err != nil {
321 t.Fatal(err)
322 }
323 if strings.Contains(res.Header.Get("Location"), "/users/") {
324 t.Fatalf("login wijst naar een profiel: %s", res.Header.Get("Location"))
325 }
326 _ = res.Body.Close()
268 res, err = anon.Get(ts.URL + "/users/nobody")
327 res, err = anon.Get(ts.URL + "/users/nobody")
269 if err != nil {
328 if err != nil {
270 t.Fatal(err)
329 t.Fatal(err)
@@ -291,7 +350,9 @@ func apiGet(t *testing.T, rawURL, token string) map[string]any {
291 if err != nil {
350 if err != nil {
292 t.Fatal(err)
351 t.Fatal(err)
293 }
352 }
294 req.Header.Set("Authorization", "Bearer "+token)
353 if token != "" {
354 req.Header.Set("Authorization", "Bearer "+token)
355 }
295 res, err := http.DefaultClient.Do(req)
356 res, err := http.DefaultClient.Do(req)
296 if err != nil {
357 if err != nil {
297 t.Fatal(err)
358 t.Fatal(err)
internal/server/server.go +7 −0
@@ -107,6 +107,7 @@ func (s *Server) Handler() http.Handler {
107 107 mux.HandleFunc("POST /settings/ssh/delete", s.deleteSSH)
108 108 mux.HandleFunc("GET /settings/export", s.export)
109 109 mux.HandleFunc("GET /users/{username}", s.profile)
110 mux.HandleFunc("GET /{name}", s.userShort)
110 111 mux.HandleFunc("GET /groups/{path}", s.groupPage)
111 112 mux.HandleFunc("GET /groups/{path}/logo", s.groupLogo)
112 113 mux.HandleFunc("POST /groups/{path}/settings", s.saveGroup)
@@ -665,6 +666,12 @@ type RepoCard struct {
665 666 When string
666 667 }
667 668
669 // AccountLink is een naam die naar een profiel wijst.
670 type AccountLink struct {
671 Name string
672 URL string
673 }
674
668 675 // ProfileCard is het blok over een gebruiker, boven de activiteitenkalender.
669 676 type ProfileCard struct {
670 677 User store.User
@@ -107,6 +107,7 @@ func (s *Server) Handler() http.Handler {
107 mux.HandleFunc("POST /settings/ssh/delete", s.deleteSSH)
107 mux.HandleFunc("POST /settings/ssh/delete", s.deleteSSH)
108 mux.HandleFunc("GET /settings/export", s.export)
108 mux.HandleFunc("GET /settings/export", s.export)
109 mux.HandleFunc("GET /users/{username}", s.profile)
109 mux.HandleFunc("GET /users/{username}", s.profile)
110 mux.HandleFunc("GET /{name}", s.userShort)
110 mux.HandleFunc("GET /groups/{path}", s.groupPage)
111 mux.HandleFunc("GET /groups/{path}", s.groupPage)
111 mux.HandleFunc("GET /groups/{path}/logo", s.groupLogo)
112 mux.HandleFunc("GET /groups/{path}/logo", s.groupLogo)
112 mux.HandleFunc("POST /groups/{path}/settings", s.saveGroup)
113 mux.HandleFunc("POST /groups/{path}/settings", s.saveGroup)
@@ -665,6 +666,12 @@ type RepoCard struct {
665 When string
666 When string
666}
667}
667
668
669// AccountLink is een naam die naar een profiel wijst.
670type AccountLink struct {
671 Name string
672 URL string
673}
674
668// ProfileCard is het blok over een gebruiker, boven de activiteitenkalender.
675// ProfileCard is het blok over een gebruiker, boven de activiteitenkalender.
669type ProfileCard struct {
676type ProfileCard struct {
670 User store.User
677 User store.User
internal/server/templates/collab.html +2 −1
@@ -63,6 +63,7 @@
63 63 {{if .Target}}<span class="flowtarget">{{.Target}}</span>{{end}}
64 64 {{if .Confidential}}<span class="pill">{{t "issue.confidential"}}</span>{{end}}
65 65 {{range .Labels}}<span class="lab" style="background:{{.Color}}">{{.Name}}</span>{{end}}
66 {{range .People}}{{if .URL}}<a href="{{.URL}}">{{.Name}}</a>{{else}}{{.Name}}{{end}} {{end}}
66 67 {{if .Extra}}<span>{{.Extra}}</span>{{end}}
67 68 </p>
68 69 </div>
@@ -242,7 +243,7 @@
242 243 <section{{if ne .Tab "commits"}} hidden{{end}}>
243 244 <h2>{{t "mr.commits"}}</h2>
244 245 <ul class="clean">
245 {{range .Commits}}<li><a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}">{{.Subject}}</a> <span class="muted"><code>{{.Short}}</code> {{.Author}}</span></li>{{else}}<li class="muted">{{t "mr.noDiff"}}</li>{{end}}
246 {{range .Commits}}<li><a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}">{{.Subject}}</a> <span class="muted"><code>{{.Short}}</code> {{if .UserURL}}<a href="{{.UserURL}}">{{.Author}}</a>{{else}}{{.Author}}{{end}}</span></li>{{else}}<li class="muted">{{t "mr.noDiff"}}</li>{{end}}
246 247 </ul>
247 248 </section>
248 249 <section{{if ne .Tab "pipelines"}} hidden{{end}}>
@@ -63,6 +63,7 @@
63 {{if .Target}}<span class="flowtarget">{{.Target}}</span>{{end}}
63 {{if .Target}}<span class="flowtarget">{{.Target}}</span>{{end}}
64 {{if .Confidential}}<span class="pill">{{t "issue.confidential"}}</span>{{end}}
64 {{if .Confidential}}<span class="pill">{{t "issue.confidential"}}</span>{{end}}
65 {{range .Labels}}<span class="lab" style="background:{{.Color}}">{{.Name}}</span>{{end}}
65 {{range .Labels}}<span class="lab" style="background:{{.Color}}">{{.Name}}</span>{{end}}
66 {{range .People}}{{if .URL}}<a href="{{.URL}}">{{.Name}}</a>{{else}}{{.Name}}{{end}} {{end}}
66 {{if .Extra}}<span>{{.Extra}}</span>{{end}}
67 {{if .Extra}}<span>{{.Extra}}</span>{{end}}
67 </p>
68 </p>
68 </div>
69 </div>
@@ -242,7 +243,7 @@
242<section{{if ne .Tab "commits"}} hidden{{end}}>
243<section{{if ne .Tab "commits"}} hidden{{end}}>
243 <h2>{{t "mr.commits"}}</h2>
244 <h2>{{t "mr.commits"}}</h2>
244 <ul class="clean">
245 <ul class="clean">
245 {{range .Commits}}<li><a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}">{{.Subject}}</a> <span class="muted"><code>{{.Short}}</code> {{.Author}}</span></li>{{else}}<li class="muted">{{t "mr.noDiff"}}</li>{{end}}
246 {{range .Commits}}<li><a href="/{{$.Repo.FullPath}}/-/commit/{{.SHA}}">{{.Subject}}</a> <span class="muted"><code>{{.Short}}</code> {{if .UserURL}}<a href="{{.UserURL}}">{{.Author}}</a>{{else}}{{.Author}}{{end}}</span></li>{{else}}<li class="muted">{{t "mr.noDiff"}}</li>{{end}}
246 </ul>
247 </ul>
247</section>
248</section>
248<section{{if ne .Tab "pipelines"}} hidden{{end}}>
249<section{{if ne .Tab "pipelines"}} hidden{{end}}>
internal/server/templates/issues.html +1 −1
@@ -81,7 +81,7 @@
81 81 {{if eq .Issues.One.Status "closed"}}<span class="pill">{{t "issue.closed"}}</span>{{else}}<span class="pill">{{t "issue.open"}}</span>{{end}}
82 82 {{if .Issues.One.Confidential}}<span class="pill">{{t "issue.confidential"}}</span>{{end}}
83 83 {{range .Issues.One.Labels}}<span class="lab" style="background:{{.Color}}">{{.Name}}</span>{{end}}
84 <span class="muted">{{t "issue.by"}} {{if .Issues.One.AuthorURL}}<a href="{{.Issues.One.AuthorURL}}">{{.Issues.One.Author}}</a>{{else}}{{.Issues.One.Author}}{{end}}{{if .Issues.One.Assignees}} · {{.Issues.One.Assignees}}{{end}}{{if .Issues.One.Milestone}} · {{.Issues.One.Milestone}}{{end}}{{if .Issues.One.Due}} · {{.Issues.One.Due}}{{end}}</span>
84 <span class="muted">{{t "issue.by"}} {{if .Issues.One.AuthorURL}}<a href="{{.Issues.One.AuthorURL}}">{{.Issues.One.Author}}</a>{{else}}{{.Issues.One.Author}}{{end}}{{range .Issues.One.People}} · {{if .URL}}<a href="{{.URL}}">{{.Name}}</a>{{else}}{{.Name}}{{end}}{{end}}{{if .Issues.One.Milestone}} · {{.Issues.One.Milestone}}{{end}}{{if .Issues.One.Due}} · {{.Issues.One.Due}}{{end}}</span>
85 85 </p>
86 86 <div class="mdbody">{{.Issues.One.HTML}}</div>
87 87 {{if .Issues.Related}}
@@ -81,7 +81,7 @@
81 {{if eq .Issues.One.Status "closed"}}<span class="pill">{{t "issue.closed"}}</span>{{else}}<span class="pill">{{t "issue.open"}}</span>{{end}}
81 {{if eq .Issues.One.Status "closed"}}<span class="pill">{{t "issue.closed"}}</span>{{else}}<span class="pill">{{t "issue.open"}}</span>{{end}}
82 {{if .Issues.One.Confidential}}<span class="pill">{{t "issue.confidential"}}</span>{{end}}
82 {{if .Issues.One.Confidential}}<span class="pill">{{t "issue.confidential"}}</span>{{end}}
83 {{range .Issues.One.Labels}}<span class="lab" style="background:{{.Color}}">{{.Name}}</span>{{end}}
83 {{range .Issues.One.Labels}}<span class="lab" style="background:{{.Color}}">{{.Name}}</span>{{end}}
84 <span class="muted">{{t "issue.by"}} {{if .Issues.One.AuthorURL}}<a href="{{.Issues.One.AuthorURL}}">{{.Issues.One.Author}}</a>{{else}}{{.Issues.One.Author}}{{end}}{{if .Issues.One.Assignees}} · {{.Issues.One.Assignees}}{{end}}{{if .Issues.One.Milestone}} · {{.Issues.One.Milestone}}{{end}}{{if .Issues.One.Due}} · {{.Issues.One.Due}}{{end}}</span>
84 <span class="muted">{{t "issue.by"}} {{if .Issues.One.AuthorURL}}<a href="{{.Issues.One.AuthorURL}}">{{.Issues.One.Author}}</a>{{else}}{{.Issues.One.Author}}{{end}}{{range .Issues.One.People}} · {{if .URL}}<a href="{{.URL}}">{{.Name}}</a>{{else}}{{.Name}}{{end}}{{end}}{{if .Issues.One.Milestone}} · {{.Issues.One.Milestone}}{{end}}{{if .Issues.One.Due}} · {{.Issues.One.Due}}{{end}}</span>
85</p>
85</p>
86<div class="mdbody">{{.Issues.One.HTML}}</div>
86<div class="mdbody">{{.Issues.One.HTML}}</div>
87{{if .Issues.Related}}
87{{if .Issues.Related}}