From: fomichev Date: Fri, 28 Feb 2025 11:22:19 +0000 (+0300) Subject: Исправление стилизации меток и кнопок X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=d78b9a2abb8a31d36f930bc27f02a38944c26eed;p=erp24_rep%2Fyii-erp24%2F.git Исправление стилизации меток и кнопок --- diff --git a/erp24/views/marketplace-order-status-history/index.php b/erp24/views/marketplace-order-status-history/index.php index 6eef9d2e..31d6a092 100644 --- a/erp24/views/marketplace-order-status-history/index.php +++ b/erp24/views/marketplace-order-status-history/index.php @@ -52,6 +52,10 @@ $this->params['breadcrumbs'][] = $this->title; $class = 'bg-success text-white'; } elseif ($status === 'CANCELLED') { $class = 'bg-danger text-white'; + } elseif ($status === 'PROCESSING') { + $class = 'bg-primary text-white'; + } else { + $class = 'bg-secondary text-white'; } return Html::tag('span', $status, ['class' => "badge $class"]); }, diff --git a/erp24/views/marketplace-orders/index.php b/erp24/views/marketplace-orders/index.php index 9f3520c4..5f1ca3b9 100644 --- a/erp24/views/marketplace-orders/index.php +++ b/erp24/views/marketplace-orders/index.php @@ -51,6 +51,7 @@ YiiAsset::register($this); 'format' => 'raw', 'value' => function ($model) { $status = $model->status->code ?? ''; + $substatus = $model->substatus->code ?? ''; $class = ''; if ($status === 'DELIVERED') { $class = 'bg-success text-white'; @@ -63,22 +64,25 @@ YiiAsset::register($this); } $output = Html::tag('span', $status, ['class' => "badge $class"]); - - if ($status === 'PROCESSING' ) { + $output .= '
'; + if ($status === 'PROCESSING') { $readyUrl = Url::to(['update-to-ready-status', 'id' => $model->id]); $cancelUrl = Url::to(['update-to-cancelled-status', 'id' => $model->id]); - $output .= '
' . - Html::a('Готов', $readyUrl, [ - 'class' => 'btn btn-sm btn-success', - 'data-method' => 'post', - 'data-confirm' => 'Вы уверены, что хотите перевести заказ в статус "Готов к отправке"?', - ]) . ' ' . - Html::a('Отменить', $cancelUrl, [ + if ($substatus === 'STARTED') { + $output .= '
' . + Html::a('Готов', $readyUrl, [ + 'class' => 'btn btn-sm btn-success', + 'data-method' => 'post', + 'data-confirm' => 'Вы уверены, что хотите перевести заказ в статус "Готов к отправке"?', + ]) . ' '; + } + $output .= Html::a('Отменить', $cancelUrl, [ 'class' => 'btn btn-sm btn-danger', 'data-method' => 'post', 'data-confirm' => 'Вы уверены, что хотите отменить заказ?', - ]) . '
'; + ]) . ' '; } + $output .= '
'; return $output; }, 'filter' => Html::input('text', 'MarketplaceOrdersSearch[status_code]', $searchModel->status_code, ['class' => 'form-control']),