<commit_before><?php
/**
 * @link http://hiqdev.com/...
 * @copyright Copyright (c) 2015 HiQDev
 * @license http://hiqdev.com/.../license
 */

use cebe\gravatar\Gravatar;
use frontend\assets\FlagIconCssAsset;
use hipanel\modules\ticket\widgets\Topic;
use hipanel\widgets\Box;
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\helpers\Url;

use hipanel\modules\ticket\widgets\Label;
//use hipanel\modules\ticket\widgets\Topic;
//use hipanel\modules\ticket\widgets\Watcher;
use hipanel\base\Re;
FlagIconCssAsset::register($this);
?>
<div class="row page-ticket">
    <div class="col-md-12">

        <?php $box = Box::begin([
            'options' => [
                'class' => 'box-solid'
            ],
        ]); ?>

        <?= $this->render('_advanced_form', [
            'form' => $form,
            'model' => $model,
            'topic_data' => $topic_data,
            'priority_data' => $priority_data,
            'state_data' => $state_data,
        ]); ?>


        <?php /*
        <?php if ($model->priority == 'medium') : ?>
            <?= Html::a('<span class="glyphicon glyphicon-arrow-up"></span>&nbsp;&nbsp;'.Yii::t('app', 'Increase'), ['priority-up', 'id' => $model->id], ['class' => 'btn btn-primary btn-block']) ?>
        <?php else : ?>
            <?= Html::a('<span class="glyphicon glyphicon-arrow-down"></span>&nbsp;&nbsp;'.Yii::t('app', 'Lower'), ['priority-down', 'id' => $model->id], ['class' => 'btn btn-primary btn-block']) ?>
        <?php endif; ?>
        */ ?>
        <?php /*
        <?php if ($model->state=='opened') : ?>
            <?= Html::a('<i class="fa fa-close"></i>&nbsp;&nbsp;'.Yii::t('app', 'Close'), ['close', 'id' => $model->id], [
                'class' => 'btn btn-danger btn-block',
                'data' => [
                    'confirm' => Yii::t('app', 'Are you sure you want to close this ticket?'),
                    'method' => 'post',
                ],
            ]) ?>
        <?php else : ?>
            <?= Html::a('<i class="fa fa-close"></i>&nbsp;&nbsp;'.Yii::t('app', 'Open'), ['open', 'id' => $model->id], [
                'class' => 'btn btn-danger btn-block',
                'data' => [
                    'confirm' => Yii::t('app', 'Are you sure you want to open this ticket?'),
                    'method' => 'post',
                ],
            ]) ?>
        <?php endif; ?>
        */ ?>

        <?php if (is_array($model->watchers)) : ?>
            <?= Html::tag('p', 'Watchers', ['class' => 'lead', 'style' => 'border-bottom: 1px solid #E1E1E1; margin-bottom: 0.5em;s']); ?>
            <div class="margin-bottom">
            <?php foreach ($model->watchers as $watcherId => $watcher) : ?>
                <?php
                $piece = explode(' ', $watcher);
                $watcherEmailHash = array_pop(explode(' ', $watcher));
                if ($watcherEmailHash) {
                    print Html::beginTag('a', [
                        'href' => Url::toRoute(['/client/client/view', 'id' => $watcherId]),
                    ]);
                    print Gravatar::widget([
                        'emailHash' => $watcherEmailHash,
                        'defaultImage' => 'identicon',
                        'options' => [
                            'alt' => reset($piece),
                            'class' => '',
                            'title' => reset($piece)
                        ],
                        'size' => 32,
                    ]);
                    print Html::endTag('a');
                }
                ?>
            <?php endforeach; ?>
            </div>
        <?php endif; ?>
        <?php $box->beginFooter(); ?>
        <?php if (is_array($model->watchers) && array_keys(Yii::$app->user->identity->id, $model->watchers)) : ?>
            <?= Html::a('<i class="fa fa-eye-slash"></i>&nbsp;&nbsp;' . Yii::t('app', 'Unsubscribe'), ['unsubscribe', 'id' => $model->id], ['class' => 'btn  btn-default btn-block']) ?>
        <?php else : ?>
            <?= Html::a('<i class="fa fa-eye"></i>&nbsp;&nbsp;' . Yii::t('app', 'Subscribe'), ['subscribe', 'id' => $model->id], ['class' => 'btn  btn-default btn-block']) ?>
        <?php endif; ?>

        <?php $box->endFooter(); ?>

        <?php $box::end(); ?>
    </div>

    <div class="col-md-12">
        <?php /*<commit_msg>Fix Subscribe button<commit_after><?php
/**
 * @link http://hiqdev.com/...
 * @copyright Copyright (c) 2015 HiQDev
 * @license http://hiqdev.com/.../license
 */

