Example #1
0
$this->params['breadcrumbs'][] = $this->title;
//$this->registerJs('$(document).on("pjax:send", function(){ $("#loading").modal("show");});$(document).on("pjax:complete", function(){ $("#loading").modal("hide");})');
$this->registerJs('$(document).on("pjax:send", function(){ $(".grid-view-overlay").removeClass("hidden");});$(document).on("pjax:complete", function(){ $(".grid-view-overlay").addClass("hidden");})');
//$js=file_get_contents(__DIR__.'/index.min.js');
//$this->registerJs($js);
$css = file_get_contents(__DIR__ . '/index.css');
$this->registerCss($css);
?>
<div class="i18n-message-index">
    <div class="box box-primary">
        <div class="box-body">
            <?php 
Pjax::begin(['id' => 'message-translation-wrap']);
?>
    <?php 
echo GridView::widget(['id' => 'i18n-message-grid', 'options' => ['class' => 'grid-view table-responsive'], 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'language', 'value' => 'language', 'filter' => Message::getLocaleList([Yii::$app->sourceLanguage])], ['attribute' => 'category', 'value' => 'source.category', 'filter' => SourceMessage::getCategoryList()], ['attribute' => 'message', 'value' => 'source.message'], ['attribute' => 'translation', 'format' => 'raw', 'value' => function ($model) {
    return \modernkernel\jeditable\Editable::widget(['content' => strip_tags($model->translation), 'saveUrl' => Yii::$app->urlManager->createUrl(['/i18n/save-translation']), 'options' => ['id' => 'message_' . $model->id . '_' . $model->language, 'class' => 'jeditable-text'], 'clientOptions' => ['tooltip' => Yii::t('app', 'Click to edit'), 'indicator' => Yii::t('app', 'Saving...'), 'width' => '93%']]);
}], ['attribute' => 'is_translated', 'value' => function ($model) {
    return Core::getYesNoText($model->is_translated);
}, 'filter' => Core::getYesNoOption()], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{delete}']]]);
?>
            <?php 
Pjax::end();
?>
            <div>
                <?php 
echo \yii\helpers\Html::beginForm(Yii::$app->urlManager->createUrl(['/i18n/add']), 'post', ['class' => 'form-inline']);
?>
                    <div class="form-group">
                        <label for="language"><?php 
echo Yii::t('app', 'Language');