|
- <?php
-
-
-
- $producer = $this->context->getProducer() ;
- $this->setPageTitle(Html::encode($producer->type.' à '.$producer->city)) ;
- ?>
-
- <?php if(strlen($producer->description) || strlen($producer->photo)): ?>
- <?php
- if(strlen($producer->description) && strlen($producer->photo))
- $colSize = 'col-md-6' ;
- else
- $colSize = 'col-md-12' ;
- ?>
-
- <section id="presentation">
- <?php if(strlen($producer->photo)): ?>
- <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 <?= $colSize ?>">
- <?= nl2br(Html::encode($producer->description)); ?>
- </div>
- <?php endif; ?>
- <div class="clr"></div>
- </section>
- <?php endif; ?>
-
- <section id="points-sale">
- <h3><span>Points de vente</span></h3>
- <?= GridView::widget([
- 'dataProvider' => $dataProviderPointsSale,
- 'summary' => '',
- 'columns' => [
- [
- 'attribute' => 'name',
- 'format' => 'raw',
- 'contentOptions' => ['class' => 'name'],
- 'value' => function($model) {
- $html = '<span class="the-name">'.Html::encode($model->name).'</span>' ;
- if(strlen($model->locality)) {
- $html .= '<br />à '.Html::encode($model->locality) ;
- }
- return $html ;
- }
- ],
- [
- 'label' => 'Jours de livraison',
- 'value' => function($model) {
- return $model->getStrDeliveryDays() ;
- }
- ]
- ],
- ]); ?>
- </section>
-
-
- <section id="products">
- <h3><span>Produits</span></h3>
- <?= GridView::widget([
- 'dataProvider' => $dataProviderProducts,
- 'summary' => '',
- 'columns' => [
- [
- 'attribute' => 'photo',
- 'format' => 'raw',
- 'contentOptions' => ['class' => 'photo'],
- 'value' => function($model) {
- if(strlen($model->photo)) {
- return '<img class="photo-product" src="'.Yii::$app->urlManagerProducer->baseUrl.'/uploads/'.$model->photo.'" />' ;
- }
- return '' ;
- }
- ],
- [
- 'attribute' => 'name',
- 'format' => 'raw',
- 'contentOptions' => ['class' => 'name'],
- 'value' => function($model) {
- $html = '<span class="the-name">'.Html::encode($model->name).'</span>' ;
- if(strlen($model->description)) {
- $html .= ' / '.Html::encode($model->description) ;
- }
- if(strlen($model->recipe)) {
- $html .= '<br />'.Html::encode($model->recipe) ;
- }
- return $html ;
- }
- ],
- [
- 'attribute' => 'weight',
- 'value' => function($model) {
- if(strlen($model->weight)) {
- return $model->weight.' g' ;
- }
- return '' ;
- }
- ],
- [
- 'attribute' => 'price',
- 'value' => function($model) {
- if($model->price) {
- return Price::format($model->price) ;
- }
- return '' ;
- }
- ],
- ],
- ]); ?>
- </section>
|