Parcourir la source

Nouveau site frontend

refactoring
keun il y a 6 ans
Parent
révision
7436bc69c5
29 fichiers modifiés avec 266 ajouts et 1378 suppressions
  1. +0
    -1
      common/assets/CommonAsset.php
  2. +1
    -1
      frontend/assets/AppAsset.php
  3. +0
    -515
      frontend/controllers/CommandeController.php
  4. +0
    -30
      frontend/controllers/EtablissementController.php
  5. +21
    -57
      frontend/controllers/SiteController.php
  6. +0
    -307
      frontend/views/commande/_form.php
  7. +0
    -83
      frontend/views/commande/_liste_etablissements.php
  8. +0
    -32
      frontend/views/commande/create.php
  9. +0
    -122
      frontend/views/commande/index.php
  10. +0
    -40
      frontend/views/commande/update.php
  11. +0
    -22
      frontend/views/etablissement/index.php
  12. +60
    -25
      frontend/views/layouts/main.php
  13. +1
    -1
      frontend/views/site/_tarifs_producteur.php
  14. +0
    -14
      frontend/views/site/about.php
  15. +4
    -4
      frontend/views/site/index.php
  16. +37
    -0
      frontend/views/site/producers.php
  17. +1
    -1
      frontend/views/site/signup.php
  18. BIN
      frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/_fonts.scssc
  19. BIN
      frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/_responsive.scssc
  20. BIN
      frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/_systeme_commandes.scssc
  21. BIN
      frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/ie.scssc
  22. BIN
      frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/ie7.scssc
  23. BIN
      frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/print.scssc
  24. BIN
      frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/screen.scssc
  25. +120
    -116
      frontend/web/css/screen.css
  26. +4
    -0
      frontend/web/js/frontend.js
  27. +15
    -4
      frontend/web/sass/screen.scss
  28. +2
    -1
      producer/components/UrlManagerProducer.php
  29. +0
    -2
      producer/views/commande/historique.php

+ 0
- 1
common/assets/CommonAsset.php Voir le fichier

@@ -35,7 +35,6 @@ class CommonAsset extends \common\components\MyAssetBundle
$this->addAsset('css','css/screen.css') ;
// js
$this->addAsset('js','bootstrap/js/bootstrap.min.js');
$this->addAsset('js','js/jquery-ui-1.11.4.custom/jquery-ui.min.js');
}
}

+ 1
- 1
frontend/assets/AppAsset.php Voir le fichier

@@ -30,6 +30,6 @@ class AppAsset extends \common\components\MyAssetBundle
$this->addAsset('css','css/screen.css');

// js
$this->addAsset('js','js/frontend.js');
}
}

+ 0
- 515
frontend/controllers/CommandeController.php Voir le fichier

@@ -1,515 +0,0 @@
<?php

namespace frontend\controllers;

use common\models\ProductionProduit;
use common\models\CommandeProduit;
use Yii;
use yii\filters\AccessControl;
use common\models\Commande;
use common\models\PointVente;
use common\models\Production;
use common\models\Produit;
use common\models\Etablissement;
use common\helpers\Departements;
use yii\helpers\Html;
use frontend\models\AddEtablissementForm;
use common\models\UserEtablissement;
use common\models\CreditHistorique;
use yii\web\NotFoundHttpException;
use common\models\ProductionPointVente;
use yii\base\UserException;
use frontend\controllers\FrontendController;

class CommandeController extends FrontendController {

public function behaviors() {
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'],
]
],
],
];
}

public function actionInfosProduction($id_production) {

$production = Production::findOne($id_production);

if ($production) {
$arr = [];

$produits_dispos = ProductionProduit::findProduits($production->id);

$arr['produits_dispos'] = $produits_dispos;

$points_vente = PointVente::find()
->joinWith(['productionPointVente' => function($q) use ($production) {
$q->where(['id_production' => $production->id]);
}])
->where([
'id_etablissement' => $production->id_etablissement,
])
->all();

$arr['points_vente'] = [];
foreach ($points_vente as $pv) {
if (isset($pv->productionPointVente) &&
isset($pv->productionPointVente[0])) {
$arr['points_vente'][$pv->id] = $pv->productionPointVente[0]->livraison;
} else {
$arr['points_vente'][$pv->id] = false;
}
}

return json_encode($arr);
}

return json_encode([]);
}

public static function initForm($commande = null) {

// etablissements
$etablissements = Yii::$app->user->identity->getEtablissementsFavoris();
$id_etablissement = Yii::$app->request->get('id_etablissement', 0);

$etablissement_paiement_ok = false;
if ($id_etablissement) {
$etablissement = Etablissement::findOne($id_etablissement);
if ($etablissement->etatPaiement() == Etablissement::PAIEMENT_OK || $etablissement->etatPaiement() == Etablissement::PAIEMENT_ESSAI) {
$etablissement_paiement_ok = true;
}
}

// etablissement
$etablissement = Etablissement::findOne($id_etablissement);

// points de vente
$points_vente = PointVente::find()
->with('pointVenteUser')
->where(['id_etablissement' => $id_etablissement])
->andWhere('acces_restreint = 0 OR (acces_restreint = 1 AND (SELECT COUNT(*) FROM point_vente_user WHERE point_vente.id = point_vente_user.id_point_vente AND point_vente_user.id_user = :id_user) > 0)')
->params([':id_user' => Yii::$app->user->identity->id])
->all();
$arr_points_vente = $points_vente;

// jours de production
$heure_limite = 20;
$date = date('Y-m-d');
if (isset($etablissement)) {
$heure_limite = $etablissement->heure_limite_commande;
if (date('H') >= $heure_limite) {
$date = date('Y-m-d', strtotime(date('Y-m-d')) + ($etablissement->delai_commande) * (24 * 60 * 60));
} else {
$date = date('Y-m-d', strtotime(date('Y-m-d')) + ($etablissement->delai_commande - 1) * (24 * 60 * 60));
}
}

$jours_production = Production::find()
->where(['actif' => 1])
->andWhere('date > :date')
->andWhere(['id_etablissement' => $id_etablissement])
->addParams([':date' => $date])
->all();

$arr_jours_production = array('' => '--');
foreach ($jours_production as $j)
$arr_jours_production[$j->id] = date('d/m/Y', strtotime($j->date));

// produits
$produits = Produit::find()
->leftJoin('production_produit', 'produit.id = production_produit.id_produit')
->where(['produit.actif' => 1, 'id_etablissement' => $id_etablissement])
->andWhere('produit.vrac IS NULL OR produit.vrac = 0')
->orderBy('produit.order ASC')->all();
$arr_produits = array();
foreach ($produits as $p)
$arr_produits[] = $p;

// produits vrac
$produits_vrac = Produit::find()->where(['actif' => 1, 'vrac' => 1])->orderBy('order ASC')->all();

// produits selec
$posts = Yii::$app->request->post();
$produits_selec = [];
if (isset($posts['Produit'])) {
foreach ($posts['Produit'] as $key => $quantity) {
$key = (int) str_replace('produit_', '', $key);
$p = Produit::find()->where(['id' => $key])->one();
if ($p && $quantity)
$produits_selec[$p->id] = (int) $quantity;
}
}
elseif (!is_null($commande)) {
$produits_commande = CommandeProduit::find()->where(['id_commande' => $commande->id])->all();
foreach ($produits_commande as $pc) {
$produits_selec[$pc->id_produit] = (int) $pc->quantite;
}
}

$produits_dispos = [];
$production = null;
if (!is_null($commande) && $commande->id_production) {
$produits_dispos = ProductionProduit::findProduits($commande->id_production);
$production = Production::find()->where(['id' => $commande->id_production])->one();
}

$commandes = Commande::find()
->where(['id_user' => Yii::$app->user->identity->id])
->all();

if ($id_etablissement) {
$user_etablissement = UserEtablissement::find()
->where([
'id_etablissement' => $id_etablissement,
'id_user' => Yii::$app->user->identity->id
])
->one();

$credit = $user_etablissement->credit;
} else {
$credit = 0;
}

return [
'points_vente' => $arr_points_vente,
'jours_production' => $arr_jours_production,
'produits' => $produits,
'produits_selec' => $produits_selec,
'produits_dispos' => $produits_dispos,
'production' => $production,
'commandes_en_cours' => $commandes,
'produits_vrac' => $produits_vrac,
'etablissements' => $etablissements,
'id_etablissement' => $id_etablissement,
'etablissement' => $etablissement,
'etablissement_paiement_ok' => $etablissement_paiement_ok,
'credit' => $credit
];
}

public function actionIndex() {

$model_form_etablissement = new AddEtablissementForm();
if ($model_form_etablissement->load(Yii::$app->request->post()) && $model_form_etablissement->validate()) {
$model_form_etablissement->add();
$model_form_etablissement->code = '';
}

// liste des etablissements
$etablissements = Yii::$app->user->identity->getEtablissementsFavoris();

// liste des établissement disponibles
$arr_etablissements = Etablissement::getEtablissementsPopulateDropdown();
$data_etablissements_dispos = $arr_etablissements['data'];
$options_etablissements_dispos = $arr_etablissements['options'];

// liste des commandes
$commandes = Commande::find()
->with('commandeProduits', 'pointVente', 'creditHistorique')
->joinWith('production', 'production.etablissement')
->where(['id_user' => Yii::$app->user->id])
//->andWhere('production.date < '.)
->orderBy('production.date DESC')
->limit(40)
->all();

// initilisation commandes
foreach ($commandes as $c)
$c->init();

return $this->render('index', [
'commandes' => $commandes,
'commande_ok' => Yii::$app->getRequest()->get('commande_ok', false),
'annule_ok' => Yii::$app->getRequest()->get('annule_ok', false),
'pate_deja_petrie' => Yii::$app->getRequest()->get('pate_deja_petrie', false),
'etablissements' => $etablissements,
'model_form_etablissement' => $model_form_etablissement,
'data_etablissements_dispos' => $data_etablissements_dispos,
'options_etablissements_dispos' => $options_etablissements_dispos,
]);
}

