2017-04-01 14:38:42 +08:00
|
|
|
<section class="container">
|
2016-01-01 14:58:42 -05:00
|
|
|
<div class="page-header">
|
|
|
|
|
<h1>{{vm.article._id ? 'Edit Article' : 'New Article'}}</h1>
|
|
|
|
|
</div>
|
2016-07-25 17:34:06 -07:00
|
|
|
<div class="pull-right">
|
2016-09-16 12:39:12 +05:30
|
|
|
<a ng-show="vm.article._id" class="btn btn-primary" ng-click="vm.remove()">
|
2016-07-25 17:34:06 -07:00
|
|
|
<i class="glyphicon glyphicon-trash"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
2016-01-01 14:58:42 -05:00
|
|
|
<div class="col-md-12">
|
|
|
|
|
<form name="vm.form.articleForm" class="form-horizontal" ng-submit="vm.save(vm.form.articleForm.$valid)" novalidate>
|
|
|
|
|
<fieldset>
|
|
|
|
|
<div class="form-group" show-errors>
|
|
|
|
|
<label class="control-label" for="title">Title</label>
|
2016-12-14 02:51:19 +00:00
|
|
|
<input name="title" type="text" ng-model="vm.article.title" id="title" class="form-control" placeholder="Title" required autofocus>
|
2016-01-01 14:58:42 -05:00
|
|
|
<div ng-messages="vm.form.articleForm.title.$error" role="alert">
|
|
|
|
|
<p class="help-block error-text" ng-message="required">Article title is required.</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<label class="control-label" for="content">Content</label>
|
|
|
|
|
<textarea name="content" data-ng-model="vm.article.content" id="content" class="form-control" cols="30" rows="10" placeholder="Content"></textarea>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-group">
|
|
|
|
|
<button type="submit" class="btn btn-default">{{vm.article._id ? 'Update' : 'Create'}}</button>
|
|
|
|
|
</div>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
</section>
|