Selaa lähdekoodia

Intégration Souke

feature/souke
Guillaume Bourgeois 7 kuukautta sitten
vanhempi
commit
146ee4c72a
35 muutettua tiedostoa jossa 1211 lisäystä ja 982 poistoa
  1. +2
    -2
      common/helpers/MeanPayment.php
  2. +177
    -49
      common/web/css/screen.css
  3. +123
    -9
      common/web/sass/_common.scss
  4. +2
    -1
      common/web/sass/screen.scss
  5. +8
    -7
      domain/Payment/PaymentSolver.php
  6. +5
    -0
      domain/PointSale/PointSale/PointSaleRepository.php
  7. +3
    -3
      domain/PointSale/PointSale/PointSaleSolver.php
  8. +6
    -2
      domain/Product/Product/ProductRepository.php
  9. +2
    -2
      frontend/views/site/_prices_producer.php
  10. +1
    -1
      frontend/views/site/contact.php
  11. +215
    -270
      frontend/web/css/screen.css
  12. +1
    -1
      frontend/web/sass/_responsive.scss
  13. +0
    -49
      frontend/web/sass/screen.scss
  14. +2
    -2
      producer/controllers/NewsletterController.php
  15. +23
    -15
      producer/controllers/SiteController.php
  16. +7
    -7
      producer/views/credit/add.php
  17. +7
    -14
      producer/views/credit/history.php
  18. +38
    -18
      producer/views/layouts/main.php
  19. +27
    -19
      producer/views/newsletter/index.php
  20. +3
    -3
      producer/views/site/contact.php
  21. +2
    -162
      producer/views/site/index.php
  22. +135
    -0
      producer/views/site/points-sale.php
  23. +139
    -0
      producer/views/site/products.php
  24. +204
    -235
      producer/web/css/screen.css
  25. +12
    -32
      producer/web/sass/_layout.scss
  26. +2
    -9
      producer/web/sass/credit/_add.scss
  27. +17
    -0
      producer/web/sass/credit/_history.scss
  28. +0
    -1
      producer/web/sass/order/_confirm.scss
  29. +0
    -7
      producer/web/sass/order/_order.scss
  30. +2
    -0
      producer/web/sass/screen.scss
  31. +1
    -1
      producer/web/sass/site/_credit_history.scss
  32. +1
    -59
      producer/web/sass/site/_index.scss
  33. +28
    -0
      producer/web/sass/site/_points_sale.scss
  34. +16
    -0
      producer/web/sass/site/_products.scss
  35. +0
    -2
      producer/web/sass/subscription/_form.scss

+ 2
- 2
common/helpers/MeanPayment.php Näytä tiedosto

@@ -61,8 +61,8 @@ class MeanPayment {
case self::CHEQUE : return 'Chèque' ;
case self::TRANSFER : return 'Virement' ;
case self::OTHER : return 'Autre' ;
case self::CREDIT : return 'Crédit' ;
default: return 'Crédit' ;
case self::CREDIT : return 'Cagnotte' ;
default: return 'Indéfini' ;
}
}

+ 177
- 49
common/web/css/screen.css Näytä tiedosto

@@ -139,69 +139,197 @@ termes.
font-weight: normal;
font-style: normal;
}
/* line 3, ../sass/_common.scss */
#main {
/* Boutons */
/* Alertes */
/* Tableaux */
/* Formulaires */
}
/* line 5, ../sass/_common.scss */
#main .btn-primary,
#main .btn-secondary {
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
font-family: 'worksans_semibold';
}
/* line 9, ../sass/_common.scss */
/* line 10, ../sass/_common.scss */
#main .btn-primary .bi,
#main .btn-secondary .bi {
margin-right: 5px;
}
/* line 14, ../sass/_common.scss */
/* line 15, ../sass/_common.scss */
#main .btn-primary {
background-color: #ee6f42;
border: solid 1px #ee6f42;
border: 0px none;
color: white;
}
/* line 19, ../sass/_common.scss */
/* line 20, ../sass/_common.scss */
#main .btn-primary:hover, #main .btn-primary:active, #main .btn-primary:focus {
background-color: #ec5d2b;
border: solid 1px #ee6f42;
filter: brightness(90%);
border: 0px none;
color: white;
}
/* line 26, ../sass/_common.scss */
/* line 27, ../sass/_common.scss */
#main .btn-secondary {
color: black;
background-color: #f4efe8;
border: solid 1px #f4efe8;
}
/* line 31, ../sass/_common.scss */
/* line 32, ../sass/_common.scss */
#main .btn-secondary:hover, #main .btn-secondary:focus, #main .btn-secondary.active {
background-color: #ece4d8;
border: solid 1px #ece4d8;
color: black;
}
/* line 38, ../sass/_common.scss */
#main .alert-information {
padding: 20px;
margin-bottom: 20px;
/* line 40, ../sass/_common.scss */
#main .alert {
border: 0px none;
background-color: #ece4d8 !important;
color: black;
-moz-border-radius: 0px !important;
-webkit-border-radius: 0px;
border-radius: 0px !important;
color: black;
padding: 20px;
margin-bottom: 20px;
}
/* line 47, ../sass/_common.scss */
#main .alert.alert-success {
background-color: #e4e9ad !important;
}
/* line 51, ../sass/_common.scss */
#main .alert.alert-info {
background-color: #97bfc4 !important;
}
/* line 55, ../sass/_common.scss */
#main .alert.alert-warning {
background-color: #ecd58e !important;
}
/* line 59, ../sass/_common.scss */
#main .alert.alert-danger {
background-color: #edbaa4 !important;
}
/* line 63, ../sass/_common.scss */
#main .alert.alert-dark {
background-color: #ece4d8 !important;
}
/* line 70, ../sass/_common.scss */
#main .table {
border: 0px none;
}
/* line 73, ../sass/_common.scss */
#main .table.table-striped > tbody > tr:nth-of-type(2n) > *,
#main .table thead tr th {
background-color: #ece4d8;
}
/* line 78, ../sass/_common.scss */
#main .table.table-striped > tbody > tr:nth-of-type(2n+1) > * {
background-color: #f8f7f3;
}
/* line 82, ../sass/_common.scss */
#main .table thead tr th,
#main .table tbody tr td {
-moz-box-shadow: -20px 0 20px -20px rgba(0, 0, 0, 0.2) inset;
-webkit-box-shadow: -20px 0 20px -20px rgba(0, 0, 0, 0.2) inset;
box-shadow: -20px 0 20px -20px rgba(0, 0, 0, 0.2) inset;
}
/* line 86, ../sass/_common.scss */
#main .table thead tr th:last-child,
#main .table tbody tr td:last-child {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
/* line 92, ../sass/_common.scss */
#main .table thead tr {
border: 0px none;
}
/* line 94, ../sass/_common.scss */
#main .table thead tr th {
border: 0px none;
padding: 10px 20px;
}
/* line 102, ../sass/_common.scss */
#main .table tbody tr {
border: 0px none;
}
/* line 104, ../sass/_common.scss */
#main .table tbody tr td {
border: 0px none;
padding: 20px;
}
/* line 114, ../sass/_common.scss */
#main form .control-label {
font-family: 'worksans_medium';
}
/* line 118, ../sass/_common.scss */
#main form input[type="text"],
#main form input[type="email"],
#main form input[type="password"],
#main form textarea,
#main form select {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
border: solid 1px #b7ab9b;
}
/* line 128, ../sass/_common.scss */
#main form .form-control:hover {
border: solid 1px gray;
}
/* line 132, ../sass/_common.scss */
#main form .form-control:focus {
-moz-box-shadow: 0px 0px 0px 1px #ee6f42;
-webkit-box-shadow: 0px 0px 0px 1px #ee6f42;
box-shadow: 0px 0px 0px 1px #ee6f42;
border: solid 1px #ee6f42;
}
/* line 138, ../sass/_common.scss */
#main form .has-error .control-label {
color: black;
}
/* line 142, ../sass/_common.scss */
#main form .has-error .form-control:focus, #main form .has-error .form-control {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
border-color: #a94442;
}
/* line 147, ../sass/_common.scss */
#main form .has-error .help-block-error {
color: #a94442;
}
/* line 152, ../sass/_common.scss */
#main form .form-buttons {
text-align: right;
}

