<?php defined('MW_PATH') || exit('No direct script access allowed');

/**
 * This file is part of the MailWizz EMA application.
 * 
 * @package MailWizz EMA
 * @author Serban George Cristian <cristian.serban@mailwizz.com> 
 * @link http://www.mailwizz.com/
 * @copyright 2013-2014 MailWizz EMA (http://www.mailwizz.com)
 * @license http://www.mailwizz.com/license/
 * @since 1.0
 */
 
?>

<div class="callout">
    <?php
    $text = 'Please note, these pages are the base pages shown in customers area for each list.<br />
    The customer has the ability to modify them to fit their needs for any particular list.';
    echo Yii::t('list_page_types', StringHelper::normalizeTranslationString($text));
    ?>
</div>

<?php $form = $this->beginWidget('CActiveForm'); ?>
<div class="panel panel-default">
    
    <div class="panel-heading">
        <div class="pull-left">
            <h3 class="panel-title"><span class="glyphicon glyphicon-list-alt"></span> <?php echo $pageHeading;?></h3>
        </div>
        <div class="pull-right">
            <?php echo CHtml::link(Yii::t('app', 'Cancel'), array('list_page_type/index'), array('class' => 'btn btn-default btn-xs', 'title' => Yii::t('app', 'Cancel')));?>
        </div>
        <div class="clearfix"><!-- --></div>
    </div>
    
    <div class="panel-body">
        
        <div class="form-group">
            <?php echo $form->labelEx($pageType, 'name');?>
            <?php echo $form->textField($pageType, 'name', $pageType->getHtmlOptions('name')); ?>
            <?php echo $form->error($pageType, 'name');?>
        </div>
        
        <div class="form-group">
            <?php echo $form->labelEx($pageType, 'description');?>
            <?php echo $form->textArea($pageType, 'description', $pageType->getHtmlOptions('description')); ?>
            <?php echo $form->error($pageType, 'description');?>
        </div>
        
        <div class="form-group">
            <?php echo $form->labelEx($pageType, 'content');?>
            <?php echo $form->textArea($pageType, 'content', $pageType->getHtmlOptions('content', array('rows' => 15))); ?>
            <?php echo $form->error($pageType, 'content');?>
        </div>
        
        <div class="callout">
            <label><?php echo Yii::t('list_page_types', 'Available tags:');?></label>
            <?php foreach ($tags as $tag) { ?>
            <a href="javascript:;" class="btn btn-default btn-xs" data-tag-name="<?php echo CHtml::encode($tag['tag']);?>">
                <?php echo CHtml::encode($tag['tag']);?>
            </a>
            <?php } ?>
        </div>
        
    </div>
    
    <div class="panel-footer">
        <div class="pull-right">
            <button type="submit" class="btn btn-default btn-submit" data-loading-text="<?php echo Yii::t('app', 'Please wait, processing...');?>"><?php echo Yii::t('app', 'Save changes');?></button>
        </div>
        <div class="clearfix"><!-- --></div>
    </div>
    
</div>
<?php $this->endWidget(); ?>