admin: can edit theme introductions

This commit is contained in:
nemunaire 2018-01-06 15:26:06 +01:00
parent 0f9c8e0335
commit 5e2e03f5e9
2 changed files with 3 additions and 2 deletions

View File

@ -632,7 +632,7 @@ angular.module("FICApp")
}) })
.controller("ThemeController", function($scope, Theme, $routeParams, $location, $rootScope, $http) { .controller("ThemeController", function($scope, Theme, $routeParams, $location, $rootScope, $http) {
$scope.theme = Theme.get({ themeId: $routeParams.themeId }); $scope.theme = Theme.get({ themeId: $routeParams.themeId });
$scope.fields = ["name", "authors"]; $scope.fields = ["name", "authors", "intro"];
$scope.saveTheme = function() { $scope.saveTheme = function() {
if (this.theme.id) { if (this.theme.id) {

View File

@ -4,7 +4,8 @@
<div class="form-group row" ng-repeat="field in fields"> <div class="form-group row" ng-repeat="field in fields">
<label for="{{ field }}" class="col-sm-1 col-form-label-sm">{{ field | capitalize }}</label> <label for="{{ field }}" class="col-sm-1 col-form-label-sm">{{ field | capitalize }}</label>
<div class="col-sm-11"> <div class="col-sm-11">
<input type="text" class="form-control form-control-sm" id="{{ field }}" ng-model="theme[field]"> <input type="text" class="form-control form-control-sm" id="{{ field }}" ng-model="theme[field]" ng-if="field != 'intro'">
<textarea class="form-control form-control-sm" id="{{ field }}" ng-model="theme[field]" ng-if="field == 'intro'"></textarea>
</div> </div>
</div> </div>
<div class="text-right" ng-show="theme.id"> <div class="text-right" ng-show="theme.id">