Bläddra i källkod

Infos point de vente : lien permettant de sélectionner le jour précédent

Il suffit pour cela d'inclure un bbcode du type : [select_previous_day]Nom du lien[/select_previous_day].
Cela résoud la problématique du Chat des Noisettes concernant la disponibilité du pain sur 2 jours sur un dépôt : obligation de commande sur le vendredi pour avoir du pain le samedi matin.
refactoring
keun 6 år sedan
förälder
incheckning
f577c4a906
6 ändrade filer med 76 tillägg och 50 borttagningar
  1. +11
    -0
      common/models/PointVente.php
  2. +7
    -7
      producer/views/commande/_form.php
  3. Binär
      producer/web/.sass-cache/02dccb5f9955880bcb6e5ad5d1fece2607a7ff62/_form.scssc
  4. +48
    -43
      producer/web/css/screen.css
  5. +6
    -0
      producer/web/js/lechatdesnoisettes.js
  6. +4
    -0
      producer/web/sass/commande/_form.scss

+ 11
- 0
common/models/PointVente.php Visa fil

@@ -208,5 +208,16 @@ class PointVente extends \yii\db\ActiveRecord {
else
return '' ;
}
public function strInfos($jour) {
$str = '' ;
$champs = 'horaires_'.$jour ;
if(strlen($this->$champs)) {
$str = nl2br(Html::encode($this->$champs)) ;
$str = preg_replace('/\[select_previous_day\](.*?)\[\/select_previous_day\]/', '<a href="javascript:void(0);" class="select-previous-day">$1</a>' , $str) ;
}
return $str ;
}

}

+ 7
- 7
producer/views/commande/_form.php Visa fil

@@ -127,13 +127,13 @@ use yii\widgets\ActiveForm;
<?php
foreach ($points_vente as $pv) {
echo '<div class="alert alert-warning infos-pv infos-pv-'.$pv->id.'"><h4>Infos : <span>'.Html::encode($pv->nom).'</span></h4>' .
'<div class="jour jour-1">' . (strlen($pv->horaires_lundi) ? nl2br(Html::encode($pv->horaires_lundi)) : '') . '</div>' .
'<div class="jour jour-2">' . (strlen($pv->horaires_mardi) ? nl2br(Html::encode($pv->horaires_mardi)) : '') . '</div>' .
'<div class="jour jour-3">' . (strlen($pv->horaires_mercredi) ? nl2br(Html::encode($pv->horaires_mercredi)) : '') . '</div>' .
'<div class="jour jour-4">' . (strlen($pv->horaires_jeudi) ? nl2br(Html::encode($pv->horaires_jeudi)) : '') . '</div>' .
'<div class="jour jour-5">' . (strlen($pv->horaires_vendredi) ? nl2br(Html::encode($pv->horaires_vendredi)) : '') . '</div>' .
'<div class="jour jour-6">' . (strlen($pv->horaires_samedi) ? nl2br(Html::encode($pv->horaires_samedi)) : '') . '</div>' .
'<div class="jour jour-0">' . (strlen($pv->horaires_dimanche) ? nl2br(Html::encode($pv->horaires_dimanche)) : '') . '</div>' .
'<div class="jour jour-1">' . $pv->strInfos('lundi') . '</div>' .
'<div class="jour jour-2">' . $pv->strInfos('mardi') . '</div>' .
'<div class="jour jour-3">' . $pv->strInfos('mercredi') . '</div>' .
'<div class="jour jour-4">' . $pv->strInfos('jeudi') . '</div>' .
'<div class="jour jour-5">' . $pv->strInfos('vendredi') . '</div>' .
'<div class="jour jour-6">' . $pv->strInfos('samedi') . '</div>' .
'<div class="jour jour-0">' . $pv->strInfos('dimanche') . '</div>' .
'</div>' ;
}
?>

Binär
producer/web/.sass-cache/02dccb5f9955880bcb6e5ad5d1fece2607a7ff62/_form.scssc Visa fil


+ 48
- 43
producer/web/css/screen.css Visa fil

