File tree 4 files changed +11
-7
lines changed
4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,10 @@ func RegisterRoutes(m *macaron.Macaron) {
253
253
}
254
254
255
255
m .Use (user .GetNotificationCount )
256
+ m .Use (func (ctx * context.Context ) {
257
+ ctx .Data ["GlobalEnableWiki" ] = setting .Repository .EnableWiki
258
+ ctx .Data ["GlobalEnableIssues" ] = setting .Repository .EnableIssues
259
+ })
256
260
257
261
// FIXME: not all routes need go through same middlewares.
258
262
// Especially some AJAX requests, we can reduce middleware number to improve performance.
Original file line number Diff line number Diff line change 10
10
11
11
{{if .IsSigned}}
12
12
<a class="item {{if .PageIsDashboard}}active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "dashboard"}}</a>
13
- {{if .Repository.EnableIssues }}
13
+ {{if .GlobalEnableIssues }}
14
14
<a class="item {{if .PageIsIssues}}active{{end}}" href="{{AppSubUrl}}/issues">{{.i18n.Tr "issues"}}</a>
15
15
{{end}}
16
16
<a class="item {{if .PageIsPulls}}active{{end}}" href="{{AppSubUrl}}/pulls">{{.i18n.Tr "pull_requests"}}</a>
Original file line number Diff line number Diff line change 55
55
</a>
56
56
{{end}}
57
57
58
- {{if and .Repository.EnableIssues (.Permission.CanRead $.UnitTypeIssues)}}
58
+ {{if and .GlobalEnableIssues (.Permission.CanRead $.UnitTypeIssues)}}
59
59
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
60
60
<i class="octicon octicon-issue-opened"></i> {{.i18n.Tr "repo.issues"}} <span class="ui {{if not .Repository.NumOpenIssues}}gray{{else}}blue{{end}} small label">{{.Repository.NumOpenIssues}}</span>
61
61
</a>
62
62
{{end}}
63
63
64
- {{if and .Repository.EnableIssues (.Permission.CanRead $.UnitTypeExternalTracker)}}
64
+ {{if and .GlobalEnableIssues (.Permission.CanRead $.UnitTypeExternalTracker)}}
65
65
<a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer">
66
66
<i class="octicon octicon-link-external"></i> {{.i18n.Tr "repo.issues"}} </span>
67
67
</a>
79
79
</a>
80
80
{{end}}
81
81
82
- {{if and .Repository.EnableWiki (or (.Permission.CanRead $.UnitTypeWiki) (.Permission.CanRead $.UnitTypeExternalWiki))}}
82
+ {{if and .GlobalEnableWiki (or (.Permission.CanRead $.UnitTypeWiki) (.Permission.CanRead $.UnitTypeExternalWiki))}}
83
83
<a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki" {{if (.Permission.CanRead $.UnitTypeExternalWiki)}} target="_blank" rel="noopener noreferrer" {{end}}>
84
84
<i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
85
85
</a>
Original file line number Diff line number Diff line change 109
109
{{.i18n.Tr "repo.settings.advanced_settings"}}
110
110
</h4>
111
111
<div class="ui attached segment">
112
- {{if and (not .Repository.EnableWiki ) (not .Repository.EnableIssues ) (not .Repository.CanEnablePulls)}}
112
+ {{if and (not .GlobalEnableWiki ) (not .GlobalEnableIssues ) (not .Repository.CanEnablePulls)}}
113
113
<div class="inline field">
114
114
<label>{{.i18n.Tr "repo.wiki.disabled"}}</label>
115
115
</div>
121
121
{{.CsrfTokenHtml}}
122
122
<input type="hidden" name="action" value="advanced">
123
123
124
- {{if .Repository.EnableWiki }}
124
+ {{if .GlobalEnableWiki }}
125
125
{{$isWikiEnabled := or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
126
126
<div class="inline field">
127
127
<label>{{.i18n.Tr "repo.wiki"}}</label>
157
157
158
158
<div class="ui divider"></div>
159
159
160
- {{if .Repository.EnableIssues }}
160
+ {{if .GlobalEnableIssues }}
161
161
{{$isIssuesEnabled := or (.Repository.UnitEnabled $.UnitTypeIssues) (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}
162
162
<div class="inline field">
163
163
<label>{{.i18n.Tr "repo.issues"}}</label>
You can’t perform that action at this time.
0 commit comments