File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ func Projects(ctx *context.Context) {
113113 pager .AddParam (ctx , "state" , "State" )
114114 ctx .Data ["Page" ] = pager
115115
116- ctx .Data ["CanWriteProjects" ] = true
116+ ctx .Data ["CanWriteProjects" ] = ctx . Repo . Permission . CanWrite ( unit . TypeProjects )
117117 ctx .Data ["IsShowClosed" ] = isShowClosed
118118 ctx .Data ["IsProjectsPage" ] = true
119119 ctx .Data ["SortType" ] = sortType
Original file line number Diff line number Diff line change 5151 {{JsPrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}}
5252 </span>
5353 </div>
54- {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
54+ {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
5555 <div class="ui right operate">
5656 <a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Title}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
5757 {{if .IsClosed}}
5858 <a class="link-action" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check"}} {{$.locale.Tr "repo.projects.open"}}</a>
5959 {{else}}
6060 <a class="link-action" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-skip"}} {{$.locale.Tr "repo.projects.close"}}</a>
6161 {{end}}
62- <a class="delete-button" href="#" data-url="{{$.RepoLink}}/projects /{{.ID}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
62+ <a class="delete-button" href="#" data-url="{{$.Link}} /{{.ID}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
6363 </div>
6464 {{end}}
6565 {{if .Description}}
7575 </div>
7676</div>
7777
78- {{if or .CanWriteIssues .CanWritePulls }}
78+ {{if $.CanWriteProjects }}
7979<div class="ui small basic delete modal">
8080 <div class="ui icon header">
8181 {{svg "octicon-trash"}}
Original file line number Diff line number Diff line change 4343 <h2 class="project-title">{{$.Project.Title}}</h2>
4444 <div class="content project-description">{{$.Project.RenderedContent|Str2html}}</div>
4545 </div>
46- {{if or $.CanWriteIssues $.CanWritePulls }}
46+ {{if $.CanWriteProjects }}
4747 <div class="column right aligned">
4848 <div class="ui compact right small menu">
4949 <a class="item" href="{{$.Link}}/edit?redirect=project" data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
256256
257257</div>
258258
259- {{if or .CanWriteIssues .CanWritePulls }}
259+ {{if .CanWriteProjects }}
260260 <div class="ui small basic delete modal">
261261 <div class="ui icon header">
262262 {{svg "octicon-trash"}}
Original file line number Diff line number Diff line change 5353 {{JsPrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}}
5454 </span>
5555 </div>
56- {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
56+ {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
5757 <div class="ui right operate">
58- <a href="{{$ .Link}}/{{.ID }}/edit" data-id={{.ID}} data-title={{.Title}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
58+ <a href="{{.Link}}/edit" data-id={{.ID}} data-title={{.Title}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
5959 {{if .IsClosed}}
60- <a class="link-action" href data-url="{{$ .Link}}/{{.ID }}/open">{{svg "octicon-check"}} {{$.locale.Tr "repo.projects.open"}}</a>
60+ <a class="link-action" href data-url="{{.Link}}/open">{{svg "octicon-check"}} {{$.locale.Tr "repo.projects.open"}}</a>
6161 {{else}}
62- <a class="link-action" href data-url="{{$ .Link}}/{{.ID }}/close">{{svg "octicon-skip"}} {{$.locale.Tr "repo.projects.close"}}</a>
62+ <a class="link-action" href data-url="{{.Link}}/close">{{svg "octicon-skip"}} {{$.locale.Tr "repo.projects.close"}}</a>
6363 {{end}}
64- <a class="delete-button" href="#" data-url="{{$.RepoLink}}/projects/{{.ID }}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
64+ <a class="delete-button" href="#" data-url="{{.Link }}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}}</a>
6565 </div>
6666 {{end}}
6767 {{if .Description}}
7777 </div>
7878</div>
7979
80- {{if or .CanWriteIssues .CanWritePulls }}
80+ {{if .CanWriteProjects }}
8181<div class="ui small basic delete modal">
8282 <div class="ui icon header">
8383 {{svg "octicon-trash"}}
You can’t perform that action at this time.
0 commit comments