@@ -669,23 +669,28 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
font-family: "myriadpro-regular";
text-transform: none;
}
/* line 183, ../sass/commande/_form.scss */
/* line 182, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form .infos-pv a,
.commande-update #main #content .commande-form .infos-pv a {
text-decoration: underline;
}
/* line 187, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits,
.commande-update #main #content .commande-form #produits {
margin-top: 15px;
}
/* line 186, ../sass/commande/_form.scss */
/* line 190, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits #label-produits,
.commande-update #main #content .commande-form #produits #label-produits {
display: block;
margin-bottom: 5px;
}
/* line 191, ../sass/commande/_form.scss */
/* line 195, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table,
.commande-update #main #content .commande-form #produits .table {
margin-top: 7px;
}
/* line 194, ../sass/commande/_form.scss */
/* line 198, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .illu,
.commande-update #main #content .commande-form #produits .table .illu {
float: left;
@@ -693,19 +698,19 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
width: 70px;
margin-right: 15px;
}
/* line 201, ../sass/commande/_form.scss */
/* line 205, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .photo,
.commande-update #main #content .commande-form #produits .table .photo {
padding: 0px;
width: 120px;
}
/* line 206, ../sass/commande/_form.scss */
/* line 210, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .th-photo, .commande-create #main #content .commande-form #produits .table .td-photo,
.commande-update #main #content .commande-form #produits .table .th-photo,
.commande-update #main #content .commande-form #produits .table .td-photo {
width: 120px;
}
/* line 210, ../sass/commande/_form.scss */
/* line 214, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .nom,
.commande-update #main #content .commande-form #produits .table .nom {
font-family: "comfortaalight";
@@ -713,27 +718,27 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
text-transform: uppercase;
font-size: 18px;
}
/* line 217, ../sass/commande/_form.scss */
/* line 221, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .description,
.commande-update #main #content .commande-form #produits .table .description {
font-style: italic;
}
/* line 221, ../sass/commande/_form.scss */
/* line 225, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .recette,
.commande-update #main #content .commande-form #produits .table .recette {
font-size: 12px;
}
/* line 225, ../sass/commande/_form.scss */
/* line 229, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .input-group,
.commande-update #main #content .commande-form #produits .table .input-group {
width: 133px;
}
/* line 227, ../sass/commande/_form.scss */
/* line 231, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .input-group .quantity,
.commande-update #main #content .commande-form #produits .table .input-group .quantity {
text-align: center;
}
/* line 232, ../sass/commande/_form.scss */
/* line 236, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .colonne-quantite, .commande-create #main #content .commande-form #produits .table .prix-unit, .commande-create #main #content .commande-form #produits .table .total,
.commande-update #main #content .commande-form #produits .table .colonne-quantite,
.commande-update #main #content .commande-form #produits .table .prix-unit,
@@ -741,14 +746,14 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
width: 150px;
text-align: center;
}
/* line 237, ../sass/commande/_form.scss */
/* line 241, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table td#total-commande, .commande-create #main #content .commande-form #produits .table td#total-commande-vrac, .commande-create #main #content .commande-form #produits .table td.total,
.commande-update #main #content .commande-form #produits .table td#total-commande,
.commande-update #main #content .commande-form #produits .table td#total-commande-vrac,
.commande-update #main #content .commande-form #produits .table td.total {
text-align: center;
}
/* line 241, ../sass/commande/_form.scss */
/* line 245, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .epuise,
.commande-update #main #content .commande-form #produits .table .epuise {
display: none;
@@ -758,42 +763,42 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
font-size: 16px;
text-align: center;
}
/* line 250, ../sass/commande/_form.scss */
/* line 254, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .quantite-restante,
.commande-update #main #content .commande-form #produits .table .quantite-restante {
font-size: 12px;
margin-top: 8px;
}
/* line 254, ../sass/commande/_form.scss */
/* line 258, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table .quantite-restante .nb,
.commande-update #main #content .commande-form #produits .table .quantite-restante .nb {
font-weight: bold;
}
/* line 259, ../sass/commande/_form.scss */
/* line 263, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table td.produit, .commande-create #main #content .commande-form #produits .table th.produit,
.commande-update #main #content .commande-form #produits .table td.produit,
.commande-update #main #content .commande-form #produits .table th.produit {
width: 70%;
}
/* line 263, ../sass/commande/_form.scss */
/* line 267, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table td.prix-unit, .commande-create #main #content .commande-form #produits .table th.prix-unit,
.commande-update #main #content .commande-form #produits .table td.prix-unit,
.commande-update #main #content .commande-form #produits .table th.prix-unit {
width: 10%;
}
/* line 267, ../sass/commande/_form.scss */
/* line 271, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table td.colonne-quantite, .commande-create #main #content .commande-form #produits .table th.colonne-quantite,
.commande-update #main #content .commande-form #produits .table td.colonne-quantite,
.commande-update #main #content .commande-form #produits .table th.colonne-quantite {
width: 10%;
}
/* line 271, ../sass/commande/_form.scss */
/* line 275, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #produits .table td.total, .commande-create #main #content .commande-form #produits .table th.total,
.commande-update #main #content .commande-form #produits .table td.total,
.commande-update #main #content .commande-form #produits .table th.total {
width: 10%;
}
/* line 277, ../sass/commande/_form.scss */
/* line 281, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed,
.commande-update #main #content .commande-form #bar-fixed {
display: none;
@@ -813,14 +818,14 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
background-color: #F8F1DD;
text-align: center;
}
/* line 293, ../sass/commande/_form.scss */
/* line 297, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed .container,
.commande-update #main #content .commande-form #bar-fixed .container {
min-height: auto;
background: none;
border: 0px none;
}
/* line 299, ../sass/commande/_form.scss */
/* line 303, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed.not-fixed,
.commande-update #main #content .commande-form #bar-fixed.not-fixed {
position: relative;
@@ -833,18 +838,18 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
border: solid 1px #e0e0e0;
padding-right: 20px;
}
/* line 306, ../sass/commande/_form.scss */
/* line 310, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed.not-fixed .container,
.commande-update #main #content .commande-form #bar-fixed.not-fixed .container {
width: auto;
}
/* line 312, ../sass/commande/_form.scss */
/* line 316, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed.no-credit-pain #bloc-valider-commande,
.commande-update #main #content .commande-form #bar-fixed.no-credit-pain #bloc-valider-commande {
margin-top: 0px;
float: right;
}
/* line 318, ../sass/commande/_form.scss */
/* line 322, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #total-commande-bottom,
.commande-update #main #content .commande-form #bar-fixed #total-commande-bottom {
background-color: white;
@@ -854,29 +859,29 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
padding: 5px 25px;
border: solid 1px #e0e0e0;
}
/* line 325, ../sass/commande/_form.scss */
/* line 329, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed .btn-commentaire,
.commande-update #main #content .commande-form #bar-fixed .btn-commentaire {
float: left;
}
/* line 333, ../sass/commande/_form.scss */
/* line 337, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed .btn-commentaire,
.commande-update #main #content .commande-form #bar-fixed .btn-commentaire {
margin-right: 10px;
}
/* line 337, ../sass/commande/_form.scss */
/* line 341, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #bloc-valider-commande,
.commande-update #main #content .commande-form #bar-fixed #bloc-valider-commande {
text-align: right;
margin-top: 20px;
}
/* line 341, ../sass/commande/_form.scss */
/* line 345, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #bloc-valider-commande button,
.commande-update #main #content .commande-form #bar-fixed #bloc-valider-commande button {
width: 340px;
margin-right: 10px;
}
/* line 347, ../sass/commande/_form.scss */
/* line 351, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #checkbox-credit-pain,
.commande-update #main #content .commande-form #bar-fixed #checkbox-credit-pain {
float: right;
@@ -893,18 +898,18 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 1px 1px rgba(0, 0, 0, 0.075);
}
/* line 358, ../sass/commande/_form.scss */
/* line 362, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #checkbox-credit-pain.paiement-impossible,
.commande-update #main #content .commande-form #bar-fixed #checkbox-credit-pain.paiement-impossible {
background-color: #e0e0e0;
}
/* line 362, ../sass/commande/_form.scss */
/* line 366, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #checkbox-credit-pain .info,
.commande-update #main #content .commande-form #bar-fixed #checkbox-credit-pain .info {
color: gray;
font-weight: normal;
}
/* line 367, ../sass/commande/_form.scss */
/* line 371, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #checkbox-credit-pain .the-credit,
.commande-update #main #content .commande-form #bar-fixed #checkbox-credit-pain .the-credit {
background-color: #BB8757;
@@ -914,36 +919,36 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
-webkit-border-radius: 5px;
border-radius: 5px;
}
/* line 374, ../sass/commande/_form.scss */
/* line 378, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #checkbox-credit-pain .montant-paye,
.commande-update #main #content .commande-form #bar-fixed #checkbox-credit-pain .montant-paye {
color: #BB8757;
}
/* line 378, ../sass/commande/_form.scss */
/* line 382, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #checkbox-credit-pain #info-credit-vide,
.commande-update #main #content .commande-form #bar-fixed #checkbox-credit-pain #info-credit-vide {
font-size: 12px;
}
/* line 382, ../sass/commande/_form.scss */
/* line 386, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #checkbox-credit-pain #credit-pain-disabled,
.commande-update #main #content .commande-form #bar-fixed #checkbox-credit-pain #credit-pain-disabled {
display: none;
font-size: 12px;
}
/* line 388, ../sass/commande/_form.scss */
/* line 392, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed .btn-retour, .commande-create #main #content .commande-form #bar-fixed .annuler-commande,
.commande-update #main #content .commande-form #bar-fixed .btn-retour,
.commande-update #main #content .commande-form #bar-fixed .annuler-commande {
float: left;
margin-right: 5px;
}
/* line 393, ../sass/commande/_form.scss */
/* line 397, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed .annuler-commande,
.commande-update #main #content .commande-form #bar-fixed .annuler-commande {
color: #b92c28;
background-color: white;
}
/* line 398, ../sass/commande/_form.scss */
/* line 402, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed #total-commande-bottom,
.commande-update #main #content .commande-form #bar-fixed #total-commande-bottom {
display: none;
@@ -951,12 +956,12 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
font-family: "comfortaalight";
font-size: 24px;
}
/* line 405, ../sass/commande/_form.scss */
/* line 409, ../sass/commande/_form.scss */
.commande-create #main #content .commande-form #bar-fixed .field-commande-commentaire,
.commande-update #main #content .commande-form #bar-fixed .field-commande-commentaire {
display: none;
}
/* line 413, ../sass/commande/_form.scss */
/* line 417, ../sass/commande/_form.scss */
.commande-create .ui-datepicker .ui-widget-header,
.commande-update .ui-datepicker .ui-widget-header {
background: none;
@@ -965,7 +970,7 @@ ul.pagination li a:hover, ul.pagination li a:focus, ul.pagination li a:active {
color: black;
font-weight: normal;
}
/* line 421, ../sass/commande/_form.scss */
/* line 425, ../sass/commande/_form.scss */
.commande-create .ui-datepicker .ui-datepicker-current-day a,
.commande-create .ui-datepicker a.ui-state-hover,
.commande-update .ui-datepicker .ui-datepicker-current-day a,

+ 6
- 0
producer/web/js/lechatdesnoisettes.js Visa fil

@@ -121,6 +121,10 @@ function chat_init_horaire_point_vente(date) {
$('.infos-pv .jour').hide() ;
var selector_jour = '.infos-pv .jour-'+date.getDay() ;
$(selector_jour).show() ;
$('.select-previous-day').unbind('click').click(function() {
$('.ui-datepicker-current-day').prev().find('a').click() ;
}) ;
}

function chat_base_url(with_slug) {
@@ -206,6 +210,8 @@ function chat_systeme_commande() {
},
onSelect: function(selectedDate) {
$('.infos-pv').hide() ;
// on remet tout les prix à zéro
chat_systeme_commande_reset_table_prix() ;

+ 4
- 0
producer/web/sass/commande/_form.scss Visa fil

@@ -178,6 +178,10 @@
text-transform: none ;
}
}
a {
text-decoration: underline ;
}
}

#produits {

Laddar…
Avbryt
Spara