Преглед изворни кода

Refactoring/traduction vues frontend/views/layouts

dev
Guillaume Bourgeois пре 6 година
родитељ
комит
a32b959537
1 измењених фајлова са 14 додато и 14 уклоњено
  1. +14
    -14
      frontend/views/layouts/main.php

+ 14
- 14
frontend/views/layouts/main.php Прегледај датотеку

@@ -46,7 +46,7 @@ use common\helpers\Url ;
/* @var $this \yii\web\View */
/* @var $content string */

$is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'index') ;
$isHome = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action->id == 'index') ;

\common\assets\CommonAsset::register($this);
\frontend\assets\AppAsset::register($this);
@@ -55,7 +55,7 @@ $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>
<title><?php if($isHome): ?>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() ?>
@@ -70,7 +70,7 @@ $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action
<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; ?>">
<body class="<?php if($isHome): echo 'home' ; endif; ?><?php if(!Yii::$app->user->isGuest): ?> connected<?php endif; ?>">
<?php $this->beginBody() ?>
<div id="back"></div>
<?php if(YII_ENV == 'demo'): ?>
@@ -129,7 +129,7 @@ $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action
'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))) : '').'. ',
'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' => [
@@ -153,24 +153,24 @@ $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action
</header>
<?php if(!Yii::$app->user->isGuest): ?>
<section id="favorite-producers">
<section id="bookmarked-producers">
<div class="container">
<?php
$producers = Etablissement::find()
->joinWith(['userEtablissement user_etablissement'])
$producersArray = Producer::find()
->joinWith(['userProducer user_producer'])
->where([
'user_etablissement.id_user' => Yii::$app->user->id,
'user_etablissement.favoris' => 1,
'etablissement.actif' => 1
'user_producer.id_user' => User::getId(),
'user_producer.bookmark' => 1,
'producer.active' => 1
])
->all() ;
?>
<?php if(count($producers)): ?>
<?php if(count($producersArray)): ?>
<h2>Mes producteurs</h2>
<?php foreach($producers as $producer): ?>
<div class="col-md-<?php if(count($producers) == 1): ?>6<?php elseif(count($producers) == 2): ?>6<?php else: ?>3<?php endif; ?>">
<?php foreach($producersArray as $producer): ?>
<div class="col-md-<?php if(count($producers) == 1): ?>6<?php elseif(count($producersArray) == 2): ?>6<?php else: ?>3<?php endif; ?>">
<div class="producer" style="background-image:url('<?= Yii::$app->urlManagerProducer->getHostInfo().'/'.Yii::$app->urlManagerProducer->baseUrl ; ?>/uploads/<?= $producer->photo ?>');">
<a class="btn btn-primary" href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index','slug_producer' => $producer->slug]); ?>"><?= Html::encode($producer->nom); ?></a>
<a class="btn btn-primary" href="<?= Yii::$app->urlManagerProducer->createAbsoluteUrl(['site/index','slug_producer' => $producer->slug]); ?>"><?= Html::encode($producer->name); ?></a>
</div>
</div>
<?php endforeach;?>

Loading…
Откажи
Сачувај