use cebe\gravatar\Gravatar;
use frontend\assets\FlagIconCssAsset;
use hipanel\modules\ticket\widgets\Topic;
use hipanel\widgets\Box;
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\helpers\Url;

use hipanel\modules\ticket\widgets\Label;
//use hipanel\modules\ticket\widgets\Topic;
//use hipanel\modules\ticket\widgets\Watcher;
use hipanel\base\Re;
FlagIconCssAsset::register($this);
?>
<div class="row page-ticket">
    <div class="col-md-12">

        <?php $box = Box::begin([
            'options' => [
                'class' => 'box-solid'
            ],
        ]); ?>

        <?= $this->render('_advanced_form', [
            'form' => $form,
            'model' => $model,
            'topic_data' => $topic_data,
            'priority_data' => $priority_data,
            'state_data' => $state_data,
        ]); ?>


        <?php /*
        <?php if ($model->priority == 'medium') : ?>
            <?= Html::a('<span class="glyphicon glyphicon-arrow-up"></span>&nbsp;&nbsp;'.Yii::t('app', 'Increase'), ['priority-up', 'id' => $model->id], ['class' => 'btn btn-primary btn-block']) ?>
        <?php else : ?>
            <?= Html::a('<span class="glyphicon glyphicon-arrow-down"></span>&nbsp;&nbsp;'.Yii::t('app', 'Lower'), ['priority-down', 'id' => $model->id], ['class' => 'btn btn-primary btn-block']) ?>
        <?php endif; ?>
        */ ?>
        <?php /*
        <?php if ($model->state=='opened') : ?>
            <?= Html::a('<i class="fa fa-close"></i>&nbsp;&nbsp;'.Yii::t('app', 'Close'), ['close', 'id' => $model->id], [
                'class' => 'btn btn-danger btn-block',
                'data' => [
                    'confirm' => Yii::t('app', 'Are you sure you want to close this ticket?'),
                    'method' => 'post',
                ],
            ]) ?>
        <?php else : ?>
            <?= Html::a('<i class="fa fa-close"></i>&nbsp;&nbsp;'.Yii::t('app', 'Open'), ['open', 'id' => $model->id], [
                'class' => 'btn btn-danger btn-block',
                'data' => [
                    'confirm' => Yii::t('app', 'Are you sure you want to open this ticket?'),
                    'method' => 'post',
                ],
            ]) ?>
        <?php endif; ?>
        */ ?>

        <?php if (is_array($model->watchers)) : ?>
            <?= Html::tag('p', 'Watchers', ['class' => 'lead', 'style' => 'border-bottom: 1px solid #E1E1E1; margin-bottom: 0.5em;s']); ?>
            <div class="margin-bottom">
            <?php foreach ($model->watchers as $watcherId => $watcher) : ?>
                <?php
                $piece = explode(' ', $watcher);
                $watcherEmailHash = array_pop(explode(' ', $watcher));
                if ($watcherEmailHash) {
                    print Html::beginTag('a', [
                        'href' => Url::toRoute(['/client/client/view', 'id' => $watcherId]),
                    ]);
                    print Gravatar::widget([
                        'emailHash' => $watcherEmailHash,
                        'defaultImage' => 'identicon',
                        'options' => [
                            'alt' => reset($piece),
                            'class' => '',
                            'title' => reset($piece)
                        ],
                        'size' => 32,
                    ]);
                    print Html::endTag('a');
                }
                ?>
            <?php endforeach; ?>
            </div>
        <?php endif; ?>
        <?php $box->beginFooter(); ?>
        <?php if (array_key_exists(Yii::$app->user->identity->id, $model->watchers)) : ?>
            <?= Html::a('<i class="fa fa-eye-slash"></i>&nbsp;&nbsp;' . Yii::t('app', 'Unsubscribe'), ['unsubscribe', 'id' => $model->id], ['class' => 'btn  btn-default btn-block']) ?>
        <?php else : ?>
            <?= Html::a('<i class="fa fa-eye"></i>&nbsp;&nbsp;' . Yii::t('app', 'Subscribe'), ['subscribe', 'id' => $model->id], ['class' => 'btn  btn-default btn-block']) ?>
        <?php endif; ?>

        <?php $box->endFooter(); ?>

        <?php $box::end(); ?>
    </div>

    <div class="col-md-12">
        <?php /*
{'fraction_non_alphanumeric': 0.21655682737888773, 'fraction_numerical': 0.003699849693606197, 'mean_word_length': 1.77599486521181, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 206, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '331908', 'n_tokens_mistral': 2758, 'n_tokens_neox': 2629, 'n_words': 491}