From beab1dd337250cdef4e4a7588a19e7d711eb870e Mon Sep 17 00:00:00 2001 From: Mohammad Hadi Hosseinpour Date: Tue, 10 Nov 2020 07:16:19 +0330 Subject: [PATCH] Added title and action buttons to Project view page (#13437) * Added title and action buttons to Project view page * Changed octicon for project close action * Fix indentation in templates/repo/projects/view.tmpl Co-authored-by: zeripath * Fix indentation templates/repo/projects/view.tmpl (2nd) Co-authored-by: techknowlogick Co-authored-by: zeripath --- routers/repo/projects.go | 2 ++ templates/repo/projects/list.tmpl | 2 +- templates/repo/projects/view.tmpl | 55 ++++++++++++++++++++++++++++++- 3 files changed, 57 insertions(+), 2 deletions(-) diff --git a/routers/repo/projects.go b/routers/repo/projects.go index 948f88375e..07327df9eb 100644 --- a/routers/repo/projects.go +++ b/routers/repo/projects.go @@ -291,6 +291,8 @@ func ViewProject(ctx *context.Context) { return } + project.RenderedContent = string(markdown.Render([]byte(project.Description), ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas())) + ctx.Data["CanWriteProjects"] = ctx.Repo.Permission.CanWrite(models.UnitTypeProjects) ctx.Data["Project"] = project ctx.Data["Boards"] = allBoards diff --git a/templates/repo/projects/list.tmpl b/templates/repo/projects/list.tmpl index 35c3c00f44..c7ee628316 100644 --- a/templates/repo/projects/list.tmpl +++ b/templates/repo/projects/list.tmpl @@ -57,7 +57,7 @@ {{if .IsClosed}} {{svg "octicon-check"}} {{$.i18n.Tr "repo.projects.open"}} {{else}} - {{svg "octicon-x"}} {{$.i18n.Tr "repo.projects.close"}} + {{svg "octicon-skip"}} {{$.i18n.Tr "repo.projects.close"}} {{end}} {{svg "octicon-trashcan"}} {{$.i18n.Tr "repo.issues.label_delete"}} diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index c25a05c5c7..ee82f24010 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -34,8 +34,39 @@
+
+
+

{{$.Project.Title}}

+
{{$.Project.RenderedContent|Str2html}}
+
+ {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} + + {{end}} +
+
-
@@ -146,4 +177,26 @@
+{{if or .CanWriteIssues .CanWritePulls}} + +{{end}} + {{template "base/footer" .}}