<commit_before><?php

use frontend\modules\bbii\models\BbiiPost;
use frontend\modules\bbii\models\BbiiMessage;

use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use yii\widgets\ListView;

/* @var $this ForumController */
/* @var $forum BbiiForum */
/* @var $dataProvider ArrayDataProvider */

/* $this->context->bbii_breadcrumbs = array(
	Yii::t('BbiiModule.bbii', 'Forum') => array('forum/index'),
	$forum->name,
); */

$approvals = BbiiPost::find()->unapproved()->count();
$reports   = BbiiMessage::find()->report()->count();

$item = array(
	array('label' => Yii::t('BbiiModule.bbii', 'Forum'), 							'url' => array('forum/index')),
	array('label' => Yii::t('BbiiModule.bbii', 'Members'), 							'url' => array('member/index')),
	array('label' => Yii::t('BbiiModule.bbii', 'Approval'). ' (' . $approvals . ')','url' => array('moderator/approval'), 	'visible' => $this->context->isModerator()),
	array('label' => Yii::t('BbiiModule.bbii', 'Reports'). 	' (' . $reports . ')', 	'url' => array('moderator/report'), 	'visible' => $this->context->isModerator()),
);
?>

<?php echo Yii::$app->session->getFlash(); ?>

<div id = "bbii-wrapper">
    <div class="row">
        <div class="col col-md-12">
            <?php echo $this->render('_header', array('item' => $item)); ?>

            <div class="well clearfix">
                <h2>
                    <?php echo $forum->name; ?>
                </h2>
                <?php if (!(Yii::$app->user->isGuest || $forum->locked) || $this->context->isModerator()) { ?>
                <div class = "form">
                    <?php // @depricated Kept for referance
                    /* $form = $this->beginWidget('ActiveForm', array(
                        'id' => 'create-topic-form',
                        'action' => array('forum/createTopic'),
                        'enableAjaxValidation' => false,
                    )); ?>
                        <?php echo $form->hiddenField($forum, 'id'); ?>
                        <?php echo Html::submitButton(Yii::t('BbiiModule.bbii','Create new topic'), array('class' => 'bbii-topic-button')); ?>
                    <?php $this->endWidget(); ?>
                    */ ?>
                    <?php
                    $form = ActiveForm::begin([
                            'action'               => array('createtopic'),
                            'enableAjaxValidation' => false,
                            'id'                   => 'create-topic-form',
                    ]);
                        echo $form->field($forum, 'id')->hiddenInput()->label(false);
                        echo Html::submitButton(Yii::t('BbiiModule.bbii', 'Create new topic'), array('class' => 'btn btn-success btn-lg'));
                    ActiveForm::end();
                    ?>
                </div><!-- form -->
                <?php }; ?>
            </div>

            <?php // @depricated 2.7.5 Kept for referance
            /* $this->widget('zii.widgets.CListView', array(
                'id' => 'bbiiTopic',
                'dataProvider' => $dataProvider,
                'itemView' => '_topic',
                'template' => '{pager}{items}{pager}',
                'pager' => array('firstPageCssClass' => 'previous', 'lastPageCssClass' => 'next', 'firstPageLabel' => '<<', 'lastPageLabel' => '>>'),
            ));*/ ?>

            <div class="well">
                <div class = "topic">
                    <table class="table table-striped table-condensed">
                        <?php echo ListView::widget([
                                'dataProvider' => $dataProvider,
                                'id'           => 'bbiiTopic',
                                'itemView'     => '_topic',
                                //'pager'        => array('firstPageCssClass' => 'previous', 'lastPageCssClass' => 'next', 'firstPageLabel' => '<<', 'lastPageLabel' => '>>'),
                                //'template'     => '{pager}{items}{pager}',
                            ]);
                        ?>
                    </table>
                </div>
            </div><commit_msg>Iteration of  forum create new topic button position<commit_after><?php

use frontend\modules\bbii\models\BbiiPost;
use frontend\modules\bbii\models\BbiiMessage;

use yii\bootstrap\ActiveForm;
use yii\helpers\Html;
use yii\widgets\ListView;

