]> source.dussan.org Git - gitea.git/commitdiff
Added title and action buttons to Project view page (#13437)
authorMohammad Hadi Hosseinpour <wp.parsi@gmail.com>
Tue, 10 Nov 2020 03:46:19 +0000 (07:16 +0330)
committerGitHub <noreply@github.com>
Tue, 10 Nov 2020 03:46:19 +0000 (22:46 -0500)
* 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 <art27@cantab.net>
* Fix indentation templates/repo/projects/view.tmpl (2nd)

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
routers/repo/projects.go
templates/repo/projects/list.tmpl
templates/repo/projects/view.tmpl

index 948f88375efc4caf2dff3ca9d6bb9b0f9fedd9dd..07327df9eb06dc1d53b4fbb7f265c6334cbcfc33 100644 (file)
@@ -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
index 35c3c00f44c048cd18a25f49851c3ceec9eb5d97..c7ee628316c3bf9971142413581ed865272673d1 100644 (file)
@@ -57,7 +57,7 @@
                                                {{if .IsClosed}}
                                                        <a class="link-action" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check"}} {{$.i18n.Tr "repo.projects.open"}}</a>
                                                {{else}}
-                                                       <a class="link-action" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-x"}} {{$.i18n.Tr "repo.projects.close"}}</a>
+                                                       <a class="link-action" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-skip"}} {{$.i18n.Tr "repo.projects.close"}}</a>
                                                {{end}}
                                                <a class="delete-button" href="#" data-url="{{$.RepoLink}}/projects/{{.ID}}/delete" data-id="{{.ID}}">{{svg "octicon-trashcan"}} {{$.i18n.Tr "repo.issues.label_delete"}}</a>
                                        </div>
index c25a05c5c789f131f8ecc1425fb235fd24014b01..ee82f240102416d3702d9f1dbc1fa944189941ed 100644 (file)
                        </div>
                </div>
                <div class="ui divider"></div>
+               <div class="ui two column stackable grid">
+                       <div class="column">
+                               <h2 class="project-title">{{$.Project.Title}}</h2>
+                               <div class="content project-description">{{$.Project.RenderedContent|Str2html}}</div>
+                       </div>
+                       {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
+                               <div class="column right aligned">
+                                       <div class="ui compact right small menu">
+                                               <a class="item" href="{{$.RepoLink}}/projects/{{.Project.ID}}/edit" data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
+                                                       {{svg "octicon-pencil"}}
+                                                       <span class="mx-3">{{$.i18n.Tr "repo.issues.label_edit"}}</span>
+                                               </a>
+                                               {{if .Project.IsClosed}}
+                                                       <a class="item link-action" href data-url="{{$.RepoLink}}/projects/{{.Project.ID}}/open">
+                                                               {{svg "octicon-check"}}
+                                                               <span class="mx-3">{{$.i18n.Tr "repo.projects.open"}}</span>
+                                                       </a>
+                                               {{else}}
+                                                       <a class="item link-action" href data-url="{{$.RepoLink}}/projects/{{.Project.ID}}/close">
+                                                               {{svg "octicon-skip"}}
+                                                               <span class="mx-3">{{$.i18n.Tr "repo.projects.close"}}</span>
+                                                       </a>
+                                               {{end}}
+                                               <a class="item delete-button" href="#" data-url="{{$.RepoLink}}/projects/{{.Project.ID}}/delete" data-id="{{.Project.ID}}">
+                                                       {{svg "octicon-trashcan"}}
+                                                       <span class="mx-3">{{$.i18n.Tr "repo.issues.label_delete"}}</span>
+                                               </a>
+                                       </div>
+                               </div>
+                       {{end}}
+               </div>
+               <div class="ui divider"></div>
        </div>
-
        <div class="ui container fluid padded" id="project-board">
 
                <div class="board">
 
 </div>
 
+{{if or .CanWriteIssues .CanWritePulls}}
+       <div class="ui small basic delete modal">
+               <div class="ui icon header">
+                       {{svg "octicon-trashcan"}}
+                       {{.i18n.Tr "repo.projects.deletion"}}
+               </div>
+               <div class="content">
+                       <p>{{.i18n.Tr "repo.projects.deletion_desc"}}</p>
+               </div>
+               <div class="actions">
+                       <div class="ui red basic inverted cancel button">
+                               <i class="remove icon"></i>
+                               {{.i18n.Tr "modal.no"}}
+                       </div>
+                       <div class="ui green basic inverted ok button">
+                               <i class="checkmark icon"></i>
+                               {{.i18n.Tr "modal.yes"}}
+                       </div>
+               </div>
+       </div>
+{{end}}
+
 {{template "base/footer" .}}