You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0KB

  1. <?php
  2. $producer = $this->context->getProducer() ;
  3. $this->setPageTitle(Html::encode($producer->type.' à '.$producer->ville)) ;
  4. ?>
  5. <?php if(strlen($producer->description) || strlen($producer->photo)): ?>
  6. <?php
  7. if(strlen($producer->description) && strlen($producer->photo))
  8. $col_size = 'col-md-6' ;
  9. else
  10. $col_size = 'col-md-12' ;
  11. ?>
  12. <section id="presentation">
  13. <?php if(strlen($producer->photo)): ?>
  14. <div class="photo <?= $col_size ?>">
  15. <img class="img-photo" src="<?= Yii::$app->urlManager->baseUrl; ?>/uploads/<?= $producer->photo; ?>" alt="Photo <?= Html::encode($producer->nom) ?>" />
  16. </div>
  17. <?php endif; ?>
  18. <?php if(strlen($producer->description)): ?>
  19. <div class="description <?= $col_size ?>">
  20. <?= nl2br(Html::encode($producer->description)); ?>
  21. </div>
  22. <?php endif; ?>
  23. <div class="clr"></div>
  24. </section>
  25. <?php endif; ?>
  26. <section id="points-vente">
  27. <h3><span>Points de vente</span></h3>
  28. <?= GridView::widget([
  29. 'dataProvider' => $data_provider_points_vente,
  30. 'summary' => '',
  31. 'columns' => [
  32. 'nom',
  33. 'localite',
  34. [
  35. 'label' => 'Jours de livraison',
  36. 'value' => function($model) {
  37. return $model->strJoursLivraison() ;
  38. }
  39. ]
  40. ],
  41. ]); ?>
  42. </section>
  43. <section id="produits">
  44. <h3><span>Produits</span></h3>
  45. <?= GridView::widget([
  46. 'dataProvider' => $data_provider_produits,
  47. 'summary' => '',
  48. 'columns' => [
  49. [
  50. 'attribute' => 'photo',
  51. 'format' => 'raw',
  52. 'headerOptions' => ['class' => 'td-photo'],
  53. 'value' => function($model) {
  54. if(strlen($model->photo)) {
  55. return '<img class="photo-produit" src="'.Yii::$app->urlManagerProducer->baseUrl.'/uploads/'.$model->photo.'" />' ;
  56. }
  57. return '' ;
  58. }
  59. ],
  60. 'nom',
  61. 'description',
  62. ],
  63. ]); ?>
  64. </section>