/* @var $this ForumController */
/* @var $forum BbiiForum */
/* @var $dataProvider ArrayDataProvider */

/* $this->context->bbii_breadcrumbs = array(
	Yii::t('BbiiModule.bbii', 'Forum') => array('forum/index'),
	$forum->name,
); */

$approvals = BbiiPost::find()->unapproved()->count();
$reports   = BbiiMessage::find()->report()->count();

$item = array(
	array('label' => Yii::t('BbiiModule.bbii', 'Forum'), 							'url' => array('forum/index')),
	array('label' => Yii::t('BbiiModule.bbii', 'Members'), 							'url' => array('member/index')),
	array('label' => Yii::t('BbiiModule.bbii', 'Approval'). ' (' . $approvals . ')','url' => array('moderator/approval'), 	'visible' => $this->context->isModerator()),
	array('label' => Yii::t('BbiiModule.bbii', 'Reports'). 	' (' . $reports . ')', 	'url' => array('moderator/report'), 	'visible' => $this->context->isModerator()),
);
?>

<?php echo Yii::$app->session->getFlash(); ?>

<div id = "bbii-wrapper">
    <div class="row">
        <div class="col col-md-12">
            <?php echo $this->render('_header', array('item' => $item)); ?>

            <div class="well clearfix">
                <table width="100%">
                    <tr>
                        <td align="left">
                            <h2>
                                <?php echo $forum->name; ?>
                            </h2>
                        </td>
                        <td align="right">
                            <?php if (!(Yii::$app->user->isGuest || $forum->locked) || $this->context->isModerator()) { ?>
                            <div class = "form">
                                <?php // @depricated Kept for referance
                                /* $form = $this->beginWidget('ActiveForm', array(
                                    'id' => 'create-topic-form',
                                    'action' => array('forum/createTopic'),
                                    'enableAjaxValidation' => false,
                                )); ?>
                                    <?php echo $form->hiddenField($forum, 'id'); ?>
                                    <?php echo Html::submitButton(Yii::t('BbiiModule.bbii','Create new topic'), array('class' => 'bbii-topic-button')); ?>
                                <?php $this->endWidget(); ?>
                                */ ?>
                                <?php
                                $form = ActiveForm::begin([
                                        'action'               => array('createtopic'),
                                        'enableAjaxValidation' => false,
                                        'id'                   => 'create-topic-form',
                                ]);
                                    echo $form->field($forum, 'id')->hiddenInput()->label(false);
                                    echo Html::submitButton(Yii::t('BbiiModule.bbii', 'Create new topic'), array('class' => 'btn btn-success btn-lg'));
                                ActiveForm::end();
                                ?>
                            </div><!-- form -->
                            <?php }; ?>
                        </td>
                    </tr>
                </table>
            </div>

            <?php // @depricated 2.7.5 Kept for referance
            /* $this->widget('zii.widgets.CListView', array(
                'id' => 'bbiiTopic',
                'dataProvider' => $dataProvider,
                'itemView' => '_topic',
                'template' => '{pager}{items}{pager}',
                'pager' => array('firstPageCssClass' => 'previous', 'lastPageCssClass' => 'next', 'firstPageLabel' => '<<', 'lastPageLabel' => '>>'),
            ));*/ ?>

            <div class="well">
                <div class = "topic">
                    <table class="table table-striped table-condensed">
                        <?php echo ListView::widget([
                                'dataProvider' => $dataProvider,
                                'id'           => 'bbiiTopic',
                                'itemView'     => '_topic',
                                //'pager'        => array('firstPageCssClass' => 'previous', 'lastPageCssClass' => 'next', 'firstPageLabel' => '<<', 'lastPageLabel' => '>>'),
                                //'template'     => '{pager}{items}{pager}',
                            ]);
                        ?>
                    </table>
                </div>
            </div>
{'fraction_non_alphanumeric': 0.1818798778418731, 'fraction_numerical': 0.0019228594050446782, 'mean_word_length': 1.4344713656387664, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 209, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 18, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1511779', 'n_tokens_mistral': 2533, 'n_tokens_neox': 2398, 'n_words': 409}