Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions models/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const (
UnitTypeExternalTracker // 7 ExternalTracker
)

// Value returns integer value for unit type
func (u UnitType) Value() int {
return int(u)
}

func (u UnitType) String() string {
switch u {
case UnitTypeCode:
Expand Down
2 changes: 1 addition & 1 deletion templates/org/team/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{{range $t, $unit := $.Units}}
<div class="field">
<div class="ui toggle checkbox">
<input type="checkbox" class="hidden" name="units" value="{{$unit.Type}}"{{if or (eq $.Team.ID 0) ($.Team.UnitEnabled $unit.Type)}} checked{{end}}>
<input type="checkbox" class="hidden" name="units" value="{{$unit.Type.Value}}"{{if or (eq $.Team.ID 0) ($.Team.UnitEnabled $unit.Type)}} checked{{end}}>
<label>{{$.i18n.Tr $unit.NameKey}}</label>
<span class="help">{{$.i18n.Tr $unit.DescKey}}</span>
</div>
Expand Down