Skip to content

Commit 676a257

Browse files
committed
Fix creating new org teams
regression from go-gitea#18518
1 parent 9cbeab4 commit 676a257

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

templates/org/team/new.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@
101101
</td>
102102
<td class="center aligned">
103103
<div class="ui radio checkbox">
104-
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="0"{{if or ($unit.Type.UnitGlobalDisabled) (eq ($.Team.UnitAccessMode $unit.Type) 0)}} checked{{end}}>
104+
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="0"{{if or ($unit.Type.UnitGlobalDisabled) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 0)}} checked{{end}}>
105105
</div>
106106
</td>
107107
<td class="center aligned">
108108
<div class="ui radio checkbox">
109-
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
109+
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
110110
</div>
111111
</td>
112112
<td class="center aligned">
113113
<div class="ui radio checkbox">
114-
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="2"{{if (eq ($.Team.UnitAccessMode $unit.Type) 2)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
114+
<input type="radio" class="hidden" name="unit_{{$unit.Type.Value}}" value="2"{{if (eq ($.Team.UnitAccessMode $.Context $unit.Type) 2)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
115115
</div>
116116
</td>
117117
</tr>
@@ -123,7 +123,7 @@
123123
{{if lt $unit.MaxPerm 2}}
124124
<div {{if $unit.Type.UnitGlobalDisabled}}class="field tooltip" data-content="{{$.i18n.Tr "repo.unit_disabled"}}"{{else}}class="field"{{end}}>
125125
<div class="ui checkbox">
126-
<input type="checkbox" class="hidden" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
126+
<input type="checkbox" class="hidden" name="unit_{{$unit.Type.Value}}" value="1"{{if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1)}} checked{{end}} {{if $unit.Type.UnitGlobalDisabled}}disabled{{end}}>
127127
<label>{{$.i18n.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{$.i18n.Tr "org.team_unit_disabled"}}{{end}}</label>
128128
<span class="help">{{$.i18n.Tr $unit.DescKey}}</span>
129129
</div>

templates/org/team/sidebar.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@
6161
{{if and (lt $unit.MaxPerm 2) (not $unit.Type.UnitGlobalDisabled)}}
6262
<tr>
6363
<td><strong>{{$.i18n.Tr $unit.NameKey}}</strong></td>
64-
<td>{{if eq ($.Team.UnitAccessMode $unit.Type) 0 -}}
64+
<td>{{if eq ($.Team.UnitAccessMode $.Context $unit.Type) 0 -}}
6565
{{$.i18n.Tr "org.teams.none_access"}}
66-
{{- else if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $unit.Type) 1) -}}
66+
{{- else if or (eq $.Team.ID 0) (eq ($.Team.UnitAccessMode $.Context $unit.Type) 1) -}}
6767
{{$.i18n.Tr "org.teams.read_access"}}
68-
{{- else if eq ($.Team.UnitAccessMode $unit.Type) 2 -}}
68+
{{- else if eq ($.Team.UnitAccessMode $.Context $unit.Type) 2 -}}
6969
{{$.i18n.Tr "org.teams.write_access"}}
7070
{{- end}}</td>
7171
</tr>

0 commit comments

Comments
 (0)