public function actionRemoveEtablissement($id = 0) {
$user_etablissement = UserEtablissement::find()
->where(['id_etablissement' => $id, 'id_user' => Yii::$app->user->identity->id])
->one();

$user_etablissement->actif = 0;
$user_etablissement->save();

$this->redirect(['commande/index']);
}

public function actionCreate($id_etablissement = 0) {

$commande = new Commande;

$posts = Yii::$app->request->post();

if ($id_etablissement)
$this->_verifEtablissementActif($id_etablissement);

if ($commande->load($posts)) {

$commande = Commande::find()->where('id_production = ' . $posts['Commande']['id_production'])->andWhere('id_user = ' . Yii::$app->user->id)->one();
if (!$commande) {
$commande = new Commande;
$commande->load(Yii::$app->request->post());
$commande->id_user = Yii::$app->user->id;
$commande->date = date('Y-m-d H:i:s');
$commande->type = Commande::TYPE_USER;
}

$this->gestionForm($commande);
}

return $this->render('create', array_merge(self::initForm($commande), [
'model' => $commande
]));
}

public function actionUpdate($id) {

$commande = Commande::find()
->with('production')
->where(['id' => $id])
->one();

if ($commande->getEtat() != Commande::ETAT_MODIFIABLE) {
throw new UserException('Cette commande n\'est pas modifiable.');
}

$this->_verifEtablissementActif($commande->production->id_etablissement);

if ($commande && $commande->load(Yii::$app->request->post())) {
$commande->date_update = date('Y-m-d H:i:s');
$this->gestionForm($commande);
}


return $this->render('update', array_merge(self::initForm($commande), [
'model' => $commande,
'commande_introuvable' => !$commande,
]));
}

public function _verifEtablissementActif($id_etablissement) {
$etablissement = Etablissement::findOne($id_etablissement);
if ($etablissement && !$etablissement->actif) {
throw new NotFoundHttpException('Cet établissement est actuellement hors ligne.');
}
}

public function gestionForm($commande) {
$posts = Yii::$app->request->post();
$produits = array();

$quantite_totale = 0;

foreach ($posts['Produit'] as $key => $quantity) {
$key = (int) str_replace('produit_', '', $key);
$p = Produit::find()->where(['id' => $key])->one();
$quantite_totale += $quantity;
if ($p && $quantity)
$produits[] = $p;
}

// nombre de produits
$err_nb_produits = false;
if (!Yii::$app->user->identity->confiance && $quantite_totale > 3) {
$err_nb_produits = true;
}

// date
$err_date = false;
$pate_deja_petrie = false;
if (isset($commande->id_production)) {
// date de commande
$production = Production::find()->where(['id' => $commande->id_production])->one();
if (date('H') >= 20) {
$date = date('Y-m-d', strtotime(date('Y-m-d')) + 60 * 60 * 24);
} else {
$date = date('Y-m-d');
}

if ($production->date < $date) {
$err_date = true;
}
}

// point de vente
$err_point_vente = false;
if (isset($production) && $production) {

$ppv = ProductionPointVente::find()
->where([
'id_production' => $production->id,
'id_point_vente' => $posts['Commande']['id_point_vente']
])
->one();

if (!$ppv || !$ppv->livraison) {
$err_point_vente = true;
}

$point_vente = PointVente::findOne($posts['Commande']['id_point_vente']);

if ($point_vente) {
if (strlen($point_vente->code) && !$point_vente->verifCode($posts['code_point_vente_' . $point_vente->id])) {
$err_point_vente = true;
}
} else {
$err_point_vente = true;
}
}

if ($commande->validate() && count($produits) && !$err_nb_produits && !$err_date && !$err_point_vente) {

// gestion point de vente
$pv = PointVente::find()
->with('pointVenteUser')
->where(['id' => $commande->id_point_vente])
->one();
if ($pv && strlen($pv->getCommentaire()))
$commande->commentaire_point_vente = $pv->getCommentaire();
else
$commande->commentaire_point_vente = '';

// sauvegarde de la commande
$commande->save();

// suppression de tous les enregistrements CommandeProduit
if (!is_null($commande)) {
CommandeProduit::deleteAll(['id_commande' => $commande->id]);
}

// produits dispos
$produits_dispos = ProductionProduit::findProduits($production->id);

// sauvegarde des produits
foreach ($produits as $p) {
// le produit doit etre dispo à la vente
if (isset($produits_dispos[$p->id]) && $produits_dispos[$p->id]['actif']) {

$commande_produit = new CommandeProduit();
$commande_produit->id_commande = $commande->id;
$commande_produit->id_produit = $p->id;

$commande_produit->prix = $p->prix;

$quantite_voulue = (int) $posts['Produit']['produit_' . $p->id];
if ($produits_dispos[$p->id]['quantite_max'] && $quantite_voulue > $produits_dispos[$p->id]['quantite_restante'])
$quantite_voulue = $produits_dispos[$p->id]['quantite_restante'];

$commande_produit->quantite = $quantite_voulue;

$commande_produit->save();
}
}

// credit pain
$credit_pain = isset($posts['credit_pain']) && $posts['credit_pain'];
if ($credit_pain && ($pv->credit_pain || $commande->getMontantPaye())) {
$commande = Commande::find()
->with('commandeProduits')
->where(['id' => $commande->id])
->one();
$commande->init();
$montant_paye = $commande->getMontantPaye();

// à payer
if ($commande->getStatutPaiement() == Commande::STATUT_IMPAYEE) {
$montant_payer = $commande->montant - $montant_paye;
$credit = Yii::$app->user->identity->getCredit($production->id_etablissement);

if ($montant_payer > $credit) {
$montant_payer = $credit;
}

if ($montant_payer > 0) {
$commande->creditHistorique(
CreditHistorique::TYPE_PAIEMENT,
$montant_payer,
$production->id_etablissement,
Yii::$app->user->identity->id,
Yii::$app->user->identity->id
);
}
}
// surplus à rembourser
elseif ($commande->getStatutPaiement() == Commande::STATUT_SURPLUS) {
$montant_rembourser = $montant_paye - $commande->montant;
$commande->creditHistorique(
CreditHistorique::TYPE_REMBOURSEMENT,
$montant_rembourser,
$production->id_etablissement,
Yii::$app->user->identity->id,
Yii::$app->user->identity->id
);
}
}

// redirection
$this->redirect(Yii::$app->urlManager->createUrl(['commande/index', 'commande_ok' => true, 'pate_deja_petrie' => $pate_deja_petrie]));
} else {
if (!count($produits))
Yii::$app->session->setFlash('error', "Vous n'avez choisi aucun produit");
if ($err_nb_produits)
Yii::$app->session->setFlash('error', "Vous ne pouvez pas commander plus de 3 produits");
if ($err_date)
Yii::$app->session->setFlash('error', "Vous ne pouvez pas commander pour cette date.");
if ($err_point_vente)
Yii::$app->session->setFlash('error', "Point de vente invalide.");
}
}

public function actionAnnuler($id) {

$commande = Commande::find()
->with('production', 'creditHistorique', 'commandeProduits')
->where(['id' => $id])
->one();

if ($commande->getEtat() != Commande::ETAT_MODIFIABLE) {
throw new UserException('Vous ne pouvez plus annuler cette commande.');
}

$commande->init();
if ($commande && Yii::$app->user->id == $commande->id_user) {
// remboursement
if ($commande->getMontantPaye()) {
$commande->creditHistorique(
CreditHistorique::TYPE_REMBOURSEMENT,
$commande->getMontantPaye(),
$commande->production->id_etablissement,
Yii::$app->user->identity->id,
Yii::$app->user->identity->id
);
}
// delete
$commande->delete();
CommandeProduit::deleteAll(['id_commande' => $commande->id]);
}

$this->redirect(Yii::$app->urlManager->createUrl(['commande/index', 'annule_ok' => true]));
}

public function actionVerifCodePointVente($id_point_vente, $code) {
$point_vente = PointVente::findOne($id_point_vente);
if ($point_vente) {
if ($point_vente->verifCode($code)) {
return true;
}
}
return false;
}

}

+ 0
- 30
frontend/controllers/EtablissementController.php Voir le fichier

@@ -1,30 +0,0 @@
<?php

namespace frontend\controllers;

use Yii;
use yii\filters\AccessControl;
use frontend\controllers\FrontendController;

class EtablissementController extends FrontendController {

public function behaviors() {
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'],
]
],
],
];
}
public function actionIndex() {
return $this->render('index') ;
}
}

+ 21
- 57
frontend/controllers/SiteController.php Voir le fichier

@@ -76,49 +76,24 @@ class SiteController extends FrontendController {

public function actionIndex() {

// redirection de l'utilisateur vers le tableau de bord s'il est connecté
if (!Yii::$app->user->isGuest) {
return $this->redirect(['commande/index']);
}

// produits
$produits = Produit::find()->orderBy('order ASC')->all();

// contact
$model = new ContactForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->sendEmail('matthieu@lechatdesnoisettes.com')) {
Yii::$app->session->setFlash('success', "Votre message a bien été envoyé, j'y répondrai dès que possible.");
} else {
Yii::$app->session->setFlash('error', 'There was an error sending email.');
}
return $this->refresh();
}

