|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?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>
|