1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-04 00:28:36 +00:00

Refactor template ctx and render utils (#32422)

Clean up the templates
This commit is contained in:
wxiaoguang
2024-11-05 14:04:26 +08:00
committed by GitHub
parent b068dbd40e
commit 4a469c8e1b
53 changed files with 281 additions and 205 deletions

View File

@@ -61,11 +61,11 @@
{{if (not $unit.Type.UnitGlobalDisabled)}}
<tr>
<td><strong>{{ctx.Locale.Tr $unit.NameKey}}</strong></td>
<td>{{if eq ($.Team.UnitAccessMode $.Context $unit.Type) 0 -}}
<td>{{if eq ($.Team.UnitAccessMode ctx $unit.Type) 0 -}}
{{ctx.Locale.Tr "org.teams.none_access"}}
{{- else if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1) -}}
{{- else if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode ctx $unit.Type) 1) -}}
{{ctx.Locale.Tr "org.teams.read_access"}}
{{- else if eq ($.Team.UnitAccessMode $.Context $unit.Type) 2 -}}
{{- else if eq ($.Team.UnitAccessMode ctx $unit.Type) 2 -}}
{{ctx.Locale.Tr "org.teams.write_access"}}
{{- end}}</td>
</tr>