// map
$center = new LatLng(['lat' => '46,9991224', 'lng' => '6,0582595']);
$tileLayer = new TileLayer([
'map' => 'test1',
'urlTemplate' => 'http://{s}.tile.osm.org/{z}/{x}/{y}.png',
'clientOptions' => [
'attribution' => 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> ' .
'<img src="http://developer.mapquest.com/content/osm/mq_logo.png">, ' .
'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
]
]);
$map = new LeafLet([
'tileLayer' => $tileLayer,
'center' => $center
return $this->render('index');
}
public function actionProducers() {
$data_provider_producers = new ActiveDataProvider([
'query' => Etablissement::find()
->where([
'actif' => true,
])
->orderBy('nom ASC'),
'pagination' => [
'pageSize' => 100,
],
]);
$point = new LatLng(['lat' => '46,9991224', 'lng' => '6,0582595']);
$marker = new Marker(['latLng' => $point, 'popupContent' => Html::encode('Le Chat des Noisettes')]);
$map->addLayer($marker);

return $this->render('index', [
'page_principale' => true,
'produits' => $produits,
'model' => $model,
'map' => $map
return $this->render('producers',[
'data_provider_producers' => $data_provider_producers
]);
}

@@ -126,12 +101,6 @@ class SiteController extends FrontendController {
return $this->render('mentions');
}

public function actionCommander() {
if (Yii::$app->user->isGuest) {
$this->redirect(Yii::$app->urlManager->createUrl('site/login'));
}
}

public function actionLogin() {
if (!\Yii::$app->user->isGuest) {
return Yii::$app->getResponse()->redirect(['commande/index']);
@@ -155,7 +124,6 @@ class SiteController extends FrontendController {

public function actionLogout() {
Yii::$app->user->logout();

return $this->goHome();
}

@@ -176,10 +144,6 @@ class SiteController extends FrontendController {
}
}

public function actionAbout() {
return $this->render('about');
}

public function actionSignup() {
$model = new SignupForm();
if ($model->load(Yii::$app->request->post())) {
@@ -294,10 +258,10 @@ class SiteController extends FrontendController {
}

return $this->render('etablissement', [
'model_login' => $model_login,
'model_signup' => $model_signup,
'etablissement' => $etablissement,
]);
'model_login' => $model_login,
'model_signup' => $model_signup,
'etablissement' => $etablissement,
]);
}

}

+ 0
- 307
frontend/views/commande/_form.php Voir le fichier

@@ -1,307 +0,0 @@
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Etablissement;

/* @var $this yii\web\View */
/* @var $model common\models\Commande */
/* @var $form ActiveForm */
?>
<div class="commande-form">

<h2 id="step-choix-etablissement">Je choisis mon producteur</h2>
<?php if(count($etablissements)): ?>
<?=
$this->render('_liste_etablissements.php',[
'etablissements' => $etablissements,
'context' => 'commande',
'id_etablissement' => $id_etablissement,
'etablissement_paiement_ok' => $etablissement_paiement_ok,
]) ;
?>
<div class="clr"></div>
<?php else: ?>
<div class="alert alert-info">Veuiller <a href="<?= Yii::$app->urlManager->createUrl(['commande/index']) ; ?>">ajouter un producteur</a> à votre tableau de bord avant de passer commande.</div>
<?php endif; ?>
<?php
$form = ActiveForm::begin([
'enableClientScript' => false
]);
?>
<?php if($id_etablissement && $etablissement_paiement_ok): ?>
<div class="col-md-6">
<h2 id="step-choix-date">Date de commande</h2>
<?= $form->field($model, 'id_production')->label('')->hiddenInput(); ?>

<?php if (isset($model->id)): ?>
<div class="date-commande"><span><?php echo date('d/m/Y', strtotime($production->date)); ?></span></div>
<?= Html::hiddenInput('id_commande', $model->id,['id'=>'id-commande']); ?>
<?= Html::hiddenInput('montant_paye', $model->getMontantPaye(),['id'=>'montant-paye']); ?>
<?php endif; ?>

<div id="datepicker-production" <?php if (isset($model->id)): ?>style="display:none"<?php endif; ?>>
</div>

<?php if (!isset($model->id)): ?>
<br />
<?php endif; ?>

<div id="dates" style="display:none;">
<?php
foreach ($jours_production as $id_production => $j) {
if ($j != '--') {
echo '<div><span class="date">' . $j . '</span><span class="id_production">' . $id_production . '</span></div>';
}
}
?>
</div>

<div class="clr"></div>
<div id="commandes-en-cours" style="display:none;">
<?php foreach ($commandes_en_cours as $c): ?>
<?php echo '<div class="commande" data-idproduction="' . $c->id_production . '" data-id="' . $c->id . '" data-href="' . Yii::$app->urlManager->createUrl(['commande/update', 'id' => $c->id, 'id_etablissement' => $c->production->id_etablissement]) . '"></div>'; ?>
<?php endforeach; ?>
</div>
<div id="has-commande-en-cours" style="display:none;" class="alert alert-danger">Vous avez déjà une commande en cours pour cette date. <a href="#">Cliquez ici</a> pour la modifier.</div>

</div>
<div class="col-md-6">
<?php if(strlen($etablissement->infos_commande)): ?>
<h2>Infos du producteur</h2>
<div id="infos-commande">
<?= nl2br(Html::encode($etablissement->infos_commande)) ?>
</div>
<?php endif; ?>
</div>

<div class="clr"></div>

<div id="depots">
<h2 id="step-choix-depot">Je choisis un dépôt</h2>
<?=
$form->field($model, 'id_point_vente')
->label('')
->hiddenInput();
//->dropDownList($points_vente) ;
?>

<input type="hidden" id="livraison" value="<?php if (!is_null($production) && $production->livraison): ?>1<?php else: ?>0<?php endif; ?>" />

<ul id="points-vente" class="blocs">
<?php
foreach ($points_vente as $pv) {
$commentaire = '' ;
if(isset($pv->pointVenteUser) && is_array($pv->pointVenteUser) && count($pv->pointVenteUser))
{
foreach($pv->pointVenteUser as $pvu)
{
if($pvu->id_user == Yii::$app->user->identity->id && strlen($pvu->commentaire))
{
$commentaire = '<div class="commentaire"><span>'.Html::encode($pvu->commentaire).'</span></div>' ;
}
}
}
$html_code = '' ;
$data_code = '0' ;
$code = '' ;
if(strlen($pv->code))
{
if(!isset($model->id_point_vente) || $model->id_point_vente != $pv->id)
{
$html_code .= '<span class="glyphicon glyphicon-lock"></span> ' ;
$data_code = '1' ;
}
else {
$code = $pv->code ;
}
}
echo '<li class="bloc point-vente point-vente-' . $pv->id . '" data-code="'.$data_code.'" data-vrac="' . (int) $pv->vrac . '" data-pain="' . (int) $pv->pain . '" data-credit-pain="'.(int) $pv->credit_pain.'"><div class="contenu">' .
'<span style="display:none;" class="id">' . $pv->id . '</span>' .
'<div class="nom">' .$html_code. Html::encode($pv->nom) . '</div>' .
'<div class="adresse">à ' . Html::encode($pv->localite) . '</div>' .
'<div class="horaires">' .
'<div class="jour jour-1">' . (strlen($pv->horaires_lundi) ? nl2br(Html::encode($pv->horaires_lundi)) : 'Fermé') . '</div>' .
'<div class="jour jour-2">' . (strlen($pv->horaires_mardi) ? nl2br(Html::encode($pv->horaires_mardi)) : 'Fermé') . '</div>' .
'<div class="jour jour-3">' . (strlen($pv->horaires_mercredi) ? nl2br(Html::encode($pv->horaires_mercredi)) : 'Fermé') . '</div>' .
'<div class="jour jour-4">' . (strlen($pv->horaires_jeudi) ? nl2br(Html::encode($pv->horaires_jeudi)) : 'Fermé') . '</div>' .
'<div class="jour jour-5">' . (strlen($pv->horaires_vendredi) ? nl2br(Html::encode($pv->horaires_vendredi)) : 'Fermé') . '</div>' .
'<div class="jour jour-6">' . (strlen($pv->horaires_samedi) ? nl2br(Html::encode($pv->horaires_samedi)) : 'Fermé') . '</div>' .
'<div class="jour jour-0">' . (strlen($pv->horaires_dimanche) ? nl2br(Html::encode($pv->horaires_dimanche)) : 'Fermé') . '</div>' .
'</div>'
. $commentaire .
'<input type="hidden" name="code_point_vente_'.$pv->id.'" value="'.$code.'" />'.
'</div></li>';
}
?>
</ul>
<div class="clr"></div>
</div>
<div id="produits">
<h2 id="step-choix-produits">Mes produits</h2>

<?php // confiance ?>
<input type="hidden" id="confiance" value="<?php echo (int) Yii::$app->user->identity->confiance; ?>" />
<?php if (!Yii::$app->user->identity->confiance): ?>
<div id="mess-limit-quantity" class="alert alert-warning"><strong>Attention,</strong> vous ne pouvez commander que 3 produits.</div>
<?php endif; ?>

<?php // erreur ?>
<?php if (Yii::$app->session->getFlash('error')): ?>
<div class="alert alert-danger"><div class="icon"></div><?= Yii::$app->session->getFlash('error'); ?></div>
<?php endif; ?>

<div id="pain">
<div class="alert alert-warning indisponible">Pain indisponible pour ce point de vente</div>
<table class="table table-bordered" id="table-produits">
<thead>
<tr>
<th class="th-photo">Photo</th>
<th class="produit">Produit</th>
<th class="prix-unit">Prix unitaire</th>
<th class="colonne-quantite">Quantité</th>
<th class="total">Total</th>
</tr>
</thead>
<tbody>
<?php foreach ($produits as $p): ?>
<?php
$quantite = 0;
if (isset($produits_selec[$p->id]))
$quantite = $produits_selec[$p->id];
?>
<tr class="produit-<?php echo $p->id; ?>" data-no-limit="<?php if(!$p->quantite_max): ?>1<?php else: ?>0<?php endif; ?>" data-quantite-max="<?= $quantite ?>" <?php if (count($produits_dispos) && !$produits_dispos[$p->id]['actif']): ?>style="display:none;"<?php endif; ?>>
<td class="td-photo">
<?php if (strlen($p->photo) && file_exists(dirname(__FILE__).'/../../web/uploads/' . $p->photo)): ?><a href="<?= Yii::$app->urlManager->getBaseUrl() . '/uploads/' . $p->photo ?>" data-lightbox="produit-<?php echo $p->id; ?>"><img class="photo img-rounded" src="<?= Yii::$app->urlManager->getBaseUrl() . '/uploads/' . $p->photo ?>" alt="Photo <?= Html::encode($p->nom); ?>" /></a><?php endif; ?>
</td>
<td class="produit">
<span class="nom"><?= Html::encode($p->nom); ?></span> - <span class="description"><?= Html::encode($p->getDescription()); ?></span><br />
<span class="recette"><?= Html::encode($p->recette); ?></span>
</td>
<td class="prix-unit"><span class="prix"><?= number_format($p->prix, 2); ?></span> €</td>
<td class="colonne-quantite">
<div class="input-group" <?php if (isset($produits_dispos[$p->id]) && $produits_dispos[$p->id]['quantite_restante'] == 0 && $quantite == 0): ?>style="display:none;"<?php endif; ?>>
<span class="input-group-btn">
<button type="button" class="btn btn-default move-quantity moins">-</button>
</span>
<input type="text" value="<?php if (isset($produits_selec[$p->id])): echo $produits_selec[$p->id];
else: ?>0<?php endif; ?>" readonly name="Produit[produit_<?php echo $p->id; ?>]" class="quantity form-control">
<span class="input-group-btn">
<button type="button" class="btn btn-default move-quantity plus">+</button>
</span>
</div>

<div class="quantite-restante">Reste <span class="nb"><?php if (isset($produits_dispos[$p->id])): echo $produits_dispos[$p->id]['quantite_restante'] + $quantite;
endif; ?></span> <?php echo Html::encode(strtolower($p->nom)); ?>(s)
</div>
<div class="epuise">Épuisé</div>
</td>
<td class="total"><strong></strong></td>
</tr>
<?php endforeach; ?>
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<!-- <td><strong><span id="total-commande">0</span> €</strong></td> -->
<td id="total-commande"><strong></strong></td>
</tr>
</tfoot>
</table>
</div>

</div>

<?php if($id_etablissement): ?>
<?php
$etablissement = Etablissement::findOne($id_etablissement);
?>
<div id="bar-fixed" class="<?php if($etablissement->credit_pain): ?>credit-pain<?php else: ?>no-credit-pain<?php endif; ?>">
<div class="container">
<?php if (isset($model->id)): ?>
<a href="<?php echo Yii::$app->urlManager->createUrl(['commande/annuler', 'id' => $model->id]); ?>" class="btn btn-danger annuler-commande">Annuler ma commande</a>
<?php endif; ?>
<span id="total-commande-bottom"><span></span> €</span>
<?= Html::submitButton('<span class="glyphicon glyphicon-comment"></span> Commentaire', ['class' => 'btn btn-default btn-commentaire', 'data-placement' => 'top', 'data-toggle' => 'tooltip', 'data-original-title' => 'Ajouter un commentaire']) ?>
<?php
if($etablissement->credit_pain):
$lien_credit_pain = '<a class="info-credit-pain" href="'.Yii::$app->urlManager->createUrl(['site/creditpain']) .'" data-toggle="tooltip" data-placement="bottom" title="En savoir plus sur le Crédit Pain"><span class="glyphicon glyphicon-info-sign"></span></a>' ; ;
?>
<div id="checkbox-credit-pain" >
<?php if($credit || $model->getMontantPaye()): ?>
<?= Html::checkbox('credit_pain', true, ['label' => 'Utiliser mon compte Crédit Pain <span class="the-credit" data-toggle="tooltip" data-placement="top" data-original-title="Vous avez actuellement '.number_format($credit,2).' € sur votre compte Crédit Pain">'.number_format($credit,2).' €</span><br /><span class="info"></span>']) ?>
<?= Html::hiddenInput('montant_credit_pain', $credit, ['id' => 'montant-credit-pain']) ?>
<?= Html::hiddenInput('str_montant_credit_pain', number_format($credit,2).' €', ['id' => 'str-montant-credit-pain']) ?>
<?php else: ?>
<div id="info-credit-vide">
Votre compte Crédit Pain est vide <?= $lien_credit_pain ?>
</div>
<?php endif; ?>
<div id="credit-pain-disabled">Le Crédit Pain est désactivé<br /> pour ce point de vente <?= $lien_credit_pain ?></div>
</div>
<div class="clr"></div>
<?php endif; ?>
<?= $form->field($model, 'commentaire')->textarea(['rows' => 3, 'placeholder' => 'Un commentaire ?'])->label(''); ?>
<div id="bloc-valider-commande">
<?= Html::submitButton('<span class="glyphicon glyphicon-ok"></span> Valider ma commande', ['class' => 'btn btn-primary valider-commande']) ?>
</div>
<?php endif; ?>
</div>
</div>
<?php
// id_etablissement
endif; ?>
<?php ActiveForm::end(); ?>
<!-- modal code point de vente -->
<div class="modal fade" id="modal-code" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Code d'accès</h4>
</div>
<div class="modal-body">
<div class="alert alert-warning">
Ce point de vente nécessite un code d'accès.
</div>
<form action="index.php?r=commande/verif-code" method="post">
<input type="hidden" value="" name="id_point_vente" id="id-point-vente" />
<div class="form-group field-code required">
<label class="control-label" for="code">Code d'accès :</label>
<input type="password" class="form-control" id="code" name="code" />
<p class="help-block help-block-error" style="display:none;">Code incorrect</p>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Valider</button>
</div>
</form>
</div>
</div>
</div>
</div>

</div><!-- commande-form -->

+ 0
- 83
frontend/views/commande/_liste_etablissements.php Voir le fichier

@@ -1,83 +0,0 @@
<?php

use yii\helpers\Html ;
use common\helpers\Url ;

?>
<div class="liste-etablissements">
<?php if(count($etablissements)): ?>
<?php if(isset($id_etablissement) && $id_etablissement &&
isset($etablissement_paiement_ok) && !$etablissement_paiement_ok): ?>
<div class="alert alert-warning">Ce producteur est désactivé.</div>
<?php endif; ?>
<?php foreach($etablissements as $e): ?>
<div class="col-md-6 boulangerie <?php if(isset($id_etablissement) && $e['id'] == $id_etablissement): ?>selected<?php endif; ?>">
<div class="panel panel-default">
<div class="panel-heading">
<?php if(isset($e['photo']) && strlen($e['photo'])): ?>
<img class="img-back" src="./uploads/<?= $e['photo'] ?>" />
<?php endif; ?>
</div>
<div class="panel-body">
<h3 class="panel-title">
<?php echo Html::encode($e['nom']); ?>
</h3>
<div class="localite">
à <?php echo Html::encode($e['ville']).' ('.Html::encode($e['code_postal']).')'; ?>
<?php if(!$e['actif']): ?>
&bull; <span class="label label-danger" data-toggle="tooltip" data-placement="bottom" data-original-title="Les commandes sont actuellement fermées pour ce producteur. Revenez plus tard ou prenez contact avec l'établissement.">Hors-ligne</span>
<?php endif; ?>
</div>
<?php if(isset($id_etablissement) && $e['id'] == $id_etablissement): ?>
<span class="glyphicon glyphicon-check"></span>
<?php endif; ?>
<?php if($context == 'index'): ?>
<a href="<?= Yii::$app->urlManager->createUrl(['commande/remove-etablissement','id'=>$e['id']]); ?>" class="btn btn-xs btn-default remove"><span class="glyphicon glyphicon-remove"></span></a>
<?php endif; ?>
<?php
$disabled = '' ;
if(!$e['actif']):
$disabled = 'disabled="disabled"' ;
endif;
?>
<?php if($context == 'index'): ?>
<a class="btn btn-primary" <?= $disabled; ?> href="<?= Yii::$app->urlManager->createUrl(['commande/create', 'id_etablissement' => $e['id']]) ?>">Commander</a>
<?php if($e['id'] == Yii::$app->user->identity->id_etablissement): ?>
<a class="btn btn-default" href="<?= Url::backend(); ?>" data-toggle="tooltip" data-placement="bottom" title="Accédez au panneau d'administration de votre établissement"><span class="glyphicon glyphicon-cog"></span> Gérer mon établissement</a>
<?php endif; ?>
<?php elseif($context == 'commande'): ?>
<a class="btn btn-primary" <?= $disabled; ?> href="<?= Yii::$app->urlManager->createUrl(['commande/create', 'id_etablissement' => $e['id']]) ?>">Sélectionner</a>
<?php endif; ?>
<div class="clr"></div>
<div class="heure-limite-commande">
<span data-toggle="tooltip" data-placement="bottom" title="Heure limite de commande">
<strong><span class="glyphicon glyphicon-time"></span> Heure limite :</strong>
<?php echo Html::encode($e['heure_limite_commande']) ?> h
</span> &bull;
<span data-toggle="tooltip" data-placement="bottom" title="Exemple : commande le lundi pour le <?php if($e['delai_commande'] == 1): ?>mardi<?php elseif($e['delai_commande'] == 2): ?>mercredi<?php elseif($e['delai_commande'] == 3): ?>jeudi<?php elseif($e['delai_commande'] == 4): ?>vendredi<?php elseif($e['delai_commande'] == 5): ?>samedi<?php elseif($e['delai_commande'] == 6): ?>dimanche<?php elseif($e['delai_commande'] == 7): ?>lundi d'après<?php endif; ?>">
<strong>Délai :</strong>
<?= Html::encode($e['delai_commande']) ?> jour<?php if($e['delai_commande'] > 1): ?>s<?php endif; ?>
</span>
</div>
<?php if($e['credit_pain']): ?>
<div class="credit-pain">
<span data-toggle="tooltip" data-placement="bottom" title="Montant de votre compte Crédit Pain. Rendez-vous chez votre producteur pour créditer votre compte.">
<span class="montant"><?= number_format($e['credit'],2); ?> <span class="glyphicon glyphicon-euro"></span></span>
</span>
<a class="info-credit-pain" href="<?= Yii::$app->urlManager->createUrl(['site/creditpain']); ?>" data-toggle="tooltip" data-placement="bottom" title="En savoir plus sur le Crédit Pain"><span class="glyphicon glyphicon-info-sign"></span></a>
</div>
<?php endif; ?>
<div class="clr"></div>
</div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>

+ 0
- 32
frontend/views/commande/create.php Voir le fichier

@@ -1,32 +0,0 @@
<?php

use yii\helpers\Html;


/* @var $this yii\web\View */
/* @var $model app\models\Produit */

$this->title = 'Passer une commande';
?>
<div class="commande-create">
<h1 class="title-systeme-commande"><span class="glyphicon glyphicon-plus"></span> <?= Html::encode($this->title) ?></h1>

<?= $this->render('_form', [
'model' => $model,
'points_vente' => $points_vente,
'jours_production' => $jours_production,
'produits' => $produits,
'produits_selec' => $produits_selec,
'produits_dispos' => $produits_dispos,
'production' => $production,
'commandes_en_cours' => $commandes_en_cours,
'produits_vrac' => $produits_vrac,
'etablissements' => $etablissements,
'id_etablissement' => $id_etablissement,
'etablissement' => $etablissement,
'etablissement_paiement_ok' => $etablissement_paiement_ok,
'credit' => $credit
]) ?>

</div>

+ 0
- 122
frontend/views/commande/index.php Voir le fichier

@@ -1,122 +0,0 @@
<?php
/* @var $this yii\web\View */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use common\models\Commande ;

$this->title = 'Commande' ;

?>

<div id="index-commande">

<h1 class="title-systeme-commande"><span class="glyphicon glyphicon-th-list"></span> Tableau de bord</h1>

<h2>Producteurs</h2>

<?php if($commande_ok): ?>
<div class="alert alert-success">
<div class="icon"></div>
Votre commande a bien été prise en compte.
</div>
<?php endif; ?>

<?php if($annule_ok): ?>
<div class="alert alert-success"><div class="icon"></div>Votre commande a bien été annulée.</div>
<?php endif; ?>

<div id="liste-boulangeries">
<?=
$this->render('_liste_etablissements.php',[
'etablissements' => $etablissements,
'context' => 'index'
]) ;
?>
<div class="col-md-6" id="bloc-add-etablissement">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title"><span class="glyphicon glyphicon-plus"></span> Ajouter un producteur</h3>
</div>
<div class="panel-body">
<?php $form = ActiveForm::begin(['id' => 'form-add-boulanger','enableClientValidation'=> false]); ?>
<?= $form->field($model_form_etablissement, 'id_etablissement')
->label('')
->dropDownList($data_etablissements_dispos,
['prompt' => '--',
'encode' => false,
'options' => $options_etablissements_dispos
]) ; ?>
<div id="bloc-code-acces">
<?= $form->field($model_form_etablissement, 'code',[
'inputTemplate' => '<div class="input-group"><span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>{input}</div>',
])
->label('Code')
->hint('Renseignez-vous auprès de votre producteur pour qu\'il vous fournisse le code d\'accès') ; ?>
</div>
<?= Html::submitButton('<span class="glyphicon glyphicon-plus"></span> Valider', ['class' => 'btn btn-default', 'name' => 'add-etablissement-button']) ?>
<?php ActiveForm::end(); ?>
</div>
</div>
</div>
<div class="clr"></div>
</div>

<h2>Historique</h2>
<?php if(count($commandes)): ?>
<p>Retrouvez ici vos dernières commandes.</p>

<table id="historique-commandes" class="table table-striped table-bordered">
<thead>
<tr>
<th>Producteur</th>
<th>Date livraison</th>
<th>Résumé</th>
<th>Lieu</th>
<th class="montant">Montant</th>
<th class="statut"></th>
</tr>
</thead>
<tbody>
<?php foreach($commandes as $c): ?>
<tr>
<td><?= Html::encode($c->production->etablissement->nom) ?></td>
<td><?php echo date('d/m/Y',strtotime($c->production->date)); ?></td>
<td class="resume"><?= $c->getResumePanier() ; ?></td>
<td><?= $c->getResumePointVente(); ?></td>
<td class="montant"><?= $c->getResumeMontant(); ?></td>
<td class="statut">
<?php if($c->getEtat() == Commande::ETAT_LIVREE): ?>
Livrée
<?php elseif($c->getEtat() == Commande::ETAT_PREPARATION): ?>
En préparation
<?php elseif($c->getEtat() == Commande::ETAT_MODIFIABLE): ?>
<div class="btn-group">
<a href="<?php echo Yii::$app->urlManager->createUrl(['commande/update','id'=>$c->id, 'id_etablissement'=>$c->production->etablissement->id]) ; ?>" class="btn btn-default"><span class="glyphicon glyphicon-pencil"></span> Modifier</a>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="<?php echo Yii::$app->urlManager->createUrl(['commande/annuler','id'=>$c->id]) ; ?>"><span class="glyphicon glyphicon-trash"></span> Annuler la commande</a></li>
</ul>
</div>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<div class="alert alert-info">Vous n'avez pas encore passé de commandes</div>
<?php endif; ?>

</div>

+ 0
- 40
frontend/views/commande/update.php Voir le fichier

@@ -1,40 +0,0 @@
<?php

use yii\helpers\Html;


/* @var $this yii\web\View */
/* @var $model app\models\Produit */

$this->title = 'Modifier une commande';
//$this->params['breadcrumbs'][] = ['label' => 'Produits', 'url' => ['index']];
//$this->params['breadcrumbs'][] = $this->title;
?>
<div class="commande-update">

<h1 class="title-systeme-commande"><span class="glyphicon glyphicon-pencil"></span> <?= Html::encode($this->title) ?></h1>
<?php if($commande_introuvable): ?>
<div class="alert alert-danger">Cette commande est introuvable</div><br />
<a class="btn btn-default" href="<?php echo Yii::$app->urlManager->createUrl(['commande/index']); ?>">Retour</a>
<?php else: ?>
<?= $this->render('_form', [
'model' => $model,
'points_vente' => $points_vente,
'jours_production' => $jours_production,
'produits' => $produits,
'produits_selec' => $produits_selec,
'produits_dispos' => $produits_dispos,
'production' => $production,
'commandes_en_cours' => $commandes_en_cours,
'produits_vrac' => $produits_vrac,
'etablissements' => $etablissements,
'id_etablissement' => $id_etablissement,
'etablissement_paiement_ok' => $etablissement_paiement_ok,
'credit' => $credit
]) ?>
<?php endif; ?>

</div>

+ 0
- 22
frontend/views/etablissement/index.php Voir le fichier

@@ -1,22 +0,0 @@
<?php

$this->title = 'Établissement' ;

?>

<div class="header-etablissement">
<div id="block-main-img">
<img id="main-img" src="http://www.laboiteapain.net/uploads/Four_Le_Chat_des_Noisettes-582049376a029.jpg" />
<h1><span>Le Chat des Noisettes</span></h1>
</div>
</div>

<nav id="menu-etablissement">
<ul class="nav nav-pills">
<li><a href="#"><span class="glyphicon glyphicon-heart-empty"></span> Présentation</a></li>
<li><a href="#"><span class="glyphicon glyphicon-plus"></span> Commander</a></li>
<li><a href="#"><span class="glyphicon glyphicon-folder-open"></span> Historique</a></li>
<li><a href="#"><span class="glyphicon glyphicon-euro"></span> Crédit pain</a></li>
</ul>
</nav>


+ 60
- 25
frontend/views/layouts/main.php Voir le fichier

@@ -18,20 +18,20 @@ $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action
<?php $this->beginPage() ?>
<!DOCTYPE html>
<head>
<title><?php if($is_home): ?>La boîte à pain &bull; <?= Html::encode($this->title) ?> <?php else: ?><?= Html::encode($this->title) ?> &bull; La boîte à pain<?php endif; ?></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php if($is_home): ?>La boîte à pain &bull; <?= Html::encode($this->title) ?> <?php else: ?><?= Html::encode($this->title) ?> &bull; La boîte à pain<?php endif; ?></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?= Html::csrfMetaTags() ?>
<link rel="icon" type="image/png" href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" />
<!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="./img/favicon.ico" /><![endif]-->
<link rel="icon" type="image/png" href="<?= Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon4.png" />
<!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="<?= Yii::$app->urlManager->getBaseUrl(); ?>/img/favicon.ico" /><![endif]-->
<?php $this->head() ?>
<!--[if lt IE 9]>
<script src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/js/html5shiv.min.js"></script>
<link href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/css/ie.css" rel="stylesheet">
<![endif]-->
<!--[if IE 7]>
<link href="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/css/ie7.css" rel="stylesheet">
<![endif]-->
<script src="<?= Yii::$app->urlManager->getBaseUrl(); ?>/js/html5shiv.min.js"></script>
<link href="<?= Yii::$app->urlManager->getBaseUrl(); ?>/css/ie.css" rel="stylesheet">
<![endif]-->
<!--[if IE 7]>
<link href="<?= Yii::$app->urlManager->getBaseUrl(); ?>/css/ie7.css" rel="stylesheet">
<![endif]-->
</head>
<body class="<?php if($is_home): echo 'home' ; endif; ?><?php if(!Yii::$app->user->isGuest): ?> connected<?php endif; ?>">
<?php $this->beginBody() ?>
@@ -47,7 +47,7 @@ $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action
<header id="header">
<div class="container">
<a id="link-home" href="<?php if(Yii::$app->user->isGuest): echo Yii::$app->urlManager->createUrl('site/index') ; else: echo Yii::$app->urlManager->createUrl('commande/index') ; endif; ?>">
<a id="link-home" href="<?= Yii::$app->urlManager->createUrl('site/index') ; ?>">
<img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/laboulange3.png" alt="" />
<div class="text">
<div class="bap">La boîte à pain</div>
@@ -56,19 +56,54 @@ $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action
</div>
</a>
<nav class="">
<ul class="nav nav-pills">
<?php if(!Yii::$app->user->isGuest):?>
<li><a <?php if(Yii::$app->controller->id == 'commande' && Yii::$app->controller->action->id == 'index'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('commande/index') ; ?>"><span class="glyphicon glyphicon-th-list"></span> Tableau de bord</a></li>
<li><a <?php if(Yii::$app->controller->id == 'commande' && Yii::$app->controller->action->id == 'create'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('commande/create') ; ?>"><span class="glyphicon glyphicon-plus"></span> Commander</a></li>
<li><a <?php if(Yii::$app->controller->id == 'user' && Yii::$app->controller->action->id == 'update'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('user/update') ; ?>"><span class="glyphicon glyphicon-user"></span> Profil</a></li>
<li><a id="link-logout" href="<?php echo Yii::$app->urlManager->createUrl('site/logout') ; ?>"><span class="glyphicon glyphicon-off"></span> Déconnexion<br /><span class="nom"><?php echo Html::encode(Yii::$app->user->identity->prenom .' '. substr(strtoupper(Yii::$app->user->identity->nom), 0, 1).'.') ; ?></span></a></li>
<?php if(Yii::$app->user->identity->isBoulanger()): ?><li><a class="" id="link-espace-boulanger" href="<?php echo Url::backend(); ?>"><span class="glyphicon glyphicon-grain"></span> Espace boulanger</a></li><?php endif; ?>
<?php else: ?>
<li><a <?php if(Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'login'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('site/login') ; ?>"><span class="glyphicon glyphicon-log-in"></span> Connexion</a></li>
<li><a <?php if(Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'signup'): ?>class="active" <?php endif; ?>href="<?php echo Yii::$app->urlManager->createUrl('site/signup') ; ?>"><span class="glyphicon glyphicon-user"></span> Inscription</a></li>
<?php endif;?>
</ul>
<nav>
<?php
echo Nav::widget([
'encodeLabels' => false,
'options' => ['class' =>'nav nav-pills'],
'items' => [
[
'label' => '<span class="glyphicon glyphicon-th-list"></span> Accueil',
'url' => Yii::$app->urlManager->createUrl(['site/index']),
'active' => $this->getControllerAction() == 'site/index'
],
[
'label' => '<span class="glyphicon glyphicon-grain"></span> Producteurs',
'url' => Yii::$app->urlManager->createUrl(['site/producers']),
'active' => $this->getControllerAction() == 'site/producers',
'options' => ['id' => 'link-producteurs']
],
[
'label' => '<span class="glyphicon glyphicon-log-in"></span> Connexion',
'url' => Yii::$app->urlManager->createUrl(['site/login']),
'visible' => Yii::$app->user->isGuest,
'active' => $this->getControllerAction() == 'site/login'
],
[
'label' => '<span class="glyphicon glyphicon-user"></span> Inscription',
'url' => Yii::$app->urlManager->createUrl(['site/signup']),
'visible' => Yii::$app->user->isGuest,
'active' => $this->getControllerAction() == 'site/signup'
],
[
'label' => '<span class="glyphicon glyphicon-user"></span> '.((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->prenom .' '.strtoupper(substr(Yii::$app->user->identity->nom, 0, 1))) : '').'. ',
'options' => ['id' => 'label1'],
'url' => '#',
'items' => [
[
'label' => 'Profil',
'url' => Yii::$app->urlManager->createUrl(['user/update']),
],
[
'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion',
'url' => Yii::$app->urlManager->createUrl(['site/logout']),
]
],
'visible' => !Yii::$app->user->isGuest
],
]
]);
?>
</nav>
</div>
</header>

frontend/views/site/_tarifs_boulanger.php → frontend/views/site/_tarifs_producteur.php Voir le fichier

@@ -9,7 +9,7 @@
<div class="modal-body">
<div class="alert alert-warning"><em>La boîte à pain</em> fonctionne grâce à un système de <strong>facturation mensuelle</strong> basée
sur le chiffre d'affaire réalisé à partir des commandes enregistrées sur la plateforme. Fonctionner ainsi permet de faire contribuer chaque
boulangerie à la hauteur de son utilisation de la plateforme.</div>
producteur à la hauteur de son utilisation de la plateforme.</div>
<div class="commission"><span><strong>2 %</strong> du chiffre d'affaire TTC</span></div>
<div class="exemple">Exemple : si pour un mois donné, vous avez comptabilisé <em>2500 € TTC</em> de chiffre d'affaire réalisé sur la plateforme,
vous recevrez une facture d'un montant de <em>50 € TTC</em> pour ce mois.</div>

+ 0
- 14
frontend/views/site/about.php Voir le fichier

@@ -1,14 +0,0 @@
<?php
use yii\helpers\Html;

/* @var $this yii\web\View */
$this->title = 'About';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="site-about">
<h1><?= Html::encode($this->title) ?></h1>

<p>This is the About page. You may modify the following file to customize its content:</p>

<code><?= __FILE__ ?></code>
</div>

+ 4
- 4
frontend/views/site/index.php Voir le fichier

@@ -22,10 +22,10 @@ $this->setPageTitle('Plateforme de réservation de pain') ;
<div class="row" id="row-clients-boulanger">
<div class="col-md-6" id="clients">
<h2>
<img class="img" src="./img/clients.png" id="img-clients" />
<img class="img" src="<?= Yii::$app->urlManager->getBaseUrl(); ?>/img/clients.png" id="img-clients" />
<span>Clients</span>
</h2>
<p><em>Réservez votre pain en ligne et récupérez votre commande<br />
<p><em>Réservez vos produits en ligne et récupérez votre commande<br />
chez votre producteur ou dans un dépôt près de chez vous.</em></p>
<ul>
<li>Garantie d'avoir vos produits</li>
@@ -38,7 +38,7 @@ $this->setPageTitle('Plateforme de réservation de pain') ;
</div>
<div class="col-md-6 boulanger">
<h2>
<img class="img" src="./img/boulanger1.png" id="img-boulanger" />
<img class="img" src="<?= Yii::$app->urlManager->getBaseUrl(); ?>/img/boulanger1.png" id="img-boulanger" />
<span>Producteur</span>
</h2>

@@ -66,4 +66,4 @@ $this->setPageTitle('Plateforme de réservation de pain') ;
</div>

<!-- Tarifs -->
<?= $this->render('_tarifs_boulanger'); ?>
<?= $this->render('_tarifs_producteur'); ?>

+ 37
- 0
frontend/views/site/producers.php Voir le fichier

@@ -0,0 +1,37 @@
<?php

$this->setTitle('Producteurs') ;

?>

<h1 class="title-systeme-commande"><span class="glyphicon glyphicon-grain"></span>&nbsp;&nbsp;<?= Html::encode($this->title) ?></h1>

<?=

GridView::widget([
'dataProvider' => $data_provider_producers,
'summary' => '',
'columns' => [
[
'attribute' => 'nom',
],
[
'attribute' => 'type',
],
[
'label' => 'Localisation',
'value' => function($model) {
return $model->ville. ' ('.$model->code_postal.')' ;
}
],
[
'label' => 'Lien',
'format' => 'raw',
'value' => function($model) {
return Html::a('Visiter',Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index', 'slug_producer' => $model->slug]), ['class'=>'btn btn-primary']) ;
}
],
]
]);
?>

+ 1
- 1
frontend/views/site/signup.php Voir le fichier

@@ -87,4 +87,4 @@ $this->params['breadcrumbs'][] = $this->title;
</div>

<!-- Tarifs -->
<?= $this->render('../site/_tarifs_boulanger'); ?>
<?= $this->render('../site/_tarifs_producteur'); ?>

BIN
frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/_fonts.scssc Voir le fichier


BIN
frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/_responsive.scssc Voir le fichier


BIN
frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/_systeme_commandes.scssc Voir le fichier


BIN
frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/ie.scssc Voir le fichier


BIN
frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/ie7.scssc Voir le fichier


BIN
frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/print.scssc Voir le fichier


BIN
frontend/web/.sass-cache/a737daaa3b038cd28cb74dc0777f663fd8a4a5ae/screen.scssc Voir le fichier


+ 120
- 116
frontend/web/css/screen.css Voir le fichier

@@ -149,24 +149,24 @@ ul li {
color: #8a6d3b;
}

/* line 120, ../sass/screen.scss */
/* line 122, ../sass/screen.scss */
#main {
position: relative;
}
/* line 122, ../sass/screen.scss */
/* line 124, ../sass/screen.scss */
#main .inner {
width: 960px;
margin: 0px auto;
}

/* line 129, ../sass/screen.scss */
/* line 131, ../sass/screen.scss */
#content .content-text h1 {
font-family: "myriadpro-regular";
font-size: 30px;
color: black;
text-transform: uppercase;
}
/* line 136, ../sass/screen.scss */
/* line 138, ../sass/screen.scss */
#content .content-text h2 {
font-family: "comfortaaregular";
font-size: 20px;
@@ -176,7 +176,7 @@ ul li {
margin-top: 5px;
}

/* line 147, ../sass/screen.scss */
/* line 149, ../sass/screen.scss */
#content #the-content {
padding-top: 100px;
padding-left: 30px;
@@ -184,31 +184,31 @@ ul li {
padding-bottom: 50px;
}

/* line 155, ../sass/screen.scss */
/* line 157, ../sass/screen.scss */
#block-demo {
padding: 10px 0px;
background-color: #BB8757;
color: white;
text-align: center;
}
/* line 161, ../sass/screen.scss */
/* line 163, ../sass/screen.scss */
#block-demo a {
color: white;
text-decoration: underline;
}

/* line 167, ../sass/screen.scss */
/* line 169, ../sass/screen.scss */
#header {
z-index: 100;
border-bottom: solid 1px #e0e0e0;
background-color: #f8f1dd;
height: 86px;
}
/* line 173, ../sass/screen.scss */
/* line 175, ../sass/screen.scss */
#header .container {
position: relative;
}
/* line 177, ../sass/screen.scss */
/* line 179, ../sass/screen.scss */
#header #env-dev {
font-family: "comfortaabold";
text-align: center;
@@ -221,7 +221,7 @@ ul li {
top: 18px;
left: 79px;
}
/* line 190, ../sass/screen.scss */
/* line 192, ../sass/screen.scss */
#header #link-home {
position: absolute;
top: 10px;
@@ -231,56 +231,60 @@ ul li {
color: black;
display: block;
}
/* line 199, ../sass/screen.scss */
/* line 201, ../sass/screen.scss */
#header #link-home img {
height: 60px;
margin-bottom: 5px;
float: left;
}
/* line 205, ../sass/screen.scss */
/* line 207, ../sass/screen.scss */
#header #link-home .text {
float: left;
padding-left: 10px;
}
/* line 209, ../sass/screen.scss */
/* line 211, ../sass/screen.scss */
#header #link-home .text .bap {
font-family: "comfortaalight";
font-size: 24px;
}
/* line 214, ../sass/screen.scss */
/* line 216, ../sass/screen.scss */
#header #link-home .text .plateforme {
font-size: 17px;
font-family: "myriadpro-light";
color: #BB8757;
}
/* line 222, ../sass/screen.scss */
/* line 224, ../sass/screen.scss */
#header #link-espace-boulanger {
border-left: solid 1px #e0e0e0;
color: #BB8757;
}
/* line 227, ../sass/screen.scss */
/* line 229, ../sass/screen.scss */
#header nav {
padding-top: 22px;
}
/* line 229, ../sass/screen.scss */
/* line 231, ../sass/screen.scss */
#header nav ul {
float: right;
}
/* line 232, ../sass/screen.scss */
/* line 234, ../sass/screen.scss */
#header nav ul li a {
text-decoration: none;
color: #505050;
}
/* line 235, ../sass/screen.scss */
#header nav ul li a.active {
background-color: white;
}
/* line 239, ../sass/screen.scss */
/* line 238, ../sass/screen.scss */
#header nav ul li a:hover {
color: black;
background-color: white;
}
/* line 249, ../sass/screen.scss */
/* line 245, ../sass/screen.scss */
#header nav ul li.active a {
background-color: white;
}
/* line 250, ../sass/screen.scss */
#header nav ul li#link-producteurs {
border-right: solid 1px #e0e0e0;
}
/* line 260, ../sass/screen.scss */
#header #link-logout .nom {
color: gray;
font-size: 10px;
@@ -289,7 +293,7 @@ ul li {
top: -4px;
}

