<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
	  xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3"
      layout:decorator="layout/mainLayout">
      
      <head>
        <title>Categories - New</title>
    </head>
    <body>
        
    	<div layout:fragment="content">
	        
              <div class="box box-warning">
                <div class="box-header with-border">
                  <h3 class="box-title">Create New Category</h3>
                </div><!-- /.box-header -->
                <div class="box-body">
                  <form role="form" th:action="@{/categories}" th:object="${category}" method="post">
                  	<p th:if="${#fields.hasErrors('global')}" th:errors="*{global}" th:class="text-red">Incorrect data</p>
                    <!-- text input -->
                    <div class="form-group" th:classappend="${#fields.hasErrors('name')}? 'has-error'">
                      <label>Name</label>
                      <input type="text" class="form-control" name="name" th:field="*{name}" placeholder="Enter Category Name"/>
                      <p th:if="${#fields.hasErrors('name')}" th:errors="*{name}" th:class="text-red">Incorrect data</p>
                    </div>  
                    <div class="form-group">
                      <label>Description</label>
                      <textarea class="form-control" rows="3" name="description" th:field="*{description}" placeholder="Enter Category Description"></textarea>
                    </div>		
					<div class="box-footer">
	                    <button type="submit" class="btn btn-primary">Submit</button>
	                </div>
                  </form>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
    	</div>
    	
    </body>
    
</html>