/* line 49, ../sass/_common.scss */
/* Divers */
/* line 159, ../sass/_common.scss */
.float-left {
float: left;
}

/* line 53, ../sass/_common.scss */
/* line 163, ../sass/_common.scss */
.float-right {
float: right;
}

/* line 167, ../sass/_common.scss */
.clr {
clear: both;
}

/* Navigation utilisateur en haut du site */
/* line 58, ../sass/_common.scss */
/* line 172, ../sass/_common.scss */
.container-nav-user-top {
position: relative;
z-index: 999;
}
/* line 62, ../sass/_common.scss */
/* line 176, ../sass/_common.scss */
.container-nav-user-top .nav-user-top {
position: absolute;
top: 0px;
@@ -209,7 +337,7 @@ termes.
background-color: white;
z-index: 100;
}
/* line 69, ../sass/_common.scss */
/* line 183, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar {
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
@@ -219,16 +347,16 @@ termes.
margin: 0px;
min-height: 0px;
}
/* line 76, ../sass/_common.scss */
/* line 190, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul {
position: relative;
left: -10px;
}
/* line 80, ../sass/_common.scss */
/* line 194, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li {
padding-left: 5px;
}
/* line 83, ../sass/_common.scss */
/* line 197, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li a.nav-link {
padding-left: 10px;
padding-right: 10px;
@@ -238,12 +366,12 @@ termes.
color: black;
font-size: 16px;
}
/* line 92, ../sass/_common.scss */
/* line 206, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li a.nav-link:hover, .container-nav-user-top .nav-user-top .navbar ul li a.nav-link:focus, .container-nav-user-top .nav-user-top .navbar ul li a.nav-link.active {
background: none;
color: #ee6f42;
}
/* line 97, ../sass/_common.scss */
/* line 211, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li a.nav-link .bi {
color: #ee6f42;
font-size: 16px;
@@ -251,55 +379,55 @@ termes.
position: relative;
top: 1px;
}
/* line 107, ../sass/_common.scss */
/* line 221, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a {
padding: 2px 20px;
}
/* line 110, ../sass/_common.scss */
/* line 224, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a:hover, .container-nav-user-top .nav-user-top .navbar ul li .dropdown-menu a:focus {
background-color: #ece4d8;
}
/* line 119, ../sass/_common.scss */
/* line 233, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .dropdown-menu {
z-index: 9999;
}
/* line 121, ../sass/_common.scss */
/* line 235, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .dropdown-menu .divider.dropdown-header {
padding: 0px;
}

@media screen and (max-width: 991px) {
/* line 131, ../sass/_common.scss */
/* line 245, ../sass/_common.scss */
.container-nav-user-top {
padding: 0px;
margin: 0px;
width: 100%;
max-width: none;
}
/* line 137, ../sass/_common.scss */
/* line 251, ../sass/_common.scss */
.container-nav-user-top .nav-user-top {
position: relative;
}
/* line 141, ../sass/_common.scss */
/* line 255, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul {
width: 100%;
display: block;
margin-right: 0px;
text-align: center;
}
/* line 147, ../sass/_common.scss */
/* line 261, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li {
display: inline-block;
}
/* line 151, ../sass/_common.scss */
/* line 265, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar ul li.nav-item-producers .dropdown-menu {
right: -95px;
}
/* line 158, ../sass/_common.scss */
/* line 272, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar .link-text {
display: none;
}
/* line 162, ../sass/_common.scss */
/* line 276, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar .dropdown-menu {
position: absolute;
right: 5%;
@@ -310,32 +438,32 @@ termes.
-webkit-box-shadow: 0px 0px 4px gray;
box-shadow: 0px 0px 4px gray;
}
/* line 171, ../sass/_common.scss */
/* line 285, ../sass/_common.scss */
.container-nav-user-top .nav-user-top .navbar .dropdown-menu li a {
padding-left: 15px;
}
}
/* Block de date */
/* line 182, ../sass/_common.scss */
/* line 296, ../sass/_common.scss */
.block-date {
margin: 0px auto;
padding-top: 0px;
text-align: center;
}
/* line 187, ../sass/_common.scss */
/* line 301, ../sass/_common.scss */
.block-date .day {
text-transform: capitalize;
line-height: 15px;
font-size: 13px;
text-transform: uppercase;
}
/* line 194, ../sass/_common.scss */
/* line 308, ../sass/_common.scss */
.block-date .num {
font-size: 30px;
line-height: 35px;
font-weight: bold;
}
/* line 200, ../sass/_common.scss */
/* line 314, ../sass/_common.scss */
.block-date .month {
text-transform: uppercase;
line-height: 15px;
@@ -344,46 +472,46 @@ termes.
}

/* Page d'erreur */
/* line 210, ../sass/_common.scss */
/* line 324, ../sass/_common.scss */
#main #content .site-error .col-lg-6 {
margin: 0px auto;
float: none;
}
/* line 216, ../sass/_common.scss */
/* line 330, ../sass/_common.scss */
#main #content .site-error .panel .panel-body {
padding-bottom: 0px;
}
/* line 220, ../sass/_common.scss */
/* line 334, ../sass/_common.scss */
#main #content .site-error .panel h2 {
text-transform: none;
font-size: 25px;
margin-top: 0px;
margin-bottom: 0px;
}
/* line 228, ../sass/_common.scss */
/* line 342, ../sass/_common.scss */
#main #content .site-error .alert {
padding-bottom: 5px;
}
/* line 231, ../sass/_common.scss */
/* line 345, ../sass/_common.scss */
#main #content .site-error .alert h2 {
margin-top: 5px;
}
/* line 235, ../sass/_common.scss */
/* line 349, ../sass/_common.scss */
#main #content .site-error .alert p {
margin-bottom: 15px;
}
/* line 239, ../sass/_common.scss */
/* line 353, ../sass/_common.scss */
#main #content .site-error .alert .btn {
text-decoration: none;
}

/* Paiement */
/* line 250, ../sass/_common.scss */
/* line 364, ../sass/_common.scss */
.payment-detail-remaining-surplus {
font-size: 13px;
color: gray;
}
/* line 254, ../sass/_common.scss */
/* line 368, ../sass/_common.scss */
.payment-detail-remaining-surplus strong {
font-weight: bold;
}

+ 123
- 9
common/web/sass/_common.scss Näytä tiedosto

@@ -1,9 +1,10 @@
@import "compass";

#main {
/* Boutons */
.btn-primary,
.btn-secondary {
@include border-radius(0px);
font-family: 'worksans_semibold';

.bi {
@@ -13,12 +14,12 @@

.btn-primary {
background-color: $color-primary;
border: solid 1px $color-primary;
border: 0px none;
color: white;

&:hover, &:active, &:focus {
background-color: darken($color-primary, 5);
border: solid 1px $color-primary;
filter: brightness(90%);
border: 0px none;
color: white;
}
}
@@ -35,17 +36,126 @@
}
}

