server/admin/static/views/theme.html

40 lines
1.6 KiB
HTML

<h2>{{theme.name}} <small>{{theme.authors}}</small></h2>
<form ng-submit="saveTheme()" class="form-horizontal">
<div class="form-group" ng-repeat="field in fields">
<label for="{{ field }}" class="col-sm-1 control-label">{{ field | capitalize }}</label>
<div class="col-sm-11">
<input type="text" class="form-control" id="{{ field }}" ng-model="theme[field]">
</div>
</div>
<div class="text-right" ng-show="theme.id">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-save" aria-hidden="true"></span> Save</button>
<a class="btn btn-danger" ng-click="deleteTheme()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</a>
</div>
<div class="text-right" ng-show="!theme.id">
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Create theme</button>
</div>
</form>
<div ng-show="theme.id" ng-controller="ExercicesListController">
<h3>Exercices<a ng-click="show('new')" class="pull-right btn btn-sm btn-primary"><span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Ajouter un exercice</a></h3>
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
<table class="table table-hover table-bordered">
<thead>
<tr>
<th ng-repeat="field in fields">
{{ field }}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="exercice in exercices | filter: query" ng-click="show(exercice.id)">
<td ng-repeat="field in fields">
{{ exercice[field] }}
</td>
</tr>
</tbody>
</table>
</div>