Преглед изворни кода

Refactoring/traduction vues producer/views/site

refactoring
Guillaume Bourgeois пре 6 година
родитељ
комит
2a4ab2e3ab
1 измењених фајлова са 17 додато и 17 уклоњено
  1. +17
    -17
      producer/views/site/index.php

+ 17
- 17
producer/views/site/index.php Прегледај датотеку

@@ -37,29 +37,29 @@ termes.
*/

$producer = $this->context->getProducer() ;
$this->setPageTitle(Html::encode($producer->type.' à '.$producer->ville)) ;
$this->setPageTitle(Html::encode($producer->type.' à '.$producer->city)) ;
?>

<?php if(strlen($producer->description) || strlen($producer->photo)): ?>
<?php
if(strlen($producer->description) && strlen($producer->photo))
$col_size = 'col-md-6' ;
$colSize = 'col-md-6' ;
else
$col_size = 'col-md-12' ;
$colSize = 'col-md-12' ;
?>

<section id="commander">
<a class="btn btn-primary btn-lg" href="<?php if(Yii::$app->user->isGuest): echo Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer','id' => $this->context->getProducer()->id,'return_url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['commande/create','slug_producer' => $this->context->getProducer()->slug])]); else: echo Yii::$app->urlManager->createUrl(['commande/create']); endif; ?>"><span class="glyphicon glyphicon-plus"></span> Passer une commande</a>
<a class="btn btn-primary btn-lg" href="<?php if(Yii::$app->user->isGuest): echo Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer','id' => $this->context->getProducer()->id,'return_url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/create','slug_producer' => $this->context->getProducer()->slug])]); else: echo Yii::$app->urlManager->createUrl(['order/create']); endif; ?>"><span class="glyphicon glyphicon-plus"></span> Passer une commande</a>
</section>

<section id="presentation">
<?php if(strlen($producer->photo)): ?>
<div class="photo <?= $col_size ?>">
<img class="img-photo" src="<?= Yii::$app->urlManager->baseUrl; ?>/uploads/<?= $producer->photo; ?>" alt="Photo <?= Html::encode($producer->nom) ?>" />
<div class="photo <?= $colSize ?>">
<img class="img-photo" src="<?= Yii::$app->urlManager->baseUrl; ?>/uploads/<?= $producer->photo; ?>" alt="Photo <?= Html::encode($producer->name) ?>" />
</div>
<?php endif; ?>
<?php if(strlen($producer->description)): ?>
<div class="description <?= $col_size ?>">
<div class="description <?= $colSize ?>">
<?= nl2br(Html::encode($producer->description)); ?>
</div>
<?php endif; ?>
@@ -67,10 +67,10 @@ else
</section>
<?php endif; ?>

<section id="points-vente">
<section id="points-sale">
<h3><span>Points de vente</span></h3>
<?= GridView::widget([
'dataProvider' => $data_provider_points_vente,
'dataProvider' => $dataProviderPointsSale,
'summary' => '',
'columns' => [
'nom',
@@ -78,7 +78,7 @@ else
[
'label' => 'Jours de livraison',
'value' => function($model) {
return $model->strJoursLivraison() ;
return $model->getStrDeliveryDays() ;
}
]
],
@@ -86,10 +86,10 @@ else
</section>


<section id="produits">
<section id="products">
<h3><span>Produits</span></h3>
<?= GridView::widget([
'dataProvider' => $data_provider_produits,
'dataProvider' => $dataProviderProducts,
'summary' => '',
'columns' => [
[
@@ -98,18 +98,18 @@ else
'headerOptions' => ['class' => 'td-photo'],
'value' => function($model) {
if(strlen($model->photo)) {
return '<img class="photo-produit" src="'.Yii::$app->urlManagerProducer->baseUrl.'/uploads/'.$model->photo.'" />' ;
return '<img class="photo-product" src="'.Yii::$app->urlManagerProducer->baseUrl.'/uploads/'.$model->photo.'" />' ;
}
return '' ;
}
],
'nom',
'name',
'description',
[
'attribute' => 'poids',
'attribute' => 'weight',
'value' => function($model) {
if(strlen($model->poids)) {
return $model->poids.'g' ;
if(strlen($model->weight)) {
return $model->weight.'g' ;
}
return '' ;
}

Loading…
Откажи
Сачувај