/* line 265, ../sass/screen.scss */
/* line 276, ../sass/screen.scss */
#content {
position: relative;
padding: 20px 0px;
@@ -297,12 +301,12 @@ ul li {
padding-top: 35px;
min-height: 500px;
}
/* line 272, ../sass/screen.scss */
/* line 283, ../sass/screen.scss */
#content h1#title-site {
font-family: "comfortaalight";
font-size: 50px;
}
/* line 279, ../sass/screen.scss */
/* line 290, ../sass/screen.scss */
#content h2 {
color: black;
padding-bottom: 15px;
@@ -313,16 +317,16 @@ ul li {
position: relative;
margin-top: 30px;
}
/* line 290, ../sass/screen.scss */
/* line 301, ../sass/screen.scss */
#content h3 {
color: black;
font-size: 20px;
}
/* line 298, ../sass/screen.scss */
/* line 309, ../sass/screen.scss */
#content #description img {
width: 100%;
}
/* line 303, ../sass/screen.scss */
/* line 314, ../sass/screen.scss */
#content #main-img {
max-width: 100%;
border: solid 1px #e0e0e0;
@@ -331,79 +335,79 @@ ul li {
-webkit-border-radius: 5px;
border-radius: 5px;
}
/* line 312, ../sass/screen.scss */
/* line 323, ../sass/screen.scss */
#content #row-presentation h1 {
color: black;
}
/* line 315, ../sass/screen.scss */
/* line 326, ../sass/screen.scss */
#content #row-presentation strong {
font-family: "myriadpro-light";
font-size: 20px;
color: #B17A48;
}
/* line 322, ../sass/screen.scss */
/* line 333, ../sass/screen.scss */
#content #row-signup {
text-align: center;
margin-top: 40px;
padding-top: 40px;
}
/* line 327, ../sass/screen.scss */
/* line 338, ../sass/screen.scss */
#content #row-signup a.btn {
padding: 10px 20px;
font-size: 20px;
text-transform: uppercase;
}
/* line 333, ../sass/screen.scss */
/* line 344, ../sass/screen.scss */
#content #row-signup a.btn-primary {
margin-right: 15px;
}
/* line 338, ../sass/screen.scss */
/* line 349, ../sass/screen.scss */
#content #row-clients-boulanger {
margin-bottom: 50px;
}
/* line 341, ../sass/screen.scss */
/* line 352, ../sass/screen.scss */
#content #row-clients-boulanger h2 {
margin-bottom: 10px;
}
/* line 343, ../sass/screen.scss */
/* line 354, ../sass/screen.scss */
#content #row-clients-boulanger h2 .img {
height: 50px;
}
/* line 346, ../sass/screen.scss */
/* line 357, ../sass/screen.scss */
#content #row-clients-boulanger h2 span {
margin-left: 10px;
font-size: 25px;
position: relative;
top: 5px;
}
/* line 354, ../sass/screen.scss */
/* line 365, ../sass/screen.scss */
#content #row-clients-boulanger ul {
text-align: left;
}
/* line 356, ../sass/screen.scss */
/* line 367, ../sass/screen.scss */
#content #row-clients-boulanger ul li {
list-style-type: circle;
color: #BB8757;
}
/* line 362, ../sass/screen.scss */
/* line 373, ../sass/screen.scss */
#content #row-clients-boulanger p {
padding-bottom: 4px;
}
/* line 368, ../sass/screen.scss */
/* line 379, ../sass/screen.scss */
#content #row-clients-boulanger .boulanger .prix span {
background-color: #F8F1DD;
}
/* line 371, ../sass/screen.scss */
/* line 382, ../sass/screen.scss */
#content #row-clients-boulanger .boulanger .prix span a {
color: #BB8757;
text-decoration: none;
}
/* line 379, ../sass/screen.scss */
/* line 390, ../sass/screen.scss */
#content #row-clients-boulanger .prix {
padding-top: 15px;
font-size: 18px;
}
/* line 383, ../sass/screen.scss */
/* line 394, ../sass/screen.scss */
#content #row-clients-boulanger .prix span {
color: #BB8757;
border: solid 1px #BB8757;
@@ -418,7 +422,7 @@ ul li {
-webkit-border-radius: 5px;
border-radius: 5px;
}
/* line 398, ../sass/screen.scss */
/* line 409, ../sass/screen.scss */
#content #row-clients-boulanger #periode-essai {
margin-top: 8px;
text-align: center;
@@ -426,18 +430,18 @@ ul li {
color: gray;
font-family: "comfortaaregular";
}
/* line 408, ../sass/screen.scss */
/* line 419, ../sass/screen.scss */
#content #btn-demo:hover, #content #btn-demo:focus, #content #btn-demo:active {
color: black;
}
/* line 414, ../sass/screen.scss */
/* line 425, ../sass/screen.scss */
#content #modal-tarifs .commission {
text-align: center;
font-size: 20px;
text-transform: uppercase;
margin-bottom: 20px;
}
/* line 420, ../sass/screen.scss */
/* line 431, ../sass/screen.scss */
#content #modal-tarifs .commission span {
padding: 10px 20px;
border: solid 1px black;
@@ -445,46 +449,46 @@ ul li {
-webkit-border-radius: 10px;
border-radius: 10px;
}
/* line 426, ../sass/screen.scss */
/* line 437, ../sass/screen.scss */
#content #modal-tarifs .exemple {
color: gray;
}

