Browse Source

[Producer] Captcha : formulaire de contact #228

refactoring
Guillaume Bourgeois 2 years ago
parent
commit
4a82355300
3 changed files with 7 additions and 15 deletions
  1. +4
    -11
      frontend/views/site/contact.php
  2. +1
    -2
      producer/controllers/SiteController.php
  3. +2
    -2
      producer/views/layouts/main.php

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



<div class="row"> <div class="row">
<div class="col-lg-5"> <div class="col-lg-5">
<!--<h2>par téléphone</h2>
<p id="contact-phone">
Guillaume Bourgeois<br />
<span class="glyphicon glyphicon-phone"></span> 06 84 59 71 79

<br /><br />
Fabien Normand<br />
<span class="glyphicon glyphicon-phone"></span> 07 81 99 97 01
</p>-->
<h2>Par email</h2> <h2>Par email</h2>
<div class="alert alert-info">
Ce formulaire de contact vous permet de joindre le développeur de la plateforme Opendistrib.
Si vous souhaitez joindre un producteur, merci de le faire directement depuis son espace producteur.
</div>
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?> <?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
<?= $form->field($model, 'name') ?> <?= $form->field($model, 'name') ?>
<?= $form->field($model, 'email') ?> <?= $form->field($model, 'email') ?>

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

*/ */
public function actionContact() public function actionContact()
{ {
return $this->redirect(['site/index']);

$model = new ContactForm(); $model = new ContactForm();
$producer = $this->getProducer(); $producer = $this->getProducer();


$email = $contact->email; $email = $contact->email;
} }


$email = 'guillaume@laclic.fr';
if (strlen($email) && $model->sendEmail($email)) { if (strlen($email) && $model->sendEmail($email)) {
$isSent = true; $isSent = true;
} }

+ 2
- 2
producer/views/layouts/main.php View File

'visible' => !Yii::$app->user->isGuest && $producer->credit, 'visible' => !Yii::$app->user->isGuest && $producer->credit,
'active' => $this->getControllerAction() == 'credit/history', 'active' => $this->getControllerAction() == 'credit/history',
], ],
/*[
[
'label' => '<span class="glyphicon glyphicon-envelope"></span> Contact', 'label' => '<span class="glyphicon glyphicon-envelope"></span> Contact',
'url' => Yii::$app->urlManager->createUrl(['site/contact']), 'url' => Yii::$app->urlManager->createUrl(['site/contact']),
'active' => $this->getControllerAction() == 'site/contact', 'active' => $this->getControllerAction() == 'site/contact',
],*/
],
[ [
'label' => '<span class="glyphicon glyphicon-cog"></span> Administration', 'label' => '<span class="glyphicon glyphicon-cog"></span> Administration',
'url' => Yii::$app->urlManagerBackend->createAbsoluteUrl(['site/index']), 'url' => Yii::$app->urlManagerBackend->createAbsoluteUrl(['site/index']),

Loading…
Cancel
Save