File tree 4 files changed +12
-12
lines changed
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) {
113
113
pager .AddParam (ctx , "state" , "State" )
114
114
ctx .Data ["Page" ] = pager
115
115
116
- ctx .Data ["CanWriteProjects" ] = true
116
+ ctx .Data ["CanWriteProjects" ] = ctx . Repo . Permission . CanWrite ( unit . TypeProjects )
117
117
ctx .Data ["IsShowClosed" ] = isShowClosed
118
118
ctx .Data ["IsProjectsPage" ] = true
119
119
ctx .Data ["SortType" ] = sortType
Original file line number Diff line number Diff line change 51
51
{{JsPrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}}
52
52
</span>
53
53
</div>
54
- {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
54
+ {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
55
55
<div class="ui right operate">
56
56
<a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Title}}>{{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}}</a>
57
57
{{if .IsClosed}}
58
58
<a class="link-action" href data-url="{{$.Link}}/{{.ID}}/open">{{svg "octicon-check"}} {{$.locale.Tr "repo.projects.open"}}</a>
59
59
{{else}}
60
60
<a class="link-action" href data-url="{{$.Link}}/{{.ID}}/close">{{svg "octicon-skip"}} {{$.locale.Tr "repo.projects.close"}}</a>
61
61
{{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>
63
63
</div>
64
64
{{end}}
65
65
{{if .Description}}
75
75
</div>
76
76
</div>
77
77
78
- {{if or .CanWriteIssues .CanWritePulls }}
78
+ {{if $.CanWriteProjects }}
79
79
<div class="ui small basic delete modal">
80
80
<div class="ui icon header">
81
81
{{svg "octicon-trash"}}
Original file line number Diff line number Diff line change 43
43
<h2 class="project-title">{{$.Project.Title}}</h2>
44
44
<div class="content project-description">{{$.Project.RenderedContent|Str2html}}</div>
45
45
</div>
46
- {{if or $.CanWriteIssues $.CanWritePulls }}
46
+ {{if $.CanWriteProjects }}
47
47
<div class="column right aligned">
48
48
<div class="ui compact right small menu">
49
49
<a class="item" href="{{$.Link}}/edit?redirect=project" data-id={{$.Project.ID}} data-title={{$.Project.Title}}>
256
256
257
257
</div>
258
258
259
- {{if or .CanWriteIssues .CanWritePulls }}
259
+ {{if .CanWriteProjects }}
260
260
<div class="ui small basic delete modal">
261
261
<div class="ui icon header">
262
262
{{svg "octicon-trash"}}
Original file line number Diff line number Diff line change 53
53
{{JsPrettyNumber .NumClosedIssues}} {{$.locale.Tr "repo.issues.closed_title"}}
54
54
</span>
55
55
</div>
56
- {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}}
56
+ {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
57
57
<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>
59
59
{{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>
61
61
{{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>
63
63
{{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>
65
65
</div>
66
66
{{end}}
67
67
{{if .Description}}
77
77
</div>
78
78
</div>
79
79
80
- {{if or .CanWriteIssues .CanWritePulls }}
80
+ {{if .CanWriteProjects }}
81
81
<div class="ui small basic delete modal">
82
82
<div class="ui icon header">
83
83
{{svg "octicon-trash"}}
You can’t perform that action at this time.
0 commit comments