From 0bccc262d4b2359f747bdad7b9544f5b0f92d112 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 22 Oct 2019 16:04:07 -0500 Subject: [PATCH 1/2] Improve OGP Signed-off-by: jolheiser --- templates/base/head.tmpl | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index ae2b6b954d60..c0686ca93e08 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -131,16 +131,25 @@ - + {{if .Owner.Description}} + + {{end}} {{else if .Repository}} - + {{if .Issue}} + + + {{if .Issue.Content}} + + {{end}} + {{else}} + + + {{if .Repository.Description}} + + {{end}} + {{end}} - - {{if .Repository.Description}} - - {{end}} - {{else}} @@ -148,6 +157,7 @@ {{end}} + {{if .IsSigned }} {{ if ne .SignedUser.Theme "gitea" }} From 7f5cea2b42bbff66bad2ebacf8865fdd7a051079 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 22 Oct 2019 21:26:32 -0500 Subject: [PATCH 2/2] Ensure Repo is loaded when checking Pull info Signed-off-by: jolheiser --- routers/repo/pull.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 4001e3a4f80e..4b73571e6635 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -242,6 +242,10 @@ func checkPullInfo(ctx *context.Context) *models.Issue { ctx.ServerError("LoadPoster", err) return nil } + if err := issue.LoadRepo(); err != nil { + ctx.ServerError("LoadRepo", err) + return nil + } ctx.Data["Title"] = fmt.Sprintf("#%d - %s", issue.Index, issue.Title) ctx.Data["Issue"] = issue