admin: List all existing association between users and teams
This commit is contained in:
parent
e44cac32ac
commit
3881385c9e
3 changed files with 37 additions and 3 deletions
|
@ -295,6 +295,11 @@ func bindingTeams(c *gin.Context) {
|
||||||
c.String(http.StatusOK, ret)
|
c.String(http.StatusOK, ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type teamAssociation struct {
|
||||||
|
Association string `json:"association"`
|
||||||
|
TeamId int64 `json:"team_id"`
|
||||||
|
}
|
||||||
|
|
||||||
func allAssociations(c *gin.Context) {
|
func allAssociations(c *gin.Context) {
|
||||||
teams, err := fic.GetTeams()
|
teams, err := fic.GetTeams()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -303,7 +308,7 @@ func allAssociations(c *gin.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var ret []string
|
var ret []teamAssociation
|
||||||
|
|
||||||
for _, team := range teams {
|
for _, team := range teams {
|
||||||
assocs, err := pki.GetTeamAssociations(TeamsDir, team.Id)
|
assocs, err := pki.GetTeamAssociations(TeamsDir, team.Id)
|
||||||
|
@ -313,7 +318,7 @@ func allAssociations(c *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, a := range assocs {
|
for _, a := range assocs {
|
||||||
ret = append(ret, a)
|
ret = append(ret, teamAssociation{a, team.Id})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,3 +55,32 @@
|
||||||
</ng-repeat>
|
</ng-repeat>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class="mb-4" ng-controller="AllTeamAssociationsController">
|
||||||
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
|
<h3>
|
||||||
|
Association utilisateurs et équipes
|
||||||
|
</h3>
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="table table-sm table-hover" ng-controller="TeamsListController" >
|
||||||
|
<tr>
|
||||||
|
<th class="text-right">Utilisateur</th>
|
||||||
|
<th></th>
|
||||||
|
<th>Équipe</th>
|
||||||
|
</tr>
|
||||||
|
<tr ng-repeat="association in allAssociations">
|
||||||
|
<td class="text-right">{{ association.association }}</td>
|
||||||
|
<td class="text-center">⬌</td>
|
||||||
|
<td ng-repeat="team in teams" ng-if="team.id == association.team_id">
|
||||||
|
<a ng-href="teams/{{ team.id }}">
|
||||||
|
{{ team.name }}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
|
@ -323,7 +323,7 @@
|
||||||
<form class="row" ng-controller="AllTeamAssociationsController" ng-submit="addDelegatedQA()">
|
<form class="row" ng-controller="AllTeamAssociationsController" ng-submit="addDelegatedQA()">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<select class="form-control form-control-sm" ng-model="newdqa">
|
<select class="form-control form-control-sm" ng-model="newdqa">
|
||||||
<option ng-selected="newdqa == m" ng-repeat="(i,m) in allAssociations" ng-value="m">{{ m }}</option>
|
<option ng-selected="newdqa == m.association" ng-repeat="(i,m) in allAssociations" ng-value="m.association">{{ m.association }}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col input-group">
|
<div class="col input-group">
|
||||||
|
|
Reference in a new issue