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

Allow to add and remove all repositories to/from team. #8867

Merged
merged 6 commits into from
Nov 9, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Change style, buttons on same row.
  • Loading branch information
davidsvantesson committed Nov 7, 2019
commit aa468b514413a125c957eb376691e86cfb02e1f9
4 changes: 3 additions & 1 deletion options/locale/locale_en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1583,8 +1583,10 @@ teams.write_permission_desc = This team grants <strong>Write</strong> access: me
teams.admin_permission_desc = This team grants <strong>Admin</strong> access: members can read from, push to and add collaborators to team repositories.
teams.repositories = Team Repositories
teams.search_repo_placeholder = Search repository…
teams.add_team_repository = Add Team Repository
teams.add_team_repository = Add
teams.remove_repo = Remove
teams.add_all_repos = Add All
teams.remove_all_repos = Remove All
techknowlogick marked this conversation as resolved.
Show resolved Hide resolved
teams.remove_all_repos_title = Remove all team repositories
teams.remove_all_repos_desc = This will remove all of the repositories from the team.
davidsvantesson marked this conversation as resolved.
Show resolved Hide resolved
teams.add_all_repos_title = Add all repositories
Expand Down
5 changes: 3 additions & 2 deletions public/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,9 @@ tbody.commit-list{vertical-align:baseline}
.organization.teams .members .item,.organization.teams .repositories .item{padding:10px 20px;line-height:32px}
.organization.teams .members .item:not(:last-child),.organization.teams .repositories .item:not(:last-child){border-bottom:1px solid #ddd}
.organization.teams .members .item .button,.organization.teams .repositories .item .button{padding:9px 10px}
.organization.teams #add-member-form input,.organization.teams #add-repo-form input{margin-left:0}
.organization.teams #add-member-form .ui.button,.organization.teams #add-repo-form .ui.button{margin-left:5px;margin-top:-3px}
.organization.teams #add-member-form input,.organization.teams #add-repo-form input,.organization.teams #repo-multiple-form input{margin-left:0}
.organization.teams #add-member-form .ui.button,.organization.teams #add-repo-form .ui.button,.organization.teams #repo-multiple-form .ui.button{margin-left:5px;margin-top:-3px}
.organization.teams #repo-top-segment{height:60px}
.user:not(.icon){padding-top:15px}
.user.profile .ui.card .username{display:block}
.user.profile .ui.card .extra.content{padding:0}
Expand Down
5 changes: 5 additions & 0 deletions public/less/_organization.less
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
}

#add-repo-form,
#repo-multiple-form,
#add-member-form {
input {
margin-left: 0;
Expand All @@ -162,5 +163,9 @@
margin-top: -3px;
}
}

#repo-top-segment {
height: 60px;
}
}
}
34 changes: 18 additions & 16 deletions templates/org/team/repositories.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,26 @@
{{template "org/team/navbar" .}}
{{$canAddRemove := and $.IsOrganizationOwner (not $.Team.IncludesAllRepositories)}}
{{if $canAddRemove}}
<div class="ui attached segment">
<form class="ui form" id="add-repo-form" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/add" method="post">
{{.CsrfTokenHtml}}
<div class="inline field ui left">
<div id="search-repo-box" data-uid="{{.Org.ID}}" class="ui search">
<div class="ui input">
<input class="prompt" name="repo_name" placeholder="{{.i18n.Tr "org.teams.search_repo_placeholder"}}" autocomplete="off" required>
<div class="ui attached segment" id="repo-top-segment">
<div class="inline ui field left">
<form class="ui form" id="add-repo-form" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/add" method="post">
{{.CsrfTokenHtml}}
<div class="inline field ui left">
<div id="search-repo-box" data-uid="{{.Org.ID}}" class="ui search">
<div class="ui input">
<input class="prompt" name="repo_name" placeholder="{{.i18n.Tr "org.teams.search_repo_placeholder"}}" autocomplete="off" required>
</div>
</div>
</div>
</div>
<button class="ui green button">{{.i18n.Tr "org.teams.add_team_repository"}}</button>
</form>
<div class="ui divider"></div>
<form class="ui form" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/repositories" method="post">
{{.CsrfTokenHtml}}
<button class="ui green small button add-all-button" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/addall">Add all organization repositories</button>
<button class="ui red small button delete-button" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/removeall">Remove all team repositories</button>
</form>
<button class="ui green button">{{.i18n.Tr "org.teams.add_team_repository"}}</button>
</form>
</div>
<div class="inline ui field right">
<form class="ui form" id="repo-multiple-form" action="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/repositories" method="post">
<button class="ui red button delete-button right" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/removeall">{{.i18n.Tr "org.teams.remove_all_repos"}}</button>
<button class="ui green button add-all-button right" data-url="{{$.OrgLink}}/teams/{{$.Team.LowerName}}/action/repo/addall">{{.i18n.Tr "org.teams.add_all_repos"}}</button>
</form>
</div>
</div>
{{end}}
<div class="ui bottom attached table segment repositories">
Expand Down