<div class="row">
    <div class="animated fadeInUp">
        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 item">
            <div class="panel panel-news panel-form">
                <div class="panel-heading">
                    <h1><i class="fa fa-bullhorn fa-fw"></i> <?php echo __('Add News'); ?></h1>
                </div>
                
                <div class="panel-body content">
                    <form id="NewsAddForm" action="/news/add" method="post">
                    <div class="row">
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 form-row">
                            <label for="NewsTitle"><?php echo __('Title'); ?></label>
                            <input name="data[News][title]" id="NewsTitle" type="text" class="form-control" />
                        </div>
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 form-row">
                            <label for="NewsContent"><?php echo __('Content'); ?></label>
                            <textarea name="data[News][content]" id="NewsContent" class="form-control wysiwyg" style="height:200px;"></textarea>
                        </div>
                        <div class="col-lg-4 col-md-12 col-sm-12 col-xs-12 form-row">
                            <div class="control-group">
                                <div class="checkbox check-form"> 
                                    <input type="checkbox" name="data[News][notify]" id="NewsNotify" value="1" checked="checked">
                                    <label for="NewsNotify"><?php echo (Configure::read('CFG.users_follow')) ? __('Notify followers') : __('Notify other members'); ?></label>
                                </div>
                            </div>
                        </div>
                        <?php
                        if ($this->Session->read('Auth.User.role') == 'admin') {
                        ?>
                        <div class="col-lg-4 col-md-12 col-sm-12 col-xs-12 form-row">
                            <div class="control-group">
                                <div class="checkbox check-form"> 
                                    <input type="checkbox" name="data[News][admin]" id="NewsAdmin" value="1">
                                    <label for="NewsAdmin"><?php echo __('Only available for administrators'); ?></label>
                                </div>
                            </div>
                        </div>
                        <?php
                        }
                        ?>
                        <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-right form-row">
                            <button type="reset" class="btn btn-warning" onclick="window.location='<?php echo $referer; ?>';"><i class="fa fa-times fa-fw"></i> <?php echo __('Cancel'); ?></button> <button type="submit" class="btn btn-primary"><i class="fa fa-check fa-fw"></i> <?php echo __('Save'); ?></button>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
$(document).ready(function() {    
    $("#NewsAddForm").validate({
        rules: {
            'data[News][title]': {
                required: true
            }
        }
    });
});
</script>