|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- <?php
-
-
-
- use common\helpers\GlobalParam;
- use domain\User\UserProducer\UserProducerModule;
- use yii\helpers\Html;
-
- $userProducerModule = UserProducerModule::getInstance();
- $userCurrent = GlobalParam::getCurrentUser();
-
- $this->setTitle('Producteurs') ;
- $this->setIcon('grain');
- $this->setMeta('description', 'Retrouvez les producteurs présents sur Opendistrib.') ;
-
- ?>
-
- <div class="site-producers">
- <div class="row">
- <div class="col-md-6 col-sm-12" id="wrapper-producers-list">
- <div id="producers-list">
- <div id="producer-search">
- <div class="form-group has-feedback">
- <input type="text" class="form-control input-lg" placeholder="Recherche par nom, commune ou code postal">
- <span class="glyphicon glyphicon-search form-control-feedback"></span>
- </div>
- </div>
- <div class="alert alert-warning alert-no-results">
- Aucun producteur ne correspond à votre recherche.
- </div>
- <?php foreach($producersArray as $producer): ?>
- <div class="panel panel-default panel-producer">
- <div class="panel-body">
- <div class="<?= $producer->logo ? 'col-md-8 col-sm-8' : 'col-md-12'; ?>">
- <h2><?= Html::encode($producer->name) ?></h2>
- <p class="producer-type"><?= Html::encode($producer->type) ?></p>
- <p class="producer-location">
- <?php if($producer->latitude && $producer->longitude): ?>
- <?= Html::a('<span class="glyphicon glyphicon-map-marker"></span> '.Html::encode($producer->postcode.' '.$producer->city),'javascript:void(0);', ['class' => 'btn btn-default view-producer', 'data-id' => $producer->id]);?>
- <?php else: ?>
- <span class="glyphicon glyphicon-map-marker"></span>
- <span class="location"><?= Html::encode($producer->postcode.' '.$producer->city); ?></span>
- <?php endif; ?>
-
- <?php if($producer->website): ?>
- <a href="<?= Html::encode($producer->website); ?>" target="_blank" class="btn btn-default">
- <span class="glyphicon glyphicon-globe"></span>
- Site web
- </a>
- <?php endif; ?>
- </p>
- </div>
- <?php if($producer->logo): ?>
- <div class="col-md-4 col-sm-4">
- <div class="logo"<?php if (!is_null($producer->background_color_logo) && strlen($producer->background_color_logo)): ?> style="background-color:<?= Html::encode($producer->background_color_logo); ?>"<?php endif; ?>>
- <img class="img-logo"
- src="<?= Yii::$app->urlManagerProducer->getHostInfo() . '/' . Yii::$app->urlManagerProducer->baseUrl; ?>/uploads/<?= $producer->logo; ?>"
- alt="Logo <?= Html::encode($producer->name) ?>">
- </div>
- </div>
- <?php endif; ?>
- </div>
- <div class="panel-footer">
- <?= Html::a('Visiter',Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => $producer->slug]), ['class'=>'btn btn-primary float-right']) ; ?>
-
- <?php if($userCurrent): ?>
- <?php $this->getLogic()->setProducerContext($producer); ?>
- <?php if($userProducerModule->isProducerBookmarked($userCurrent)): ?>
- <?= Html::a('<span class="glyphicon glyphicon-star"></span>', ['bookmark/remove', 'idProducer' => $producer->id], ['class'=>'btn btn-default', 'data-toggle' => 'tooltip', 'data-placement' => 'bottom', 'data-original-title' => 'Supprimer de ma liste de producteurs']) ; ?>
- <?php else: ?>
- <?= Html::a('<span class="glyphicon glyphicon-star-empty"></span>', ['bookmark/add', 'idProducer' => $producer->id], ['class'=>'btn btn-default', 'data-toggle' => 'tooltip', 'data-placement' => 'bottom', 'data-original-title' => 'Ajouter à ma liste de producteurs']) ; ?>
- <?php endif; ?>
- <?php endif; ?>
- <div class="clr"></div>
- </div>
- </div>
- <?php endforeach; ?>
- </div>
- </div>
- <div class="col-md-6 col-sm-12" id="wrapper-producers-map">
- <div id="producers-map"></div>
- </div>
- </div>
- <div class="clr"></div>
- <?php
- /*
- GridView::widget([
- 'dataProvider' => $dataProviderProducers,
- 'summary' => '',
- 'columns' => [
- [
- 'attribute' => 'name',
- ],
- [
- 'attribute' => 'type',
- ],
- [
- 'label' => 'Localisation',
- 'value' => function($model) {
- return $model->city. ' ('.$model->postcode.')' ;
- }
- ],
- [
- 'label' => 'Lien',
- 'format' => 'raw',
- 'value' => function($model) {
- $iconLock = (strlen($model->code)) ? ' <span class="glyphicon glyphicon-lock"></span>' : '' ;
- $html = Html::a('Visiter',Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => $model->slug]), ['class'=>'btn btn-primary']) ;
- $html .= $iconLock ;
- return $html ;
- }
- ],
- ]
- ]);
- */
- ?>
-
- </div>
|