Bladeren bron

Refactoring/traduction vues backend/views/product

refactoring
Guillaume Bourgeois 6 jaren geleden
bovenliggende
commit
e2357dfbb9
4 gewijzigde bestanden met toevoegingen van 24 en 34 verwijderingen
  1. +16
    -26
      backend/views/product/_form.php
  2. +1
    -1
      backend/views/product/create.php
  3. +6
    -6
      backend/views/product/index.php
  4. +1
    -1
      backend/views/product/update.php

backend/views/produit/_form.php → backend/views/product/_form.php Bestand weergeven

@@ -44,17 +44,17 @@ use yii\widgets\ActiveForm;
/* @var $form yii\widgets\ActiveForm */
?>

<div class="produit-form">
<div class="product-form">

<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?>

<?= $form->field($model, 'actif')->radioList([1 => 'Oui',0 => 'Non' ]) ?>
<?= $form->field($model, 'nom')->textInput(['maxlength' => 255]) ?>
<?= $form->field($model, 'active')->radioList([1 => 'Oui',0 => 'Non' ]) ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?>
<?= $form->field($model, 'description')->textInput(['maxlength' => 255]) ?>
<?= $form->field($model, 'recette')->textarea() ?>
<?= $form->field($model, 'prix')->textInput() ?>
<?= $form->field($model, 'poids')->textInput() ?>
<?= $form->field($model, 'quantite_max')
<?= $form->field($model, 'recipe')->textarea() ?>
<?= $form->field($model, 'price')->textInput() ?>
<?= $form->field($model, 'weight')->textInput() ?>
<?= $form->field($model, 'quantity_max')
->hint('Renseignez ce champs si vous souhaitez limiter la quantité commandable pour ce produit.')
->textInput() ?>
@@ -66,29 +66,19 @@ use yii\widgets\ActiveForm;
}
?>
<?php if(Yii::$app->user->identity->id_etablissement == 1): ?>
<?= $form->field($model, 'illustration')->fileInput() ?>
<?php
if(strlen($model->illustration)) {
echo '<img src="../../frontend/web/uploads/'.$model->illustration.'" width="200px" /><br />' ;
echo '<input type="checkbox" name="delete_illustration" id="delete_illustration" /> <label for="delete_illustration">Supprimer l\'illustration</label><br /><br />' ;
}
?>
<?php endif; ?>
<h2>Jours de production</h2>
<div id="jours-production">
<?= $form->field($model, 'lundi')->checkbox() ?>
<?= $form->field($model, 'mardi')->checkbox() ?>
<?= $form->field($model, 'mercredi')->checkbox() ?>
<?= $form->field($model, 'jeudi')->checkbox() ?>
<?= $form->field($model, 'vendredi')->checkbox() ?>
<?= $form->field($model, 'samedi')->checkbox() ?>
<?= $form->field($model, 'dimanche')->checkbox() ?>
<div id="days-production">
<?= $form->field($model, 'monday')->checkbox() ?>
<?= $form->field($model, 'tuesday')->checkbox() ?>
<?= $form->field($model, 'wednesday')->checkbox() ?>
<?= $form->field($model, 'thursday')->checkbox() ?>
<?= $form->field($model, 'friday')->checkbox() ?>
<?= $form->field($model, 'saterday')->checkbox() ?>
<?= $form->field($model, 'sunday')->checkbox() ?>
</div>
<div class="clr"></div>
<?= $form->field($model, 'id_etablissement')->hiddenInput()->label('') ?>
<?= $form->field($model, 'id_producer')->hiddenInput()->label('') ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? 'Ajouter' : 'Modifier', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

backend/views/produit/create.php → backend/views/product/create.php Bestand weergeven

@@ -46,7 +46,7 @@ $this->title = 'Ajouter un produit';
$this->params['breadcrumbs'][] = ['label' => 'Produits', 'url' => ['index']];
$this->params['breadcrumbs'][] = 'Ajouter';
?>
<div class="produit-create">
<div class="product-create">

<h1><?= Html::encode($this->title) ?></h1>


backend/views/produit/index.php → backend/views/product/index.php Bestand weergeven

@@ -46,7 +46,7 @@ use common\helpers\Url ;
$this->title = 'Produits';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="produit-index">
<div class="product-index">

<h1><?= Html::encode($this->title) ?> <?= Html::a('Ajouter', ['create'], ['class' => 'btn btn-success']) ?></h1>

@@ -67,21 +67,21 @@ $this->params['breadcrumbs'][] = $this->title;
'headerOptions' => ['class' => 'td-photo'],
'value' => function($model) {
if(strlen($model->photo)) {
$url = Url::frontend() ;
$url = Yii::$app->urlManagerProducer->getBaseUrl() ;
return '<img class="photo-produit" src="'.$url.'uploads/'.$model->photo.'" />' ;
}
return '' ;
}
],
'nom',
'name',
'description',
[
'attribute' => 'actif',
'headerOptions' => ['class' => 'actif'],
'attribute' => 'active',
'headerOptions' => ['class' => 'active'],
'contentOptions' => ['class' => 'center'],
'format' => 'raw',
'value' => function($model) {
if($model->actif)
if($model->active)
{
return '<span class="label label-success">oui</span>' ;
}

backend/views/produit/update.php → backend/views/product/update.php Bestand weergeven

@@ -46,7 +46,7 @@ $this->params['breadcrumbs'][] = ['label' => 'Produits', 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->nom, 'url' => ['update', 'id' => $model->id]];
$this->params['breadcrumbs'][] = 'Modifier';
?>
<div class="produit-update">
<div class="product-update">

<h1><?= Html::encode($this->title) ?></h1>


Laden…
Annuleren
Opslaan