.alert-information {
/* Alertes */
.alert {
border: 0px none;
@include border-radius(0px !important);
color: black;
padding: 20px;
margin-bottom: 20px;

&.alert-success {
background-color: #e4e9ad !important;
}

&.alert-info {
background-color: #97bfc4 !important;
}

&.alert-warning {
background-color: #ecd58e !important;
}

&.alert-danger {
background-color: #edbaa4 !important;
}

&.alert-dark {
background-color: $color-gray !important;
}
}

/* Tableaux */
$table-striped-bg-factor: black;
.table {
border: 0px none;
background-color: $color-gray !important;
color: black;
@include border-radius(0px !important);

&.table-striped > tbody > tr:nth-of-type(2n) > *,
thead tr th {
background-color: $color-gray;
}

&.table-striped > tbody > tr:nth-of-type(2n+1) > * {
background-color: #f8f7f3;
}

thead tr th,
tbody tr td {
@include box-shadow(-20px 0 20px -20px rgba(0,0,0,0.2) inset);

&:last-child {
@include box-shadow(none);
}
}

thead {
tr {
border: 0px none;
th {
border: 0px none;
padding: 10px 20px;
}
}
}

tbody {
tr {
border: 0px none;
td {
border: 0px none;
padding: 20px;
}
}
}
}
}

/* Formulaires */
form {
.control-label {
font-family: 'worksans_medium';
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
@include box-shadow(none);
@include border-radius(0px);
border: solid 1px $color-gray-dark;
}

.form-control:hover {
border: solid 1px gray;
}

.form-control:focus {
@include box-shadow(0px 0px 0px 1px $color-primary) ;
border: solid 1px $color-primary;
}

.has-error {
.control-label {
color: black;
}

.form-control:focus, .form-control {
@include box-shadow(none);
border-color: #a94442;
}

.help-block-error {
color: #a94442;
}
}

.form-buttons {
text-align: right;
}
}
}

/* Divers */
.float-left {
float: left;
}
@@ -54,6 +164,10 @@
float: right;
}

.clr {
clear: both;
}

/* Navigation utilisateur en haut du site */
.container-nav-user-top {
position: relative;

+ 2
- 1
common/web/sass/screen.scss Näytä tiedosto

@@ -36,8 +36,9 @@ termes.

$color-primary: #ee6f42;
$color-secondary: #e4ac07;
$color-gray: #ece4d8;
$color-gray-light: #f4efe8;
$color-gray: #ece4d8;
$color-gray-dark: #b7ab9b;

$dir-fonts: '../fonts/' ;


+ 8
- 7
domain/Payment/PaymentSolver.php Näytä tiedosto

@@ -58,15 +58,15 @@ class PaymentSolver extends AbstractService implements SolverInterface
$type = $payment->getType();

if (Payment::TYPE_INITIAL_CREDIT == $type) {
$str = 'Crédit initial';
$str = 'Crédit initial cagnotte';
} elseif (Payment::TYPE_CREDIT == $type) {
$str = 'Crédit';
$str = 'Crédit cagnotte';
} elseif (Payment::TYPE_PAYMENT == $type) {
$str = 'Débit';
$str = 'Paiement';
} elseif (Payment::TYPE_REFUND == $type) {
$str = 'Recrédit';
$str = 'Remboursement';
} elseif (Payment::TYPE_DEBIT == $type) {
$str = 'Débit';
$str = 'Débit cagnotte';
}

if (Payment::TYPE_PAYMENT == $type || Payment::TYPE_REFUND == $type) {
@@ -77,9 +77,10 @@ class PaymentSolver extends AbstractService implements SolverInterface
}

if ($order && $order->distribution) {
$str .= ' : commande du <a href="'.\Yii::$app->urlManager->createUrl(['distribution/index', 'date' => $order->distribution->date]).'">' . date('d/m/Y', strtotime($order->distribution->date)).'</a>';
//$str .= '<br /><small>commande du <a href="'.\Yii::$app->urlManager->createUrl(['distribution/index', 'date' => $order->distribution->date]).'">' . date('d/m/Y', strtotime($order->distribution->date)).'</a></small>';
$str .= '<br /><small>Commande du ' . date('d/m/Y', strtotime($order->distribution->date)).'</small>';
} else {
$str .= ' : commande supprimée';
$str .= '<br /><small>Commande supprimée</small>';
}
}


+ 5
- 0
domain/PointSale/PointSale/PointSaleRepository.php Näytä tiedosto

@@ -105,6 +105,11 @@ class PointSaleRepository extends AbstractRepository
->find();
}

public function countPointSalesPublic()
{
return $this->queryPointSalesPublic($this->getProducerContext())->count();
}

public function queryPointSalesPublic(Producer $producer)
{
return $this->createDefaultQuery()

+ 3
- 3
domain/PointSale/PointSale/PointSaleSolver.php Näytä tiedosto

@@ -107,14 +107,14 @@ class PointSaleSolver extends AbstractService implements SolverInterface

public function getLocalityWithAddressTooltip(PointSale $pointSale): string
{
$html = '';

$html = '<span class="locality">';
if($pointSale->address && strlen($pointSale->address) > 0) {
$html .= '<span data-toggle="tooltip" data-placement="bottom" title="'.Html::encode($pointSale->address).'">'.Html::encode($pointSale->locality).'</span>';
$html .= '<span data-bs-toggle="tooltip" data-bs-placement="bottom" title="'.Html::encode($pointSale->address).'">'.Html::encode($pointSale->locality).'</span>';
}
else {
$html .= Html::encode($pointSale->locality);
}
$html .= '</span>';

return $html;
}

+ 6
- 2
domain/Product/Product/ProductRepository.php Näytä tiedosto

@@ -58,9 +58,13 @@ class ProductRepository extends AbstractRepository
/**
* Retourne le nombre de produits du producteur courant.
*/
public function countProducts(): int
public function countProducts($isStatusOnline = false): int
{
return $this->createDefaultQuery()->count();
$query = $this->createDefaultQuery();
if($isStatusOnline) {
$query->filterIsStatusOnline();
}
return $query->count();
}

public function queryProductsByDistribution(Distribution $distribution, bool $filterStatus = true, string $orderBy = null)

+ 2
- 2
frontend/views/site/_prices_producer.php Näytä tiedosto

@@ -50,7 +50,7 @@ use yii\helpers\Html;
</h3>
</div>
<div class="panel-body">
<div class="alert alert-information" role="alert">
<div class="alert alert-dark" role="alert">
Découvrez ci-dessous la <strong>grille tarifaire</strong> pour l'hébergement de votre circuit court sur Souke.
Le montant qui vous est facturé mensuellement dépend de votre chiffre d’affaire hors taxe réalisé sur le logiciel.
Il est donc adapté chaque mois en fonction de l’évolution de votre activité. Le service est
@@ -99,7 +99,7 @@ use yii\helpers\Html;
</h3>
</div>
<div class="panel-body">
<div class="alert alert-information" role="alert">
<div class="alert alert-dark" role="alert">
Retrouvez ici les modules payants de Souke correspondant aux développements qui n'ont pas encore
été totalement financés et aux fonctionnalités nécessitant une configuration spécifique. Contactez-moi
pour demander l'activation d'un module.

+ 1
- 1
frontend/views/site/contact.php Näytä tiedosto

@@ -75,7 +75,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php ActiveForm::end(); ?>
</div>
<div class="col-md-4">
<div class="alert alert-information">
<div class="alert alert-dark">
Ce formulaire de contact vous permet de joindre le développeur de la plateforme Souke.
Si vous souhaitez joindre un producteur, merci de le faire directement depuis sa boutique.
</div>

+ 215
- 270
frontend/web/css/screen.css
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 1
frontend/web/sass/_responsive.scss Näytä tiedosto

@@ -224,7 +224,7 @@ termes.
padding: 0px;
}

