Browse Source

[Site] Producteurs : lien vers site internet

feature/souke
Guillaume Bourgeois 9 months ago
parent
commit
aa564230bc
8 changed files with 57 additions and 8 deletions
  1. +4
    -0
      backend/views/producer/update.php
  2. +3
    -1
      common/logic/Producer/Producer/Model/Producer.php
  3. +26
    -0
      console/migrations/m240131_142637_producer_add_column_website.php
  4. +11
    -4
      frontend/views/site/producers.php
  5. +1
    -0
      frontend/web/css/screen.css
  6. +1
    -1
      frontend/web/sass/screen.scss
  7. +1
    -0
      producer/controllers/SiteController.php
  8. +10
    -2
      producer/views/site/contact.php

+ 4
- 0
backend/views/producer/update.php View File

<?= $form->field($model, 'postcode') ?> <?= $form->field($model, 'postcode') ?>
<?= $form->field($model, 'city') ?> <?= $form->field($model, 'city') ?>


<h4>Contact</h4>
<?= $form->field($model, 'contact_email') ?>
<?= $form->field($model, 'website') ?>

<h4>Apparence</h4> <h4>Apparence</h4>
<?= $form->field($model, 'background_color_logo') ?> <?= $form->field($model, 'background_color_logo') ?>
<?= $form->field($model, 'logoFile')->fileInput() ?> <?= $form->field($model, 'logoFile')->fileInput() ?>

+ 3
- 1
common/logic/Producer/Producer/Model/Producer.php View File

'admin_comment', 'admin_comment',
'export_shopping_cart_labels_format', 'export_shopping_cart_labels_format',
'document_image_bottom', 'document_image_bottom',
'website'
], ],
'string' 'string'
], ],
'option_document_display_price_unit_reference' => "Afficher les prix au kilogramme", 'option_document_display_price_unit_reference' => "Afficher les prix au kilogramme",
'id_user_group_default' => "Groupe utilisateur par défaut attribué à l'inscription", '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", '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'
]; ];
} }



+ 26
- 0
console/migrations/m240131_142637_producer_add_column_website.php View File

<?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');
}
}

+ 11
- 4
frontend/views/site/producers.php View File

<span class="glyphicon glyphicon-map-marker"></span> <span class="glyphicon glyphicon-map-marker"></span>
<span class="location"><?= Html::encode($producer->postcode.' '.$producer->city); ?></span> <span class="location"><?= Html::encode($producer->postcode.' '.$producer->city); ?></span>
<?php endif; ?> <?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> </p>
</div> </div>
<?php if($producer->logo): ?> <?php if($producer->logo): ?>
<div class="col-md-4 col-sm-4"> <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; ?>> <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" <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) ?>"> alt="Logo <?= Html::encode($producer->name) ?>">
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
</div> </div>
<div class="panel-footer"> <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 if($userCurrent): ?>
<?php $this->getLogic()->setProducerContext($producer); ?> <?php $this->getLogic()->setProducerContext($producer); ?>
<?php if($userProducerModule->isProducerBookmarked($userCurrent)): ?> <?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: ?> <?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; ?>
<?php endif; ?> <?php endif; ?>
</div> </div>

+ 1
- 0
frontend/web/css/screen.css View File

-webkit-border-radius: 0px; -webkit-border-radius: 0px;
border-radius: 0px 0px 8px 8px; border-radius: 0px 0px 8px 8px;
border: 0px none; border: 0px none;
padding: 10px 30px;
} }
/* line 881, ../sass/screen.scss */ /* line 881, ../sass/screen.scss */
.site-producers #producers-list .panel .logo { .site-producers #producers-list .panel .logo {

+ 1
- 1
frontend/web/sass/screen.scss View File

.panel-footer { .panel-footer {
@include border-radius(0px 0px 8px 8px); @include border-radius(0px 0px 8px 8px);
border: 0px none; border: 0px none;
//text-align: right;
padding: 10px 30px;
} }


.logo { .logo {

+ 1
- 0
producer/controllers/SiteController.php View File



return $this->render('contact', [ return $this->render('contact', [
'model' => $model, 'model' => $model,
'producer' => $this->getProducerCurrent()
]); ]);
} }



+ 10
- 2
producer/views/site/contact.php View File

?> ?>
<div class="site-contact"> <div class="site-contact">
<div class="row"> <div class="row">
<div class="col-lg-5">
<div class="col-lg-6">
<?php $form = ActiveForm::begin(['id' => 'contact-form', 'enableClientValidation' => false,]); ?> <?php $form = ActiveForm::begin(['id' => 'contact-form', 'enableClientValidation' => false,]); ?>
<?= $form->field($model, 'name') ?> <?= $form->field($model, 'name') ?>
<?= $form->field($model, 'email') ?> <?= $form->field($model, 'email') ?>
<?= $form->field($model, 'subject') ?> <?= $form->field($model, 'subject') ?>
<?= $form->field($model, 'body')->textArea(['rows' => 6]) ?> <?= $form->field($model, 'body')->textArea(['rows' => 6]) ?>
<?php echo $form->field($model, 'verifyCode')->widget(yii\captcha\Captcha::className(), [ <?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>', 'template' => '<div class="row"><div class="col-md-12">{image}</div><div class="col-md-12">{input}</div></div>',
]); ?> ]); ?>
</div> </div>
<?php ActiveForm::end(); ?> <?php ActiveForm::end(); ?>
</div> </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>
</div> </div>

Loading…
Cancel
Save