[admin] Add page title
This commit is contained in:
parent
13c6d44953
commit
288e6a1c7f
@ -111,12 +111,15 @@ angular.module("FICApp")
|
||||
$location.url("/themes/" + id);
|
||||
};
|
||||
})
|
||||
.controller("ThemeController", function($scope, Theme, $routeParams) {
|
||||
.controller("ThemeController", function($scope, Theme, $routeParams, $location) {
|
||||
$scope.theme = Theme.get({ themeId: $routeParams.themeId });
|
||||
$scope.fields = ["name"];
|
||||
$scope.fields = ["name", "authors"];
|
||||
|
||||
$scope.saveTheme = function() {
|
||||
this.theme.$save({themeId: this.theme.themeId});
|
||||
this.theme.$update();
|
||||
}
|
||||
$scope.deleteTheme = function() {
|
||||
this.theme.$remove(function() { $location.url("/themes/");});
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
<h2>Équipes</h2>
|
||||
|
||||
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
|
||||
<table class="table table-hover table-bordered">
|
||||
<thead>
|
||||
|
@ -1,3 +1,5 @@
|
||||
<h2>Thèmes</h2>
|
||||
|
||||
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
|
||||
<table class="table table-hover table-bordered">
|
||||
<thead>
|
||||
|
@ -1,11 +1,18 @@
|
||||
<form class="form" ng-submit="ssubmit()">
|
||||
<h2>{{theme.name}} <small>{{theme.authors}}</small></h2>
|
||||
|
||||
<form class="form" ng-submit="saveTheme()" class="form-horizontal">
|
||||
<div class="form-group" ng-repeat="field in fields">
|
||||
<label for="{{ field }}">{{ field }}</label>
|
||||
<label for="{{ field }}">{{ field | capitalize }}</label>
|
||||
<input type="text" class="form-control" id="{{ field }}" ng-model="theme[field]">
|
||||
</div>
|
||||
<button class="btn btn-primary" ng-click="saveTheme()">Save</button>
|
||||
<div class="text-right">
|
||||
<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="deleteTheme()"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<h3>Exercices</h3>
|
||||
|
||||
<div ng-controller="ExercicesListController">
|
||||
<p><input type="search" class="form-control" placeholder="Search" ng-model="query"></p>
|
||||
<table class="table table-hover table-bordered">
|
||||
@ -17,9 +24,9 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="team in teams | filter: query" ng-click="show(team.id)">
|
||||
<tr ng-repeat="exercice in exercices | filter: query" ng-click="show(exercice.id)">
|
||||
<td ng-repeat="field in fields">
|
||||
{{ team[field] }}
|
||||
{{ exercice[field] }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
Loading…
Reference in New Issue
Block a user