admin: new interface to manage claims
This commit is contained in:
parent
3932bba83d
commit
1eef71923a
10 changed files with 791 additions and 0 deletions
61
admin/static/views/claim-list.html
Normal file
61
admin/static/views/claim-list.html
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<h2>
|
||||
Tâches et réclammations ({{ claims.length }})
|
||||
<button ng-click="show('new')" class="float-right btn btn-sm btn-primary" style="margin-right: 10px"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter une tâche</button>
|
||||
<small style="height: 0px;">
|
||||
<div class="checkbox float-right"><label><input type="checkbox" ng-model="showOnlyUnassigned"> Non assignée</label></div>
|
||||
<div class="checkbox float-right"><label><input type="checkbox" ng-model="showOnlyMines" ng-show="whoami"> Que mes tâches</label></div>
|
||||
<div class="checkbox float-right"><label><input type="checkbox" ng-model="showClosed"> Tâches closes</label></div>
|
||||
</small>
|
||||
</h2>
|
||||
|
||||
<p><input type="search" class="form-control" placeholder="Search" ng-model="query" autofocus></p>
|
||||
<table class="table table-hover table-bordered table-striped table-sm">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th ng-repeat="field in fields" ng-click="chOrder(field)">
|
||||
{{ field }}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="claim in claims | filter: query | orderBy:order" ng-click="show(claim.id)" ng-class="{'bg-info': claim.priority == 'medium', 'bg-warning': claim.priority == 'high', 'bg-danger': claim.priority == 'critical'}" ng-if="(showClosed || (claim.state != 'closed' && claim.state != 'invalid')) && (!showOnlyMines || claim.id_assignee == whoami) && (!showOnlyUnassigned || !claim.id_assignee)">
|
||||
<td ng-repeat="field in fields">
|
||||
{{ claim[field] }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<hr>
|
||||
|
||||
<div ng-controller="AssigneesListController">
|
||||
<h2>
|
||||
Assignables à
|
||||
<button ng-click="newAssignee()" class="float-right btn btn-sm btn-primary" style="margin-right: 10px"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter une personne</button>
|
||||
</h2>
|
||||
<table class="table table-hover table-bordered table-striped table-sm">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Nom</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="a in assignees" ng-click="edit(a)">
|
||||
<td>
|
||||
{{ a.id }}
|
||||
</td>
|
||||
<td>
|
||||
<span ng-if="a.id && !a.edit">{{ a.name }}</span>
|
||||
<input type="text" class="form-control form-control-sm" ng-model="a.name" ng-if="!a.id || a.edit">
|
||||
</td>
|
||||
<td style="width: 10%;">
|
||||
<button class="btn btn-sm btn-info" ng-if="a.id" ng-click="setMyAId(a.id)" ng-class="{'disabled': whoami == a.id}"><span class="glyphicon glyphicon-user"></span></button>
|
||||
<button class="btn btn-sm btn-danger" ng-if="a.id && !a.edit" ng-click="removeAssignee(a)"><span class="glyphicon glyphicon-remove"></span></button>
|
||||
<button class="btn btn-sm btn-success" ng-if="!a.id || a.edit" ng-click="updateAssignee(a)"><span class="glyphicon glyphicon-ok"></span></button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
36
admin/static/views/claim.html
Normal file
36
admin/static/views/claim.html
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<h2>Tâche</h2>
|
||||
|
||||
<form ng-submit="saveClaim()">
|
||||
<div class="form-group row" ng-repeat="field in fields">
|
||||
<label for="{{ field }}" class="col-sm-2 col-form-label text-right">{{ namedFields[field] }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="{{ field }}" ng-model="claim[field]" ng-if="field != 'state' && field != 'priority' && field != 'creation' && field != 'id_team' && field != 'id_assignee' && field != 'description'">
|
||||
<input type="datetime" class="form-control" id="{{ field }}" ng-model="claim[field]" ng-if="field == 'creation' && claim.id">
|
||||
<select class="custom-select" id="{{ field }}" ng-model="claim[field]" ng-options="k as v for (k, v) in states" ng-if="field == 'state'"></select>
|
||||
<select class="custom-select" id="{{ field }}" ng-model="claim[field]" ng-options="k as v for (k, v) in priorities" ng-if="field == 'priority'"><option value="medium">Par défaut</option></select>
|
||||
<select class="custom-select" id="{{ field }}" ng-model="claim[field]" ng-options="k as t.name for (k, t) in teams" ng-if="field == 'id_team' && !claim.id" autofocus><option></option></select>
|
||||
<select class="custom-select" id="{{ field }}" ng-model="claim[field]" ng-options="k as t.name for (k, t) in teams" ng-if="field == 'id_team' && claim.id"><option></option></select>
|
||||
<select class="custom-select" id="{{ field }}" ng-model="claim[field]" ng-options="a.id as a.name for a in assignees" ng-if="field == 'id_assignee'"><option></option></select> <button type="button" class="btn" ng-if="field == 'id_assignee' && whoami" ng-class="{'disabled': whoami == claim[field]}" ng-click="assignToMe()">Me l'assigner</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row" ng-show="whoami">
|
||||
<label for="ndescription" class="col-sm-2 col-form-label text-right">Ajouter commentaire</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea class="form-control" id="ndescription" ng-model="ndescription" autofocus></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right" ng-show="claim.id">
|
||||
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save</button>
|
||||
<button class="btn btn-danger" ng-click="deleteClaim()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</button>
|
||||
</div>
|
||||
<div class="text-right" ng-show="!claim.id">
|
||||
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter la tâche</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<hr>
|
||||
|
||||
<div ng-repeat="description in claim.descriptions" class="alert text-light" ng-class="{'alert-dark': '' + description.id_assignee != whoami, 'alert-info': '' + description.id_assignee == whoami}">
|
||||
<strong>Par <em ng-if="!description.id_assignee">anonymous</em> <span ng-repeat="assignee in assignees" ng-if="assignee.id == description.id_assignee">{{ assignee.name }}</span> le {{ description.date | date:"mediumTime" }} :</strong>
|
||||
{{ description.content }}
|
||||
</div>
|
||||
Reference in a new issue