/* line 433, ../sass/screen.scss */
/* line 444, ../sass/screen.scss */
#content #contact {
display: none;
}
/* line 437, ../sass/screen.scss */
/* line 448, ../sass/screen.scss */
#content #contact .icon {
width: 55px;
top: -15px;
margin-left: -70px;
}
/* line 446, ../sass/screen.scss */
/* line 457, ../sass/screen.scss */
#content #contact .form-control:focus {
/*@include box-shadow(0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px $jaune) ;
border-color: $jaune ;*/
}
/* line 451, ../sass/screen.scss */
/* line 462, ../sass/screen.scss */
#content #contact .form-group {
text-align: center;
}
/* line 455, ../sass/screen.scss */
/* line 466, ../sass/screen.scss */
#content #contact .img-right {
float: right;
}
/* line 458, ../sass/screen.scss */
/* line 469, ../sass/screen.scss */
#content #contact .img-right img {
width: 300px;
}

/* line 465, ../sass/screen.scss */
/* line 476, ../sass/screen.scss */
.form-control:focus {
/*@include box-shadow(0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px $jaune) ;
border-color: $jaune ;*/
}

/* line 470, ../sass/screen.scss */
/* line 481, ../sass/screen.scss */
#footer {
position: absolute;
bottom: 0px;
@@ -497,7 +501,7 @@ ul li {
padding-top: 30px;
padding-bottom: 60px;
}
/* line 484, ../sass/screen.scss */
/* line 495, ../sass/screen.scss */
#footer a {
font-family: "myriadpro-regular";
color: #7e7e7e;
@@ -510,29 +514,29 @@ ul li {
border-right: solid 1px #7e7e7e;
border-right: solid 1px white;
}
/* line 495, ../sass/screen.scss */
/* line 506, ../sass/screen.scss */
#footer a:hover {
color: gray;
}
/* line 499, ../sass/screen.scss */
/* line 510, ../sass/screen.scss */
#footer a:last-child {
border: 0px none;
}