.alert-information {
.alert-dark {
margin-top: 20px;
}
}

+ 0
- 49
frontend/web/sass/screen.scss Näytä tiedosto

@@ -72,10 +72,6 @@ strong {
font-weight: bold;
}

.table {
background-color: white;
}

.help-block {
padding-bottom: 5px;
}
@@ -115,51 +111,6 @@ strong {
}
}

#wrapper form {

.control-label {
font-family: 'worksans_medium';
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
@include box-shadow(none);
@include border-radius(0px);
border: solid 1px #e0e0e0;
}

.form-control:hover {
border: solid 1px gray;
}

.form-control:focus {
@include box-shadow(0px 0px 0px 1px $color-primary) ;
border: solid 1px $color-primary;
}

.has-error {
.control-label {
color: black;
}

.form-control:focus, .form-control {
@include box-shadow(none);
border-color: #a94442;
}

.help-block-error {
color: #a94442;
}
}
}

.form-buttons {
text-align: right;
}

p {
padding-bottom: 20px;
line-height: 21px;

+ 2
- 2
producer/controllers/NewsletterController.php Näytä tiedosto

@@ -68,7 +68,7 @@ class NewsletterController extends ProducerBaseController
$userModule = $this->getUserModule();
$userCurrent = $this->getUserCurrent();
$userModule->subscribeUserNewsletter($userCurrent);
$this->setFlash('success', "Votre inscription au bulletin d'information a bien été prise en compte.");
//$this->setFlash('success', "<i class=\"bi bi-check2-square\"></i> Votre inscription à l'infolettre a bien été prise en compte.");
return $this->redirect('index');
}

@@ -81,7 +81,7 @@ class NewsletterController extends ProducerBaseController
$userModule = $this->getUserModule();
$userCurrent = $this->getUserCurrent();
$userModule->unsubscribeUserNewsletter($userCurrent);
$this->setFlash('success', "À partir de maintenant, vous ne recevrez plus d'email de la part de ce producteur.");
//$this->setFlash('success', "<i class=\"bi bi-check2-square\"></i> Votre désinscription a bien été prise en compte, vous ne recevrez plus d'infolettre de la part de ce producteur.");
return $this->redirect('index');
}


+ 23
- 15
producer/controllers/SiteController.php Näytä tiedosto

@@ -83,22 +83,14 @@ class SiteController extends ProducerBaseController
}
}

/**
* Affiche la page d'accueil des producteurs comprenant une image, une
* description, la liste des points de vente et les produits.
*/
public function actionIndex()
{
$productModule = $this->getProductModule();
$pointSaleModule = $this->getPointSaleModule();
return $this->render('index');
}

$dataProviderPointsSale = new ActiveDataProvider([
'query' => $pointSaleModule->queryPointSalesPublic($this->getProducerCurrent()),
'pagination' => [
'pageSize' => 50,
],
'sort' => false,
]);
public function actionProducts()
{
$productModule = $this->getProductModule();

$productCategoryArray = $this->getProductCategoryModule()->findProductCategories();
$dataProviderProductsByCategories = [];
@@ -151,9 +143,8 @@ class SiteController extends ProducerBaseController
}
}

