Bläddra i källkod

Refactoring/traduction vues producer/views/layouts

refactoring
Guillaume Bourgeois 6 år sedan
förälder
incheckning
10ec3b5bd1
1 ändrade filer med 19 tillägg och 19 borttagningar
  1. +19
    -19
      producer/views/layouts/main.php

+ 19
- 19
producer/views/layouts/main.php Visa fil

@@ -51,7 +51,7 @@ $producer = $this->context->getProducer() ;
<?php $this->beginPage() ?>
<!DOCTYPE html>
<head>
<title><?= Html::encode($producer->nom); ?> &bull; <?= $this->getPageTitle(); ?></title>
<title><?= Html::encode($producer->name); ?> &bull; <?= $this->getPageTitle(); ?></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="base-url" content="<?= Yii::$app->urlManager->baseUrl ; ?>">
@@ -84,7 +84,7 @@ $producer = $this->context->getProducer() ;
'visible' => Yii::$app->user->isGuest
],
[
'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))) : '').'. ',
'label' => '<span class="glyphicon glyphicon-user"></span> '.((!Yii::$app->user->isGuest) ? Html::encode(Yii::$app->user->identity->name .' '.strtoupper(substr(Yii::$app->user->identity->lastname, 0, 1))) : '').'. ',
'options' => ['id' => 'label1'],
'url' => '#',
'items' => [
@@ -108,15 +108,15 @@ $producer = $this->context->getProducer() ;
<header id="header">
<div class="container">
<h1><?= Html::encode($producer->nom); ?> <span>/ <?= Html::encode($producer->type) ?> à <?= Html::encode($producer->ville); ?> (<?= Html::encode($producer->code_postal); ?>)</span></h1>
<h1><?= Html::encode($producer->name); ?> <span>/ <?= Html::encode($producer->type) ?> à <?= Html::encode($producer->city); ?> (<?= Html::encode($producer->postcode); ?>)</span></h1>
<?php if(!Yii::$app->user->isGuest): ?>
<?php
$user_etablissement = UserEtablissement::findOne(['id_user' => Yii::$app->user->identity->id, 'id_etablissement' => $producer->id ]) ;
if($user_etablissement):
$userProducer = UserProducer::findOne(['id_user' => User::getId(), 'id_producer' => $producer->id ]) ;
if($userProducer):
?>
<div id="credit">
<span class="info"><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl('site/creditpain'); ?>"><span class="text">Crédit </span><span class="glyphicon glyphicon-info-sign"></span></a></span>
<span id="the-credit"><?= number_format($user_etablissement->credit, 2); ?> €</span>
<span class="info"><a href="<?= Yii::$app->urlManagerFrontend->createAbsoluteUrl('site/credit'); ?>"><span class="text">Crédit </span><span class="glyphicon glyphicon-info-sign"></span></a></span>
<span id="the-credit"><?= number_format($userProducer->credit, 2); ?> €</span>
</div>
<?php endif; ?>
<?php endif; ?>
@@ -124,14 +124,14 @@ $producer = $this->context->getProducer() ;
<div id="infos">
<span data-toggle="tooltip" data-placement="bottom" title="Heure limite de commande">
<span class="glyphicon glyphicon-time"></span> Commande avant
<strong><?php echo Html::encode($producer->heure_limite_commande) ?> h</strong></span>,
<span data-toggle="tooltip" data-placement="bottom" title="Exemple : commande le lundi pour le <?php if($producer->delai_commande == 1): ?>mardi<?php elseif($producer->delai_commande == 2): ?>mercredi<?php elseif($producer->delai_commande == 3): ?>jeudi<?php elseif($producer->delai_commande == 4): ?>vendredi<?php elseif($producer->delai_commande == 5): ?>samedi<?php elseif($producer->delai_commande == 6): ?>dimanche<?php elseif($producer->delai_commande == 7): ?>lundi d'après<?php endif; ?>"><strong><?= Html::encode($producer->delai_commande) ?> jour<?php if($producer->delai_commande > 1): ?>s<?php endif; ?></strong> à l'avance</span>
<strong><?php echo Html::encode($producer->order_deadline) ?> h</strong></span>,
<span data-toggle="tooltip" data-placement="bottom" title="Exemple : commande le lundi pour le <?php if($producer->order_delay == 1): ?>mardi<?php elseif($producer->order_delay == 2): ?>mercredi<?php elseif($producer->order_delay == 3): ?>jeudi<?php elseif($producer->order_delay == 4): ?>vendredi<?php elseif($producer->order_delay == 5): ?>samedi<?php elseif($producer->order_delay == 6): ?>dimanche<?php elseif($producer->order_delay == 7): ?>lundi d'après<?php endif; ?>"><strong><?= Html::encode($producer->order_delay) ?> jour<?php if($producer->order_delay > 1): ?>s<?php endif; ?></strong> à l'avance</span>
<?php if(!Yii::$app->user->isGuest): ?>
<span class="favorite">
<?php if($user_etablissement && $user_etablissement->favoris): ?>
<span class="glyphicon glyphicon-star"></span> <a href="<?= Yii::$app->urlManagerProducer->createUrl(['site/favorite','action' => 'delete']); ?>" data-toggle="tooltip" data-placement="bottom" title="Supprimer de mes favoris">Favoris</a>
<?php if($userProducer && $userProducer->bookmark): ?>
<span class="glyphicon glyphicon-star"></span> <a href="<?= Yii::$app->urlManagerProducer->createUrl(['site/bookmarks','action' => 'delete']); ?>" data-toggle="tooltip" data-placement="bottom" title="Supprimer de mes favoris">Favoris</a>
<?php else: ?>
<span class="glyphicon glyphicon glyphicon-star-empty"></span> <a href="<?= Yii::$app->urlManagerProducer->createUrl(['site/favorite','action' => 'add']); ?>" data-toggle="tooltip" data-placement="bottom" title="Ajouter à mes favoris">Favoris</a>
<span class="glyphicon glyphicon glyphicon-star-empty"></span> <a href="<?= Yii::$app->urlManagerProducer->createUrl(['site/bookmarks','action' => 'add']); ?>" data-toggle="tooltip" data-placement="bottom" title="Ajouter à mes favoris">Favoris</a>
<?php endif; ?>
</span>
<?php endif; ?>
@@ -155,21 +155,21 @@ $producer = $this->context->getProducer() ;
],
[
'label' => '<span class="glyphicon glyphicon-plus"></span> Commander',
'url' => Yii::$app->urlManager->createUrl(['commande/create']),
'url' => Yii::$app->urlManager->createUrl(['order/create']),
'visible' => !Yii::$app->user->isGuest,
'active' => $this->getControllerAction() == 'commande/create' || $this->getControllerAction() == 'commande/update',
'active' => $this->getControllerAction() == 'order/create' || $this->getControllerAction() == 'order/update',
],
[
'label' => '<span class="glyphicon glyphicon-plus"></span> Commander',
'url' => Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer','id' => $this->context->getProducer()->id,'return_url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['commande/create','slug_producer' => $this->context->getProducer()->slug])]),
'url' => Yii::$app->urlManagerFrontend->createAbsoluteUrl(['site/producer','id' => $this->context->getProducer()->id,'return_url' => Yii::$app->urlManagerProducer->createAbsoluteUrl(['order/create','slug_producer' => $this->context->getProducer()->slug])]),
'visible' => Yii::$app->user->isGuest,
'active' => $this->getControllerAction() == 'commande/create' || $this->getControllerAction() == 'commande/update',
'active' => $this->getControllerAction() == 'order/create' || $this->getControllerAction() == 'order/update',
],
[
'label' => '<span class="glyphicon glyphicon-folder-open"></span> Historique',
'url' => Yii::$app->urlManager->createUrl(['commande/historique']),
'url' => Yii::$app->urlManager->createUrl(['order/history']),
'visible' => !Yii::$app->user->isGuest,
'active' => $this->getControllerAction() == 'commande/historique',
'active' => $this->getControllerAction() == 'order/history',
],
[
'label' => '<span class="glyphicon glyphicon-envelope"></span> Contact',
@@ -179,7 +179,7 @@ $producer = $this->context->getProducer() ;
[
'label' => '<span class="glyphicon glyphicon-cog"></span> Administration',
'url' => Yii::$app->urlManagerBackend->createAbsoluteUrl(['site/index']),
'visible' => isset(Yii::$app->user->identity) && Yii::$app->user->identity->isBoulanger(),
'visible' => isset(Yii::$app->user->identity) && Yii::$app->user->identity->isProducer(),
'options' => ['id' => 'btn-administration']
],
],

Laddar…
Avbryt
Spara