/* line 505, ../sass/screen.scss */
/* line 516, ../sass/screen.scss */
#content #mentions {
padding-top: 20px;
}
/* line 508, ../sass/screen.scss */
/* line 519, ../sass/screen.scss */
#content #mentions div.content {
width: 60%;
font-size: 90%;
}
/* line 513, ../sass/screen.scss */
/* line 524, ../sass/screen.scss */
#content #mentions p {
padding-bottom: 15px;
}
/* line 517, ../sass/screen.scss */
/* line 528, ../sass/screen.scss */
#content #mentions h2 {
color: black;
padding-bottom: 40px;
@@ -540,7 +544,7 @@ ul li {
line-height: 35px;
font-family: "myriadpro-regular";
}
/* line 525, ../sass/screen.scss */
/* line 536, ../sass/screen.scss */
#content #mentions h3 {
font-family: "comfortaaregular";
font-size: 18px;
@@ -549,58 +553,58 @@ ul li {
color: black;
}

/* line 536, ../sass/screen.scss */
/* line 547, ../sass/screen.scss */
.mentions #main, .mentions body {
background-color: white;
}

/* line 541, ../sass/screen.scss */
/* line 552, ../sass/screen.scss */
.vegas-loading {
display: none;
}

/* line 548, ../sass/screen.scss */
/* line 559, ../sass/screen.scss */
#profil-user .form-group.field-user-no_mail label {
font-weight: normal;
}
/* line 552, ../sass/screen.scss */
/* line 563, ../sass/screen.scss */
#profil-user .form-group label {
cursor: pointer;
}
/* line 557, ../sass/screen.scss */
/* line 568, ../sass/screen.scss */
#profil-user #mails-jours-prod .form-group {
float: left;
margin-right: 15px;
}
/* line 560, ../sass/screen.scss */
/* line 571, ../sass/screen.scss */
#profil-user #mails-jours-prod .form-group label {
font-weight: normal;
}
/* line 566, ../sass/screen.scss */
/* line 577, ../sass/screen.scss */
#profil-user p.strong {
font-weight: bold;
}

