@@ -119,6 +119,10 @@ $this->addBreadcrumb($this->getTitle()); | |||
<?= $form->field($model, 'postcode') ?> | |||
<?= $form->field($model, 'city') ?> | |||
<h4>Contact</h4> | |||
<?= $form->field($model, 'contact_email') ?> | |||
<?= $form->field($model, 'website') ?> | |||
<h4>Apparence</h4> | |||
<?= $form->field($model, 'background_color_logo') ?> | |||
<?= $form->field($model, 'logoFile')->fileInput() ?> |
@@ -248,6 +248,7 @@ class Producer extends ActiveRecordCommon | |||
'admin_comment', | |||
'export_shopping_cart_labels_format', | |||
'document_image_bottom', | |||
'website' | |||
], | |||
'string' | |||
], | |||
@@ -469,7 +470,8 @@ class Producer extends ActiveRecordCommon | |||
'option_document_display_price_unit_reference' => "Afficher les prix au kilogramme", | |||
'id_user_group_default' => "Groupe utilisateur par défaut attribué à l'inscription", | |||
'option_check_by_default_prevent_user_credit' => "Par défaut, prévenir l'utilisateur quand on crédite son compte", | |||
'delivery_note_automatic_validation' => 'Validation automatique des bons de livraison' | |||
'delivery_note_automatic_validation' => 'Validation automatique des bons de livraison', | |||
'website' => 'Site web' | |||
]; | |||
} | |||
@@ -0,0 +1,26 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
/** | |||
* Class m240131_142637_producer_add_column_website | |||
*/ | |||
class m240131_142637_producer_add_column_website extends Migration | |||
{ | |||
/** | |||
* {@inheritdoc} | |||
*/ | |||
public function safeUp() | |||
{ | |||
$this->addColumn('producer', 'website', Schema::TYPE_STRING); | |||
} | |||
/** | |||
* {@inheritdoc} | |||
*/ | |||
public function safeDown() | |||
{ | |||
$this->dropColumn('producer', 'website'); | |||
} | |||
} |
@@ -75,27 +75,34 @@ $this->setMeta('description', 'Retrouvez les producteurs présents sur Opendistr | |||
<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; ?>" | |||
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']) ; ?> | |||
<?= 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 float-right', 'data-toggle' => 'tooltip', 'data-placement' => 'bottom', 'data-original-title' => 'Supprimer de ma liste de producteurs']) ; ?> | |||
<?= 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 float-right', 'data-toggle' => 'tooltip', 'data-placement' => 'bottom', 'data-original-title' => 'Ajouter à ma liste de producteurs']) ; ?> | |||
<?= 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> |
@@ -853,6 +853,7 @@ section#header-title h1 .glyphicon { | |||
-webkit-border-radius: 0px; | |||
border-radius: 0px 0px 8px 8px; | |||
border: 0px none; | |||
padding: 10px 30px; | |||
} | |||
/* line 881, ../sass/screen.scss */ | |||
.site-producers #producers-list .panel .logo { |
@@ -875,7 +875,7 @@ section#header-title { | |||
.panel-footer { | |||
@include border-radius(0px 0px 8px 8px); | |||
border: 0px none; | |||
//text-align: right; | |||
padding: 10px 30px; | |||
} | |||
.logo { |
@@ -204,6 +204,7 @@ class SiteController extends ProducerBaseController | |||
return $this->render('contact', [ | |||
'model' => $model, | |||
'producer' => $this->getProducerCurrent() | |||
]); | |||
} | |||
@@ -45,13 +45,12 @@ $this->setTitle('Contact'); | |||
?> | |||
<div class="site-contact"> | |||
<div class="row"> | |||
<div class="col-lg-5"> | |||
<div class="col-lg-6"> | |||
<?php $form = ActiveForm::begin(['id' => 'contact-form', 'enableClientValidation' => false,]); ?> | |||
<?= $form->field($model, 'name') ?> | |||
<?= $form->field($model, 'email') ?> | |||
<?= $form->field($model, 'subject') ?> | |||
<?= $form->field($model, 'body')->textArea(['rows' => 6]) ?> | |||
<?php echo $form->field($model, 'verifyCode')->widget(yii\captcha\Captcha::className(), [ | |||
'template' => '<div class="row"><div class="col-md-12">{image}</div><div class="col-md-12">{input}</div></div>', | |||
]); ?> | |||
@@ -61,5 +60,14 @@ $this->setTitle('Contact'); | |||
</div> | |||
<?php ActiveForm::end(); ?> | |||
</div> | |||
<div class="col-lg-6"> | |||
<?php if($producer->website): ?> | |||
<br /> | |||
<a href="<?= Html::encode($producer->website); ?>" target="_blank" class="btn btn-default"> | |||
<span class="glyphicon glyphicon-globe"></span> | |||
Site web | |||
</a> | |||
<?php endif; ?> | |||
</div> | |||
</div> | |||
</div> |