File tree Expand file tree Collapse file tree 4 files changed +11
-7
lines changed Expand file tree Collapse file tree 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) {
253253 }
254254
255255 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+ })
256260
257261 // FIXME: not all routes need go through same middlewares.
258262 // Especially some AJAX requests, we can reduce middleware number to improve performance.
Original file line number Diff line number Diff line change 1010
1111 {{if .IsSigned}}
1212 <a class="item {{if .PageIsDashboard}}active{{end}}" href="{{AppSubUrl}}/">{{.i18n.Tr "dashboard"}}</a>
13- {{if .Repository.EnableIssues }}
13+ {{if .GlobalEnableIssues }}
1414 <a class="item {{if .PageIsIssues}}active{{end}}" href="{{AppSubUrl}}/issues">{{.i18n.Tr "issues"}}</a>
1515 {{end}}
1616 <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 5555 </a>
5656 {{end}}
5757
58- {{if and .Repository.EnableIssues (.Permission.CanRead $.UnitTypeIssues)}}
58+ {{if and .GlobalEnableIssues (.Permission.CanRead $.UnitTypeIssues)}}
5959 <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoLink}}/issues">
6060 <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>
6161 </a>
6262 {{end}}
6363
64- {{if and .Repository.EnableIssues (.Permission.CanRead $.UnitTypeExternalTracker)}}
64+ {{if and .GlobalEnableIssues (.Permission.CanRead $.UnitTypeExternalTracker)}}
6565 <a class="{{if .PageIsIssueList}}active{{end}} item" href="{{.RepoExternalIssuesLink}}" target="_blank" rel="noopener noreferrer">
6666 <i class="octicon octicon-link-external"></i> {{.i18n.Tr "repo.issues"}} </span>
6767 </a>
7979 </a>
8080 {{end}}
8181
82- {{if and .Repository.EnableWiki (or (.Permission.CanRead $.UnitTypeWiki) (.Permission.CanRead $.UnitTypeExternalWiki))}}
82+ {{if and .GlobalEnableWiki (or (.Permission.CanRead $.UnitTypeWiki) (.Permission.CanRead $.UnitTypeExternalWiki))}}
8383 <a class="{{if .PageIsWiki}}active{{end}} item" href="{{.RepoLink}}/wiki" {{if (.Permission.CanRead $.UnitTypeExternalWiki)}} target="_blank" rel="noopener noreferrer" {{end}}>
8484 <i class="octicon octicon-book"></i> {{.i18n.Tr "repo.wiki"}}
8585 </a>
Original file line number Diff line number Diff line change 109109 {{.i18n.Tr "repo.settings.advanced_settings"}}
110110 </h4>
111111 <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)}}
113113 <div class="inline field">
114114 <label>{{.i18n.Tr "repo.wiki.disabled"}}</label>
115115 </div>
121121 {{.CsrfTokenHtml}}
122122 <input type="hidden" name="action" value="advanced">
123123
124- {{if .Repository.EnableWiki }}
124+ {{if .GlobalEnableWiki }}
125125 {{$isWikiEnabled := or (.Repository.UnitEnabled $.UnitTypeWiki) (.Repository.UnitEnabled $.UnitTypeExternalWiki)}}
126126 <div class="inline field">
127127 <label>{{.i18n.Tr "repo.wiki"}}</label>
157157
158158 <div class="ui divider"></div>
159159
160- {{if .Repository.EnableIssues }}
160+ {{if .GlobalEnableIssues }}
161161 {{$isIssuesEnabled := or (.Repository.UnitEnabled $.UnitTypeIssues) (.Repository.UnitEnabled $.UnitTypeExternalTracker)}}
162162 <div class="inline field">
163163 <label>{{.i18n.Tr "repo.issues"}}</label>
You can’t perform that action at this time.
0 commit comments