Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move team units with limited max level below units table #20

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
8 changes: 4 additions & 4 deletions options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ commits.signed_by_untrusted_user = Signed by untrusted user
commits.signed_by_untrusted_user_unmatched = Signed by untrusted user who does not match committer
commits.gpg_key_id = GPG Key ID

ext_issues = Ext. Issues
ext_issues = Access to External Issues
ext_issues.desc = Link to an external issue tracker.

projects = Projects
Expand Down Expand Up @@ -1559,7 +1559,7 @@ signing.wont_sign.commitssigned = The merge will not be signed as all the associ
signing.wont_sign.approved = The merge will not be signed as the PR is not approved
signing.wont_sign.not_signed_in = You are not signed in

ext_wiki = Ext. Wiki
ext_wiki = Access to External Wiki
ext_wiki.desc = Link to an external wiki.

wiki = Wiki
Expand Down Expand Up @@ -2238,9 +2238,9 @@ teams.none_access = No Access
teams.none_access_helper = Members cannot view or do any other action on this unit.
teams.general_access = General Access
teams.general_access_helper = Members permissions will be decided by below permission table.
teams.read_access = Read Access
teams.read_access = Read
teams.read_access_helper = Members can view and clone team repositories.
teams.write_access = Write Access
teams.write_access = Write
teams.write_access_helper = Members can read and push to team repositories.
teams.admin_access = Administrator Access
teams.admin_access_helper = Members can pull and push to team repositories and add collaborators to them.
Expand Down
75 changes: 45 additions & 30 deletions templates/org/team/new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -89,40 +89,55 @@
</thead>
<tbody>
{{range $t, $unit := $.Units}}
<tr>
<td>
{{if $unit.Type.UnitGlobalDisabled}}
<div class="field tooltip" data-content="{{$.i18n.Tr "repo.unit_disabled"}}">
{{else}}
<div class="field">
{{end}}
<div class="ui">
<label>{{$.i18n.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{$.i18n.Tr "org.team_unit_disabled"}}{{end}}</label>
<span class="help">{{$.i18n.Tr $unit.DescKey}}</span>
{{if ge $unit.MaxPerms 2}}
<tr>
<td>
{{if $unit.Type.UnitGlobalDisabled}}
<div class="field tooltip" data-content="{{$.i18n.Tr "repo.unit_disabled"}}">
{{else}}
<div class="field">
{{end}}
<div class="ui">
<label>{{$.i18n.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{$.i18n.Tr "org.team_unit_disabled"}}{{end}}</label>
<span class="help">{{$.i18n.Tr $unit.DescKey}}</span>
</div>
</div>
</div>
</td>
<td class="center aligned">
<div class="ui radio checkbox">
<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}}>
</div>
</td>
<td class="center aligned">
<div class="ui radio checkbox">
<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}}>
</div>
</td>
<td class="center aligned">
{{if ge $unit.MaxPerms 2}}
<div class="ui radio checkbox">
<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}}>
</div>
{{end}}
</td>
</tr>
</td>
<td class="center aligned">
<div class="ui radio checkbox">
<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}}>
</div>
</td>
<td class="center aligned">
<div class="ui radio checkbox">
<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}}>
</div>
</td>
<td class="center aligned">
<div class="ui radio checkbox">
<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}}>
</div>
</td>
</tr>
{{end}}
{{end}}
</tbody>
</table>
{{range $t, $unit := $.Units}}
{{if lt $unit.MaxPerms 2}}
{{if $unit.Type.UnitGlobalDisabled}}
<div class="field tooltip" data-content="{{$.i18n.Tr "repo.unit_disabled"}}">
{{else}}
<div class="field">
{{end}}
<div class="ui checkbox">
<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}}>
<label>{{$.i18n.Tr $unit.NameKey}}{{if $unit.Type.UnitGlobalDisabled}} {{$.i18n.Tr "org.team_unit_disabled"}}{{end}}</label>
<span class="help">{{$.i18n.Tr $unit.DescKey}}</span>
</div>
</div>
{{end}}
{{end}}
</div>
{{end}}

Expand Down