/* login */
/* line 575, ../sass/screen.scss */
/* line 586, ../sass/screen.scss */
.site-login .col-lg-5 {
margin: 0px auto;
float: none;
}

/* signup */
/* line 583, ../sass/screen.scss */
/* line 594, ../sass/screen.scss */
.modal-backdrop {
z-index: -1;
z-index: 999;
}

/* line 588, ../sass/screen.scss */
/* line 599, ../sass/screen.scss */
.site-signup .col-lg-5 {
margin: 0px auto;
float: none;
}

/* line 598, ../sass/screen.scss */
/* line 609, ../sass/screen.scss */
#modal-cgv .modal-body h2 {
margin-bottom: 5px;
padding-bottom: 0px;
@@ -608,37 +612,37 @@ ul li {
margin-top: 0px;
}

/* line 608, ../sass/screen.scss */
/* line 619, ../sass/screen.scss */
#form-signup #client-boulanger {
margin-bottom: 30px;
}
/* line 613, ../sass/screen.scss */
/* line 624, ../sass/screen.scss */
#form-signup #signupform-id_etablissement option:disabled {
font-weight: bold;
color: black;
}
/* line 619, ../sass/screen.scss */
/* line 630, ../sass/screen.scss */
#form-signup #champs-boulanger {
display: none;
}
/* line 623, ../sass/screen.scss */
/* line 634, ../sass/screen.scss */
#form-signup #boutons-inscrire {
margin-top: 30px;
}