return $this->render('index', [
return $this->render('products', [
'dataProviderProductsByCategories' => $dataProviderProductsByCategories,
'dataProviderPointsSale' => $dataProviderPointsSale,
'dataProviderProducts' => $dataProviderProducts,
'hasProductPhoto' => $hasProductPhoto,
'hasProductWeight' => $hasProductWeight,
@@ -161,6 +152,23 @@ class SiteController extends ProducerBaseController
]);
}

public function actionPointsSale()
{
$pointSaleModule = $this->getPointSaleModule();

$dataProviderPointsSale = new ActiveDataProvider([
'query' => $pointSaleModule->queryPointSalesPublic($this->getProducerCurrent()),
'pagination' => [
'pageSize' => 50,
],
'sort' => false,
]);

return $this->render('points-sale', [
'dataProviderPointsSale' => $dataProviderPointsSale,
]);
}

public function filterProductsPublic($dataProviderProducts)
{
$productModule = $this->getProductModule();

+ 7
- 7
producer/views/credit/add.php Näytä tiedosto

@@ -43,14 +43,14 @@ use yii\widgets\ActiveForm;
$producerModule = ProducerModule::getInstance();
$producer = $this->context->getProducerCurrent();

$this->setTitle('Créditer mon compte');
$this->setPageTitle('Crédit mon compte');
$this->setTitle('Créditer ma cagnotte');
$this->setPageTitle('Crédit ma cagnotte');

$this->addButton(
[
'label' => 'Retour',
'label' => '<i class="bi bi-arrow-left-short"></i> Retour',
'url' => 'credit/history',
'class' => 'btn btn-default'
'class' => 'btn btn-secondary'
]
);

@@ -63,13 +63,13 @@ $this->addButton(
'enableAjaxValidation' => false,
]); ?>
<?= $form->field($creditForm, 'amount', [
'template' => '{label}<div class="input-group input-group-lg">{input}<span class="input-group-addon"><span class="glyphicon glyphicon-euro"></span></span></div>{hint}',
'template' => '{label}<div class="input-group input-group-lg">{input}<span class="input-group-text">€</span></div>{hint}{error}',
])
->label('Quel montant souhaitez-vous créditer ?')
->label('Quel montant souhaitez-vous créditer sur votre cagnotte ?')
->hint('Montant minimum : '.$producerModule->getOnlinePaymentMinimumAmount().' €'); ?>

<div class="form-group">
<?= Html::submitButton('<span class="glyphicon glyphicon-lock"></span> Payer', ['class' => 'btn btn-primary']
<?= Html::submitButton('<i class="bi bi-credit-card"></i> Payer', ['class' => 'btn btn-primary']
) ?>
</div>
<?php

+ 7
- 14
producer/views/credit/history.php Näytä tiedosto

@@ -44,13 +44,13 @@ use yii\grid\GridView;
$paymentManager = PaymentModule::getInstance();
$featureChecker = FeatureModule::getInstance()->getChecker();
$producer = $this->context->getProducerCurrent();
$this->setTitle('Crédit : <span id="credit-user">' . number_format($creditUser, 2) . ' €</span>');
$this->setTitle('Cagnotte : <span id="credit-user">' . number_format($creditUser, 2) . ' €</span>');
$this->setPageTitle('Crédit');

if ($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT) && $this->context->getProducerCurrent()->online_payment) {
$this->addButton(
[
'label' => '<span class="glyphicon glyphicon-credit-card"></span> Créditer mon compte',
'label' => '<i class="bi bi-credit-card"></i> Créditer ma cagnotte',
'url' => 'credit/add',
'class' => 'btn btn-primary'
]
@@ -68,12 +68,12 @@ if ($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT) && $this->context-
return $paymentManager->getDate($model, true);
}
],
[
/*[
'attribute' => 'id_user_action',
'value' => function ($model) use ($paymentManager) {
return $paymentManager->getStrUserAction($model);
}
],
],*/
[
'label' => 'Type',
'format' => 'raw',
@@ -88,21 +88,14 @@ if ($featureChecker->isEnabled(Feature::ALIAS_ONLINE_PAYMENT) && $this->context-
}
],
[
'label' => '- Débit',
'label' => 'Montant',
'format' => 'raw',
'value' => function ($model) use ($paymentManager) {
if ($paymentManager->isTypeDebit($model)) {
return '-&nbsp;' . $paymentManager->getAmount($model, true);
}
return '';
}
],
[
'label' => '+ Crédit',
'format' => 'raw',
'value' => function ($model) use ($paymentManager) {
if ($paymentManager->isTypeCredit($model)) {
return '+&nbsp;' . $paymentManager->getAmount($model, true);
elseif($paymentManager->isTypeCredit($model)) {
return '<span class="payment-positive">+&nbsp;' . $paymentManager->getAmount($model, true).'</span>';
}
return '';
}

+ 38
- 18
producer/views/layouts/main.php Näytä tiedosto

@@ -41,7 +41,9 @@ use common\helpers\Image;
use domain\Feature\Feature\Feature;
use domain\Feature\Feature\FeatureModule;
use domain\Order\Order\Order;
use domain\PointSale\PointSale\PointSaleModule;
use domain\Producer\Producer\ProducerModule;
use domain\Product\Product\ProductModule;
use domain\User\User\UserModule;
use domain\User\UserProducer\UserProducer;
use yii\bootstrap\Nav;
@@ -54,6 +56,8 @@ $userModule = UserModule::getInstance();
$userCurrent = GlobalParam::getCurrentUser();
$producerModule = ProducerModule::getInstance();
$featureModule = FeatureModule::getInstance();
$productModule = ProductModule::getInstance();
$pointSaleModule = PointSaleModule::getInstance();
$producerUser = null;
if ($userModule->getAuthorizationChecker()->isGrantedAsProducer($userCurrent)) {
$producerUser = $producerModule->findOneProducerById($userCurrent->id_producer);
@@ -82,17 +86,25 @@ $mainColor = $producer->option_main_color ?: '#ee6f42' ;
<?= $this->render('@common/views/matomo.php') ?>
<style>
#header #title h1,
#header #title h2 .location .bi {
#header #title h2 .location .bi,
#content a,
.credit-history #credit-user,
.credit-history #content .table span.payment-positive {
color: <?= $mainColor ?>
}
#header nav#main-nav ul li.active a,
#header nav#main-nav ul li a:hover,
#header nav#main-nav ul li a span.label-success {
background-color: <?= $mainColor ?>
#header nav#main-nav ul li a span.label-success,
#main .btn-primary {
background-color: <?= $mainColor ?>;
}
#header nav#main-nav {
border-top: solid 5px <?= $mainColor ?>;
}
#main form .form-control:focus {
box-shadow: 0px 0px 0px 1px <?= $mainColor ?>;
border: solid 1px <?= $mainColor ?>;
}
</style>
</head>
<body class="<?= \Yii::$app->controller->id . '-' . \Yii::$app->controller->action->id ?>">
@@ -174,6 +186,7 @@ $mainColor = $producer->option_main_color ?: '#ee6f42' ;
$labelOrders = $countOrders > 0 ? 'success' : 'default';

$isUserSubscribedNewsletter = $userModule->isUserSubscribedNewsletter($userCurrent);
$isHome = in_array($this->getControllerAction(), ['site/index', 'site/products', 'site/points-sale']);

echo Nav::widget([
'encodeLabels' => false,
@@ -182,7 +195,7 @@ $mainColor = $producer->option_main_color ?: '#ee6f42' ;
[
'url' => $this->getUrlManagerProducer()->createUrl(['site/index']),
'label' => '<i class="bi bi-house-door"></i>',
'active' => $this->getControllerAction() == 'site/index',
'active' => $isHome,
],
[
'label' => '<i class="bi bi-pencil-square"></i> Commander',
@@ -229,28 +242,35 @@ $mainColor = $producer->option_main_color ?: '#ee6f42' ;
],
]);


echo Nav::widget([
'encodeLabels' => false,
'options' => ['class' => 'submenu'],
'items' => [
$submenuItems = null;
if($isHome) {
$submenuItems = [
[
'url' => $this->getUrlManagerProducer()->createUrl(['site/index']),
'label' => 'Présentation',
'active' => $this->getControllerAction() == 'site/index',
'url' => $this->getUrlManagerProducer()->createUrl(['site/index']),
'label' => 'Présentation',
'active' => $this->getControllerAction() == 'site/index',
],
[
'url' => $this->getUrlManagerProducer()->createUrl(['site/index']),
'label' => 'Produits',
'url' => $this->getUrlManagerProducer()->createUrl(['site/products']),
'label' => 'Produits <span class="label label-default">'.$productModule->getRepository()->countProducts(true).'</span>',
'active' => $this->getControllerAction() == 'site/products',
],
[
'url' => $this->getUrlManagerProducer()->createUrl(['site/index']),
'label' => 'Points de vente',
'url' => $this->getUrlManagerProducer()->createUrl(['site/points-sale']),
'label' => 'Points de vente <span class="label label-default">'.$pointSaleModule->getRepository()->countPointSalesPublic().'</span>',
'active' => $this->getControllerAction() == 'site/points-sale',
],
]
]);
];
}

if($submenuItems) {
echo Nav::widget([
'encodeLabels' => false,
'options' => ['class' => 'submenu'],
'items' => $submenuItems
]);
}

?>

</nav>

+ 27
- 19
producer/views/newsletter/index.php Näytä tiedosto

@@ -41,31 +41,39 @@ use yii\helpers\Html;

$userModule = UserModule::getInstance();

$this->setTitle("Bulletin d'information");
$this->setTitle("Infolettre");

if($userModule->isUserSubscribedNewsletter($user)) {
$this->addButton(
[
'label' => '<i class="bi bi-x-circle"></i> Me désinscrire',
'url' => 'newsletter/unsubscribe',
'class' => 'btn btn-secondary'
]
);
}
else {
$this->addButton(
[
'label' => '<i class="bi bi-megaphone"></i> M\'inscrire',
'url' => 'newsletter/subscribe',
'class' => 'btn btn-primary'
]
);
}


?>
<div class="newsletter-index">
<?php if($userModule->isUserSubscribedNewsletter($user)): ?>
<div class="panel panel-default">
<div class="panel-body">
Vous êtes inscrit au bulletin d'information <strong><?= Html::encode($producer->name) ?></strong>.
</div>
<div class="alert alert-success">
<i class="bi bi-megaphone"></i>
Vous êtes inscrit à l'infolettre <strong><?= Html::encode($producer->name) ?></strong>.
</div>
<p>
<a class="btn btn-danger" href="<?= $this->getUrlManagerProducer()->createUrl(['newsletter/unsubscribe']) ?>">
Me désinscrire
</a>
</p>
<?php else: ?>
<div class="panel panel-default">
<div class="panel-body">
Vous n'êtes pas inscrit au bulletin d'information <strong><?= Html::encode($producer->name) ?></strong>.
</div>
<div class="alert alert-danger">
<i class="bi bi-x-circle"></i>
Vous n'êtes pas inscrit à l'infolettre <strong><?= Html::encode($producer->name) ?></strong>.
</div>
<p>
<a class="btn btn-success" href="<?= $this->getUrlManagerProducer()->createUrl(['newsletter/subscribe']) ?>">
M'inscrire
</a>
</p>
<?php endif; ?>
</div>

+ 3
- 3
producer/views/site/contact.php Näytä tiedosto

@@ -55,8 +55,8 @@ $this->setTitle('Contact');
'template' => '<div class="row"><div class="col-md-12">{image}</div><div class="col-md-12">{input}</div></div>',
]); ?>
<?= $form->field($model, 'isTest')->hiddenInput() ?>
<div class="form-group">
<?= Html::submitButton('Envoyer', ['class' => 'btn btn-primary', 'name' => 'contact-button']) ?>
<div class="form-group form-buttons">
<?= Html::submitButton('<i class="bi bi-send"></i> Envoyer', ['class' => 'btn btn-primary', 'name' => 'contact-button']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>
@@ -64,7 +64,7 @@ $this->setTitle('Contact');
<?php if($producer->website): ?>
<br />
<a href="<?= Html::encode($producer->website); ?>" target="_blank" class="btn btn-default">
<span class="glyphicon glyphicon-globe"></span>
<i class="bi bi-globe"></i>
Site web
</a>
<?php endif; ?>

+ 2
- 162
producer/views/site/index.php Näytä tiedosto

@@ -58,171 +58,11 @@ $this->setPageTitle(Html::encode($producer->type . ' à ' . $producer->city));

?>

<section id="presentation">
<div id="presentation">
<?php if (strlen($producer->description)): ?>
<div class="description">
<?= $producer->description; ?>
</div>
<?php endif; ?>
<div class="clr"></div>
</section>

<!--
<section id="points-sale">
<h3><span><?= $producerModule->getPointSaleWording($producer); ?></span></h3>
<?= GridView::widget([
'dataProvider' => $dataProviderPointsSale,
'summary' => '',
'columns' => [
[
'attribute' => 'name',
'format' => 'raw',
'contentOptions' => ['class' => 'name'],
'value' => function ($model) use ($pointSaleModule) {
$html = '<span class="the-name">' . Html::encode($model->name) . '</span>';
if (strlen($model->locality)) {
$html .= '<br />à ' . $pointSaleModule->getSolver()->getLocalityWithAddressTooltip($model);
}
return $html;
}
],
[
'label' => 'Jours de livraison',
'format' => 'raw',
'contentOptions' => ['class' => 'days'],
'value' => function ($model) use ($distributionModule) {

$producer = \Yii::$app->controller->getProducerCurrent();

if ($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK) {
$arrayDays = [
'monday' => 'Lundi',
'tuesday' => 'Mardi',
'wednesday' => 'Mercredi',
'thursday' => 'Jeudi',
'friday' => 'Vendredi',
'saturday' => 'Samedi',
'sunday' => 'Dimanche'
];

$html = '';
foreach ($arrayDays as $dayEn => $dayFr) {
$fieldDelivery = 'delivery_' . $dayEn;
$fieldInfos = 'infos_' . $dayEn;

if ($model->$fieldDelivery) {
$html .= '<strong>' . $dayFr . '</strong>';
if (strlen($model->$fieldInfos)) {
$html .= ' / <small>' . nl2br(str_replace(['[select_previous_day]', '[/select_previous_day]'], '', $model->$fieldInfos)) . '</small>';
}
$html .= '<br />';
}
}

return $html;
} elseif ($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS) {
$html = '';
$incomingDistributions = $distributionModule->findDistributionsIncoming();
$cpt = 0;
foreach ($incomingDistributions as $distribution) {
$countPointSaleDistribution = PointSaleDistribution::searchCount([
'id_distribution' => $distribution->id,
'id_point_sale' => $model->id,
'delivery' => 1
]);
if ($countPointSaleDistribution) {
$html .= strftime('%A %d %B', strtotime($distribution->date)) . '<br />';
}

$cpt++;
}
return $html;
}
}
]
],
]); ?>
</section>


<section id="products">
<h3><span>Produits</span></h3>

<?php
$columnsProducts = [];
if ($hasProductPhoto) {
$columnsProducts [] = [
'attribute' => 'photo',
'format' => 'raw',
'headerOptions' => ['class' => 'photo'],
'contentOptions' => ['class' => 'photo'],
'value' => function ($model) {
if (strlen($model->photo)) {
return '<a class="product-photo" href="'.Image::getThumbnailBig($model->photo).'" title="'.Html::encode($model->name).'"><img class="photo-product" src="'. Image::getThumbnailSmall($model->photo).'" />';
}
return '';
}
];
}

$columnsProducts[] = [
'attribute' => 'name',
'format' => 'raw',
'contentOptions' => ['class' => 'name product-name-description-block'],
'value' => function ($model) {
$html = '<div class="name">' . Html::encode($model->name) . '</div>';
if (strlen($model->description)) {
$html .= '<div class="description">' . Html::encode($model->description).'</div>';
}
if (strlen($model->recipe)) {
$html .= '<div class="description-long"><a href="javascript:void(0);" class="show-more-link">En savoir plus</a><div class="content">' . nl2br(Html::encode($model->recipe)).'</div></div>';
}
return $html;
}
];

if ($hasProductWeight) {
$columnsProducts[] = [
'attribute' => 'weight',
'format' => 'raw',
'value' => function ($model) {
if (strlen($model->weight)) {
return $model->weight . '&nbsp;g';
}
return '';
}
];
}

$columnsProducts[] = [
'attribute' => 'price',
'value' => function ($model) use ($productModule) {
if ($model->price) {
return Price::format($productModule->getPriceWithTax($model)) . ' (' . $productModule->getSolver()->strUnit($model, 'wording_unit', true) . ')';
}
return '';
}
];
?>

<?php if ($dataProviderProducts->query->count()) : ?>
<?= GridView::widget([
'dataProvider' => $dataProviderProducts,
'summary' => '',
'columns' => $columnsProducts
]); ?>
<?php endif; ?>

<?php foreach ($categories as $category): ?>
<?php if ($dataProviderProductsByCategories[$category->id]->query->count()): ?>
<h4><?= Html::encode($category->name) ?></h4>
<?= GridView::widget([
'dataProvider' => $dataProviderProductsByCategories[$category->id],
'summary' => '',
'columns' => $columnsProducts
]); ?>
<?php endif; ?>
<?php endforeach; ?>
</section>

-->
</div>

+ 135
- 0
producer/views/site/points-sale.php Näytä tiedosto

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

/**
* Copyright distrib (2018)
*
* contact@opendistrib.net
*
* Ce logiciel est un programme informatique servant à aider les producteurs
* à distribuer leur production en circuits courts.
*
* Ce logiciel est régi par la licence CeCILL soumise au droit français et
* respectant les principes de diffusion des logiciels libres. Vous pouvez
* utiliser, modifier et/ou redistribuer ce programme sous les conditions
* de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
* sur le site "http://www.cecill.info".
*
* En contrepartie de l'accessibilité au code source et des droits de copie,
* de modification et de redistribution accordés par cette licence, il n'est
* offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
* seule une responsabilité restreinte pèse sur l'auteur du programme, le
* titulaire des droits patrimoniaux et les concédants successifs.
*
* A cet égard l'attention de l'utilisateur est attirée sur les risques
* associés au chargement, à l'utilisation, à la modification et/ou au
* développement et à la reproduction du logiciel par l'utilisateur étant
* donné sa spécificité de logiciel libre, qui peut le rendre complexe à
* manipuler et qui le réserve donc à des développeurs et des professionnels
* avertis possédant des connaissances informatiques approfondies. Les
* utilisateurs sont donc invités à charger et tester l'adéquation du
* logiciel à leurs besoins dans des conditions permettant d'assurer la
* sécurité de leurs systèmes et ou de leurs données et, plus généralement,
* à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
*
* Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
* pris connaissance de la licence CeCILL, et que vous en avez accepté les
* termes.
*/

use common\helpers\Image;
use common\helpers\Price;
use domain\Distribution\Distribution\DistributionModule;
use domain\Distribution\PointSaleDistribution\PointSaleDistribution;
use domain\PointSale\PointSale\PointSaleModule;
use domain\Producer\Producer\Producer;
use domain\Producer\Producer\ProducerModule;
use domain\Product\Product\ProductModule;
use yii\grid\GridView;
use yii\helpers\Html;

$productModule = ProductModule::getInstance();
$producerModule = ProducerModule::getInstance();
$distributionModule = DistributionModule::getInstance();
$pointSaleModule = PointSaleModule::getInstance();

$producer = $this->context->getProducerCurrent();

$this->setTitle('Points de vente');
$this->setPageTitle('Points de vente');

?>

<div id="points-sale">
<?= GridView::widget([
'dataProvider' => $dataProviderPointsSale,
'summary' => '',
'columns' => [
[
'attribute' => 'name',
'format' => 'raw',
'contentOptions' => ['class' => 'name'],
'value' => function ($model) use ($pointSaleModule) {
$html = '<span class="the-name">' . Html::encode($model->name) . '</span>';
if (strlen($model->locality)) {
$html .= '<br />' . $pointSaleModule->getSolver()->getLocalityWithAddressTooltip($model);
}
return $html;
}
],
[
'label' => 'Informations',
'format' => 'raw',
'contentOptions' => ['class' => 'days'],
'value' => function ($model) use ($distributionModule) {

$producer = \Yii::$app->controller->getProducerCurrent();

if ($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK) {
$arrayDays = [
'monday' => 'Lundi',
'tuesday' => 'Mardi',
'wednesday' => 'Mercredi',
'thursday' => 'Jeudi',
'friday' => 'Vendredi',
'saturday' => 'Samedi',
'sunday' => 'Dimanche'
];

$html = '';
foreach ($arrayDays as $dayEn => $dayFr) {
$fieldDelivery = 'delivery_' . $dayEn;
$fieldInfos = 'infos_' . $dayEn;

if ($model->$fieldDelivery) {
$html .= '<div class="block-day"><strong>' . $dayFr . '</strong>';
if (strlen($model->$fieldInfos)) {
$html .= '<br /><small>' . nl2br(str_replace(['[select_previous_day]', '[/select_previous_day]'], '', $model->$fieldInfos)) . '</small>';
}
$html .= '</div>';
}
}

return $html;
} elseif ($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS) {
$html = '';
$incomingDistributions = $distributionModule->findDistributionsIncoming();
$cpt = 0;
foreach ($incomingDistributions as $distribution) {
$countPointSaleDistribution = PointSaleDistribution::searchCount([
'id_distribution' => $distribution->id,
'id_point_sale' => $model->id,
'delivery' => 1
]);
if ($countPointSaleDistribution) {
$html .= strftime('%A %d %B', strtotime($distribution->date)) . '<br />';
}

$cpt++;
}
return $html;
}
}
]
],
]); ?>
</div>

+ 139
- 0
producer/views/site/products.php Näytä tiedosto

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

/**
* Copyright distrib (2018)
*
* contact@opendistrib.net
*
* Ce logiciel est un programme informatique servant à aider les producteurs
* à distribuer leur production en circuits courts.
*
* Ce logiciel est régi par la licence CeCILL soumise au droit français et
* respectant les principes de diffusion des logiciels libres. Vous pouvez
* utiliser, modifier et/ou redistribuer ce programme sous les conditions
* de la licence CeCILL telle que diffusée par le CEA, le CNRS et l'INRIA
* sur le site "http://www.cecill.info".
*
* En contrepartie de l'accessibilité au code source et des droits de copie,
* de modification et de redistribution accordés par cette licence, il n'est
* offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons,
* seule une responsabilité restreinte pèse sur l'auteur du programme, le
* titulaire des droits patrimoniaux et les concédants successifs.
*
* A cet égard l'attention de l'utilisateur est attirée sur les risques
* associés au chargement, à l'utilisation, à la modification et/ou au
* développement et à la reproduction du logiciel par l'utilisateur étant
* donné sa spécificité de logiciel libre, qui peut le rendre complexe à
* manipuler et qui le réserve donc à des développeurs et des professionnels
* avertis possédant des connaissances informatiques approfondies. Les
* utilisateurs sont donc invités à charger et tester l'adéquation du
* logiciel à leurs besoins dans des conditions permettant d'assurer la
* sécurité de leurs systèmes et ou de leurs données et, plus généralement,
* à l'utiliser et l'exploiter dans les mêmes conditions de sécurité.
*
* Le fait que vous puissiez accéder à cet en-tête signifie que vous avez
* pris connaissance de la licence CeCILL, et que vous en avez accepté les
* termes.
*/

use common\helpers\Image;
use common\helpers\Price;
use domain\Distribution\Distribution\DistributionModule;
use domain\Distribution\PointSaleDistribution\PointSaleDistribution;
use domain\PointSale\PointSale\PointSaleModule;
use domain\Producer\Producer\Producer;
use domain\Producer\Producer\ProducerModule;
use domain\Product\Product\ProductModule;
use yii\grid\GridView;
use yii\helpers\Html;

$productModule = ProductModule::getInstance();
$producerModule = ProducerModule::getInstance();
$distributionModule = DistributionModule::getInstance();
$pointSaleModule = PointSaleModule::getInstance();

$producer = $this->context->getProducerCurrent();

$this->setTitle('Produits');
$this->setPageTitle('Produits');

?>

<div id="products">
<?php
$columnsProducts = [];
if ($hasProductPhoto) {
$columnsProducts [] = [
'attribute' => 'photo',
'format' => 'raw',
'headerOptions' => ['class' => 'photo'],
'contentOptions' => ['class' => 'photo'],
'value' => function ($model) {
if (strlen($model->photo)) {
return '<a class="product-photo" href="'.Image::getThumbnailBig($model->photo).'" title="'.Html::encode($model->name).'"><img class="photo-product" src="'. Image::getThumbnailSmall($model->photo).'" />';
}
return '';
}
];
}

$columnsProducts[] = [
'attribute' => 'name',
'format' => 'raw',
'contentOptions' => ['class' => 'name product-name-description-block'],
'value' => function ($model) {
$html = '<div class="name">' . Html::encode($model->name) . '</div>';
if (strlen($model->description)) {
$html .= '<div class="description">' . Html::encode($model->description).'</div>';
}
if (strlen($model->recipe)) {
$html .= '<div class="description-long"><a href="javascript:void(0);" class="show-more-link">En savoir plus</a><div class="content">' . nl2br(Html::encode($model->recipe)).'</div></div>';
}
return $html;
}
];

if ($hasProductWeight) {
$columnsProducts[] = [
'attribute' => 'weight',
'format' => 'raw',
'value' => function ($model) {
if (strlen($model->weight)) {
return $model->weight . '&nbsp;g';
}
return '';
}
];
}

$columnsProducts[] = [
'attribute' => 'price',
'format' => 'raw',
'value' => function ($model) use ($productModule) {
if ($model->price) {
return Price::format($productModule->getPriceWithTax($model)) . '<br /><small>' . $productModule->getSolver()->strUnit($model, 'wording_unit', true) . '</small>';
}
return '';
}
];
?>

<?php if ($dataProviderProducts->query->count()) : ?>
<?= GridView::widget([
'dataProvider' => $dataProviderProducts,
'summary' => '',
'columns' => $columnsProducts
]); ?>
<?php endif; ?>

<?php foreach ($categories as $category): ?>
<?php if ($dataProviderProductsByCategories[$category->id]->query->count()): ?>
<h4><?= Html::encode($category->name) ?></h4>
<?= GridView::widget([
'dataProvider' => $dataProviderProductsByCategories[$category->id],
'summary' => '',
'columns' => $columnsProducts
]); ?>
<?php endif; ?>
<?php endforeach; ?>
</div>

+ 204
- 235
producer/web/css/screen.css
File diff suppressed because it is too large
Näytä tiedosto


+ 12
- 32
producer/web/sass/_layout.scss Näytä tiedosto

@@ -37,7 +37,7 @@ termes.

body {
background-color: $color-gray-light !important;
font-family: 'worksans_regular' ;
font-family: 'worksans_regular' !important;
color: #333 ;
line-height: 20px ;
font-size: 14px ;
@@ -48,6 +48,7 @@ body {
}

.panel {
margin-bottom: 30px;
strong {
font-weight: bold;
}
@@ -65,27 +66,6 @@ body {

#main {
position: relative ;

.btn {
@include border-radius(0px);
}

.btn-primary {
background-color: $color-primary ;
border: solid 1px $color-primary ;
color: white ;

&:hover, &:active, &:focus {
background-color: darken($color-primary, 5) ;
border: solid 1px $color-primary;
color: white ;
}
}
}


.btn {
background-image: none ;
}

#main .alert {
@@ -138,15 +118,14 @@ ul.pagination {

.product-name-description-block {
.name {
font-family: 'capsuularegular' ;
font-family: 'worksans_semibold' ;
color: black ;
font-size: 20px ;
line-height: 25px ;
font-weight: bold;
font-size: 1.4em ;
line-height: 1.6em ;
}

.other {
font-family: 'capsuularegular' ;
font-family: 'worksans_regular' ;
color: black ;
font-weight: bold;
font-size: 17px ;
@@ -158,9 +137,6 @@ ul.pagination {
}

.description-long {
a {
color: $color-primary;
}
.content {
display: none;
}
@@ -285,6 +261,12 @@ ul.pagination {
font-size: 0.9em;
@include box-shadow(none);
border-bottom: solid 2px $color-gray-light;

span.label {
background-color: white;
border: solid 1px $color-gray-dark;
color: $color-gray-dark;
}
}

&.active a,
@@ -324,7 +306,6 @@ ul.pagination {
padding: 5px 10px ;
margin-bottom: 0px ;
font-size: 16px ;
font-family: 'capsuularegular' ;
background-color: white ;
border-bottom: solid 1px #e0e0e0 ;
color: gray ;
@@ -435,7 +416,6 @@ ul.pagination {

a {
color: black ;
font-family: 'capsuularegular' ;
font-size: 18px ;
padding-left: 10px ;
padding-right: 10px ;

+ 2
- 9
producer/web/sass/credit/_add.scss Näytä tiedosto

@@ -1,13 +1,12 @@

.credit-add {
.form {
max-width: 350px ;
margin: 0px auto ;
width: 300px ;
margin-top: 30px;
text-align: center ;

.form-group.field-creditform-amount {
text-align: center ;
//text-align: center ;
margin-bottom: 30px;

label {
@@ -19,15 +18,9 @@
.input-group {
width: 150px;
margin: 0px auto;
//display: inline-block;

input#creditform-amount {
text-align: center;

&:focus {
@include box-shadow(none);
border-color: #ccc;
}
}
}


+ 17
- 0
producer/web/sass/credit/_history.scss Näytä tiedosto

@@ -0,0 +1,17 @@

.credit-history {
#content {
.table {
span.payment-positive {
display: inline-block;
font-family: 'worksans_bold';
padding: 3px 12px;
background-color: $color-gray-light;
@include border-radius(15px);
}
small {
color: gray;
}
}
}
}

+ 0
- 1
producer/web/sass/order/_confirm.scss Näytä tiedosto

@@ -56,7 +56,6 @@
margin-left: 151px ;

h3 {
font-family: 'capsuularegular' ;
font-size: 30px ;
color: #333 ;
margin-bottom: 20px ;

+ 0
- 7
producer/web/sass/order/_order.scss Näytä tiedosto

@@ -54,7 +54,6 @@
width: 100% ;
text-transform: normal ;
color: $color-primary ;
font-family: 'capsuularegular' ;
font-size: 17px ;
font-weight: bold ;
}
@@ -218,7 +217,6 @@
table#points-sale {
td.name {
.the-name {
font-family: 'capsuularegular' ;
color: black ;
font-size: 20px ;
line-height: 25px ;
@@ -264,7 +262,6 @@
}

span.label {
//font-family: 'capsuularegular' ;
font-family: 'Arial' ;
font-weight: normal ;
float: right ;
@@ -337,7 +334,6 @@
.summary {
h3 {
margin-top: 0px ;
font-family: 'capsuularegular' ;
text-transform: none ;
margin-bottom: 5px ;
}
@@ -354,12 +350,9 @@
}

.name {
font-family: 'capsuularegular' ;
font-size: 24px ;
}
.other {
//font-family: 'arial' ;
font-family: 'capsuularegular' ;
font-size: 18px ;
}
}

+ 2
- 0
producer/web/sass/screen.scss Näytä tiedosto

@@ -44,6 +44,8 @@ $color-text: black;
@import "compass";
@import "_layout.scss";
@import "site/_index.scss";
@import "site/_products.scss";
@import "site/_points_sale.scss";
@import "site/_credit_history.scss";
@import "site/_contact.scss";
@import "order/_form.scss";

+ 1
- 1
producer/web/sass/site/_credit_history.scss Näytä tiedosto

@@ -1,5 +1,5 @@

.site-credit-history {
.credit-history {
#credit-user {
color: $color-primary;
font-size: 29px ;

+ 1
- 59
producer/web/sass/site/_index.scss Näytä tiedosto

@@ -36,16 +36,11 @@ termes.
*/

.site-index {
#order {
margin-bottom: 40px ;
text-align: center ;
}
#presentation {
.photo {
text-align: center ;
.img-photo {
width: 100% ;
width: 100% ;
max-width: 500px ;
}
}
@@ -65,57 +60,4 @@ termes.
}
}
}
#points-sale {
.name {
color: #333 ;
.the-name {
font-family: 'capsuularegular' ;
font-size: 20px ;
color: black ;
}
}
.days {
strong {

}
small {
color: gray ;
//font-size: 14px ;
}
}
}
#products {

h4 {
font-family: "worksans_bold" ;
font-size: 22px ;
line-height: 30px ;
padding-top: 13px ;
text-transform: uppercase !important ;
}

td.photo {
width: 100px ;
img.photo-product {
width: 120px ;
height: auto ;
}
}
.name {
color: #333 ;
.the-name {
font-family: 'capsuularegular' ;
font-size: 20px ;
color: black ;
}
.recipe {
}
}
}
}

+ 28
- 0
producer/web/sass/site/_points_sale.scss Näytä tiedosto

@@ -0,0 +1,28 @@

.site-points-sale {
#points-sale {
.name {
.the-name {
font-family: 'worksans_semibold';
font-size: 20px ;
color: black ;
}
.locality {
color: gray;
}
}
.days {
.block-day {
&:not(:last-child) {
margin-bottom: 15px;
}
strong {
font-family: 'worksans_medium';
}
small {
color: gray ;
}
}
}
}
}

+ 16
- 0
producer/web/sass/site/_products.scss Näytä tiedosto

@@ -0,0 +1,16 @@

.site-products {
#products {
td.photo {
width: 100px ;
img.photo-product {
width: 120px ;
height: auto ;
}
}

small {
color: gray;
}
}
}

+ 0
- 2
producer/web/sass/subscription/_form.scss Näytä tiedosto

@@ -34,7 +34,6 @@
}
.the-name {
font-family: 'capsuularegular' ;
font-size: 20px ;
color: black ;
}
@@ -94,7 +93,6 @@
}
.name {
font-family: "capsuularegular" ;
font-size: 20px ;
color: black ;
}

Loading…
Peruuta
Tallenna