Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions admin-new-post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<div class="row">
<div class="col-xs-8">
<form name="newPostForm" class="form-horizontal" novalidate role="form">
<div class="form-group" ng-class="{'has-error':newPostForm.title.$dirty && newPostForm.title.$invalid}">
<label for="title" class="col-sm-2 control-label">Post Title</label>
<div class="col-sm-10">
<input type="text" name="title" ng-model="post.title" ng-required="true" class="form-control" id="title" placeholder="Title"/>
<span class="error-message" ng-show="newPostForm.title.$dirty && newPostForm.title.$error.required">Title is mandatory</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':newPostForm.content.$dirty && newPostForm.content.$invalid}">
<label for="content" class="col-sm-2 control-label">Content</label>
<div class="col-sm-10">
<textarea cols="8" rows="6" name="content" class="form-control" ng-model="post.content" ng-required="true" id="content" placeholder="Content"></textarea>
<span class="error-message" ng-show="newPostForm.content.$dirty && newPostForm.content.$error.required">You need to have some content!</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':newPostForm.tags.$dirty && newPostForm.tags.$invalid}">
<label for="tags" class="col-sm-2 control-label">Tags</label>
<div class="col-sm-10">
<input type="text" name="tags" class="form-control" ng-model="post.tags" id="tags" placeholder="Comma separated tags" ng-pattern="/^[\w,]+$/"/>
<span class="error-message" ng-show="newPostForm.tags.$dirty && newPostForm.tags.$error.pattern">No special charatcers allowed here</span>
</div>
</div>
<div class="form-group" ng-class="{'has-error':newPostForm.keywords.$dirty && newPostForm.keywords.$invalid}">
<label for="keywords" class="col-sm-2 control-label">Keywords</label>
<div class="col-sm-10">
<input type="text" name="keywords" class="form-control" ng-model="post.keywords" id="keywords" placeholder="Comma separated keywords" ng-pattern="/^[\w,]+$/"/>
<span class="error-message" ng-show="newPostForm.keywords.$dirty && newPostForm.keywords.$error.pattern">Sorry! No special charatcers allowed here</span>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success" ng-disabled="newPostForm.$invlaid">Add Post</button>
</div>
</div>
</form>
</div>
</div>