/* line 628, ../sass/screen.scss */
/* line 639, ../sass/screen.scss */
#col-left {
padding: 0px;
z-index: 15;
}
/* line 632, ../sass/screen.scss */
/* line 643, ../sass/screen.scss */
#col-left .affix {
width: 25%;
border-right: solid 1px #e0e0e0;
background-color: #FAFAFA;
height: 100%;
}
/* line 639, ../sass/screen.scss */
/* line 650, ../sass/screen.scss */
#col-left #link-home {
text-decoration: none;
font-size: 22px;
@@ -647,28 +651,28 @@ ul li {
padding: 10px;
background-color: #F8F1DD;
}
/* line 647, ../sass/screen.scss */
/* line 658, ../sass/screen.scss */
#col-left #link-home img {
height: 50px;
margin-bottom: 5px;
float: left;
}
/* line 653, ../sass/screen.scss */
/* line 664, ../sass/screen.scss */
#col-left #link-home .text {
padding-left: 62px;
}
/* line 656, ../sass/screen.scss */
/* line 667, ../sass/screen.scss */
#col-left #link-home .text .bap {
font-family: "comfortaalight";
font-size: 24px;
}
/* line 661, ../sass/screen.scss */
/* line 672, ../sass/screen.scss */
#col-left #link-home .text .plateforme {
font-size: 17px;
font-family: "myriadpro-light";
color: #BB8757;
}
/* line 669, ../sass/screen.scss */
/* line 680, ../sass/screen.scss */
#col-left h2 {
font-family: "myriadpro-regular";
color: black;
@@ -676,37 +680,37 @@ ul li {
margin-bottom: 10px;
padding: 15px 0px 5px 15px;
}
/* line 677, ../sass/screen.scss */
/* line 688, ../sass/screen.scss */
#col-left #links {
background-color: white;
margin-bottom: 20px;
}
/* line 683, ../sass/screen.scss */
/* line 694, ../sass/screen.scss */
#col-left #links ul li a {
text-align: center;
border-right: solid 1px #e0e0e0;
}
/* line 687, ../sass/screen.scss */
/* line 698, ../sass/screen.scss */
#col-left #links ul li a:hover {
background-color: #BB8757;
color: white;
}
/* line 693, ../sass/screen.scss */
/* line 704, ../sass/screen.scss */
#col-left #links ul li:last-child a {
border-right: 0px none;
}
/* line 703, ../sass/screen.scss */
/* line 714, ../sass/screen.scss */
#col-left #producteurs nav.nav-producteurs ul li a {
padding-left: 50px;
height: 40px;
}
/* line 709, ../sass/screen.scss */
/* line 720, ../sass/screen.scss */
#col-left #producteurs nav.nav-producteurs ul li.active a {
background-color: #BB8757;
position: relative;
color: white;
}
/* line 714, ../sass/screen.scss */
/* line 725, ../sass/screen.scss */
#col-left #producteurs nav.nav-producteurs ul li.active a:after {
right: -40px;
top: 50%;
@@ -721,18 +725,18 @@ ul li {
border-width: 20px;
margin-top: -20px;
}
/* line 733, ../sass/screen.scss */
/* line 744, ../sass/screen.scss */
#col-left ul {
list-style-type: none;
margin: 0px;
padding: 0px;
}
/* line 737, ../sass/screen.scss */
/* line 748, ../sass/screen.scss */
#col-left ul li {
margin: 0px;
padding: 0px;
}
/* line 740, ../sass/screen.scss */
/* line 751, ../sass/screen.scss */
#col-left ul li a {
text-decoration: none;
font-family: "comfortaaregular";
@@ -743,18 +747,18 @@ ul li {
display: block;
color: black;
}
/* line 750, ../sass/screen.scss */
/* line 761, ../sass/screen.scss */
#col-left ul li a span.nom, #col-left ul li a span.libelle {
display: none;
}
/* line 757, ../sass/screen.scss */
/* line 768, ../sass/screen.scss */
#col-left p {
padding: 20px;
padding-top: 0px;
color: gray;
}

/* line 765, ../sass/screen.scss */
/* line 776, ../sass/screen.scss */
#content .header-title {
height: 79px;
padding: 20px 20px;
@@ -769,7 +773,7 @@ ul li {
-webkit-box-shadow: 0px 0px 8px #e0e0e0;
box-shadow: 0px 0px 8px #e0e0e0;
}
/* line 777, ../sass/screen.scss */
/* line 788, ../sass/screen.scss */
#content .header-title h1 {
color: black;
font-family: "myriadpro-regular";
@@ -777,7 +781,7 @@ ul li {
font-size: 25px;
text-transform: uppercase;
}
/* line 785, ../sass/screen.scss */
/* line 796, ../sass/screen.scss */
#content .header-title h2 {
color: gray;
text-transform: none;
@@ -786,16 +790,16 @@ ul li {
line-height: 20px;
}

/* line 796, ../sass/screen.scss */
/* line 807, ../sass/screen.scss */
.header-etablissement {
z-index: 1;
}
/* line 798, ../sass/screen.scss */
/* line 809, ../sass/screen.scss */
.header-etablissement #block-main-img {
height: 144px;
overflow: hidden;
}
/* line 802, ../sass/screen.scss */
/* line 813, ../sass/screen.scss */
.header-etablissement #block-main-img #main-img {
width: 100%;
height: auto;
@@ -805,7 +809,7 @@ ul li {
-webkit-border-radius: 0px;
border-radius: 0px;
}
/* line 811, ../sass/screen.scss */
/* line 822, ../sass/screen.scss */
.header-etablissement h1 {
font-family: "comfortaaregular";
text-align: center;
@@ -813,23 +817,23 @@ ul li {
top: 30px;
left: 40px;
}
/* line 818, ../sass/screen.scss */
/* line 829, ../sass/screen.scss */
.header-etablissement h1 span {
background-color: rgba(255, 255, 255, 0.8);
padding: 10px 30px;
border: dotted 1px black;
}

/* line 829, ../sass/screen.scss */
/* line 840, ../sass/screen.scss */
nav#menu-etablissement {
border-bottom: solid 1px #e0e0e0;
}
/* line 833, ../sass/screen.scss */
/* line 844, ../sass/screen.scss */
nav#menu-etablissement ul li {
padding: 0px;
margin: 0px;
}
/* line 836, ../sass/screen.scss */
/* line 847, ../sass/screen.scss */
nav#menu-etablissement ul li a {
border-right: solid 1px #e0e0e0;
text-decoration: none;
@@ -837,7 +841,7 @@ nav#menu-etablissement ul li a {
-webkit-border-radius: 0px;
border-radius: 0px;
}
/* line 841, ../sass/screen.scss */
/* line 852, ../sass/screen.scss */
nav#menu-etablissement ul li a:hover {
background-color: #BB8757;
color: white;

+ 4
- 0
frontend/web/js/frontend.js Voir le fichier

@@ -0,0 +1,4 @@

$(document).ready(function() {
$('.dropdown-toggle').dropdown() ;
}) ;

+ 15
- 4
frontend/web/sass/screen.scss Voir le fichier

@@ -117,6 +117,8 @@ ul {
}




#main {
position: relative ;
.inner {
@@ -232,17 +234,26 @@ ul {
a {
text-decoration: none ;
color: $courant ;
&.active {
background-color: white;
}
&:hover {
color: black ;
background-color: white ;
}
}
&.active {
a {
background-color: white;
}
}
&#link-producteurs {
border-right: solid 1px #e0e0e0 ;
}
}
}
}
#link-logout {
@@ -581,7 +592,7 @@ ul {
/* signup */

.modal-backdrop {
z-index: -1;
z-index: 999;
}

.site-signup {

+ 2
- 1
producer/components/UrlManagerProducer.php Voir le fichier

@@ -8,7 +8,8 @@ class UrlManagerProducer extends \common\components\UrlManagerCommon {
if(!is_array($params))
$params = [$params] ;
$params['slug_producer'] = Yii::$app->getRequest()->getQueryParam('slug_producer') ;
if(!isset($params['slug_producer']))
$params['slug_producer'] = Yii::$app->getRequest()->getQueryParam('slug_producer') ;
return parent::createUrl($params) ;
}

+ 0
- 2
producer/views/commande/historique.php Voir le fichier

@@ -19,8 +19,6 @@ $this->setTitle('Historique de mes commandes') ;
<div class="alert alert-success"><div class="icon"></div>Votre commande a bien été annulée.</div>
<?php endif; ?>

<h2 class="first">Historique</h2>

<?=

GridView::widget([

Chargement…
Annuler
Enregistrer