ソースを参照

Layout : connecté / non connecté

Adaptation du layout au statut connecté / non connecté de l'utilisateur.
refactoring
keun 6年前
コミット
08c1be8d3c
9個のファイルの変更1484行の追加35行の削除
  1. +1
    -1
      frontend/views/layouts/main.php
  2. +1
    -2
      producer/assets/AppAsset.php
  3. +1257
    -0
      producer/runtime/logs/app.log
  4. +81
    -13
      producer/views/layouts/main.php
  5. バイナリ
      producer/web/.sass-cache/e41f5e31a6663a79bf10fdc0a6dc1b740ec0b9dd/_layout.scssc
  6. +79
    -18
      producer/web/css/screen.css
  7. バイナリ
      producer/web/img/laboulange3.png
  8. +5
    -0
      producer/web/js/boulange.js
  9. +60
    -1
      producer/web/sass/_layout.scss

+ 1
- 1
frontend/views/layouts/main.php ファイルの表示

@@ -52,7 +52,7 @@ $is_home = (Yii::$app->controller->id == 'site' && Yii::$app->controller->action
<div class="text">
<div class="bap">La boîte à pain</div>
<div class="plateforme">Plateforme de réservation
<?php if(YII_ENV == 'dev' || YII_ENV == 'demo'): ?><?php if(YII_ENV == 'dev'): ?>(dév)<?php elseif(YII_ENV == 'demo'): ?>(démo)<?php endif; ?></div><?php endif; ?></div>
<?php if(YII_ENV == 'dev' || YII_ENV == 'demo'): ?><?php if(YII_ENV == 'dev'): ?>(dév)<?php elseif(YII_ENV == 'demo'): ?>(démo)<?php endif; ?><?php endif; ?></div>
</div>
</a>

+ 1
- 2
producer/assets/AppAsset.php ファイルの表示

@@ -22,8 +22,6 @@ class AppAsset extends \common\components\MyAssetBundle
public $css = [];
public $js = [];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
public function __construct() {
@@ -33,5 +31,6 @@ class AppAsset extends \common\components\MyAssetBundle
$this->addAsset('css','css/screen.css');
// js
$this->addAsset('js','js/boulange.js');
}
}

+ 1257
- 0
producer/runtime/logs/app.log
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 81
- 13
producer/views/layouts/main.php ファイルの表示

@@ -33,28 +33,97 @@ $producer = $this->getProducer() ;
<body class="">
<?php $this->beginBody() ?>
<div id="header-bap">
<div class="container">
<a id="logo" href="<?= Url::frontend(); ?>">
<img class="icon" src="<?php echo Yii::$app->urlManager->getBaseUrl(); ?>/img/laboulange3.png" alt="" />
<span class="text">La boîte à pain</span>
</a>
<?php
echo Nav::widget([
'encodeLabels' => false,
'items' => [
[
'label' => '<span class="glyphicon glyphicon-user"></span> Inscription',
'url' => Url::frontend('site/signup'),
'visible' => Yii::$app->user->isGuest
],
[
'label' => '<span class="glyphicon glyphicon-log-in"></span> Connexion',
'url' => Url::frontend('site/login'),
'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))) : '').'. ',
'options' => ['id' => 'label1'],
'url' => '#',
'items' => [
[
'label' => 'Profil',
'url' => Url::frontend('user/update'),
],
[
'label' => '<span class="glyphicon glyphicon-off"></span> Déconnexion',
'url' => Url::frontend('site/logout'),
]
],
'visible' => !Yii::$app->user->isGuest
],
],
'options' => ['id' =>'nav-bap'],
]);
?>

</div>
</div>
<header id="header">
<div class="container">
<h1><?= Html::encode($producer->nom); ?></h1>
<h2>Boulangerie à <?= Html::encode($producer->ville); ?> (<?= Html::encode($producer->code_postal); ?>)</h2>
<div id="credit"><span>Crédit :</span> 31,90 €</div>
<?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):
?>
<div id="credit"><span>Crédit :</span> <?= number_format($user_etablissement->credit, 2); ?> €</div>
<?php endif; ?>
<?php endif; ?>
</div>
</header>
<div id="main">
<div class="container">
<nav id="main-nav">
<a id="user" href="#"><span class="glyphicon glyphicon-user"></span> <span class="caret"></span></a>
<ul class="nav nav-pills">
<li><a href="<?php echo Yii::$app->urlManager->createUrl(['producer/index']); ?>"><span class="glyphicon glyphicon-th-large"></span> Accueil</a></li>
<li><a href="<?php echo Yii::$app->urlManager->createUrl('commande/index'); ?>"><span class="glyphicon glyphicon-plus"></span> Commander</a></li>
<li><a href="<?php echo Yii::$app->urlManager->createUrl('producer/index'); ?>"><span class="glyphicon glyphicon-folder-open"></span> Historique</a></li>
<li><a href="<?php echo Yii::$app->urlManager->createUrl('producer/index'); ?>"><span class="glyphicon glyphicon-euro"></span> Crédit</a></li>
<li><a href="<?php echo Yii::$app->urlManager->createUrl('producer/index'); ?>"><span class="glyphicon glyphicon-cog"></span> Paramètres</a></li>
<li><a href="<?php echo Yii::$app->urlManager->createUrl('producer/index'); ?>"><span class="glyphicon glyphicon-envelope"></span> Contact</a></li>
</ul>
<?php
echo Nav::widget([
'encodeLabels' => false,
'options' => ['class' =>'nav nav-pills'],
'items' => [
[
'label' => '<span class="glyphicon glyphicon-th-large"></span> Accueil',
'url' => Yii::$app->urlManager->createUrl(['producer/index']),
],
[
'label' => '<span class="glyphicon glyphicon-plus"></span> Commander',
'url' => Yii::$app->urlManager->createUrl(['commande/index']),
'visible' => !Yii::$app->user->isGuest
],
[
'label' => '<span class="glyphicon glyphicon-folder-open"></span> Historique',
'url' => Yii::$app->urlManager->createUrl(['commande/historique']),
'visible' => !Yii::$app->user->isGuest
],
[
'label' => '<span class="glyphicon glyphicon-envelope"></span> Contact',
'url' => Yii::$app->urlManager->createUrl(['producer/contact']),
],
],
]);
?>
</nav>

<section id="content">
<?php if (Yii::$app->session->hasFlash('error')): ?>
<div class="alert alert-danger" role="alert">
@@ -76,9 +145,8 @@ $producer = $this->getProducer() ;
<div class="container">
<div class="overflow"></div>
<div class="content">
<p>Propulsé par <a href="#">La boîte à pain</a></p>
</div>
</div>
</footer>


バイナリ
producer/web/.sass-cache/e41f5e31a6663a79bf10fdc0a6dc1b740ec0b9dd/_layout.scssc ファイルの表示


+ 79
- 18
producer/web/css/screen.css ファイルの表示

@@ -69,6 +69,67 @@ body {
}

/* line 9, ../sass/_layout.scss */
#header-bap {
background-color: #F8F1DD;
padding-top: 7px;
padding-bottom: 7px;
}
/* line 14, ../sass/_layout.scss */
#header-bap .container {
padding-left: 0px;
padding-right: 0px;
}
/* line 19, ../sass/_layout.scss */
#header-bap #logo {
color: black;
text-decoration: none;
position: relative;
top: 3px;
}
/* line 25, ../sass/_layout.scss */
#header-bap #logo img {
width: 25px;
}
/* line 28, ../sass/_layout.scss */
#header-bap #logo .text {
font-size: 17px;
font-family: "comfortaalight";
position: relative;
bottom: 6px;
left: 3px;
}
/* line 37, ../sass/_layout.scss */
#header-bap ul#nav-bap {
float: right;
}
/* line 40, ../sass/_layout.scss */
#header-bap ul#nav-bap li {
float: right;
}
/* line 42, ../sass/_layout.scss */
#header-bap ul#nav-bap li a {
color: black;
font-size: 15px;
color: #BB8757;
}
/* line 47, ../sass/_layout.scss */
#header-bap ul#nav-bap li a:hover, #header-bap ul#nav-bap li a:focus {
color: #333;
color: #BB8757;
background: none;
}
/* line 54, ../sass/_layout.scss */
#header-bap ul#nav-bap li ul {
background-color: #F8F1DD;
border-top: solid 2px #BB8757;
}
/* line 58, ../sass/_layout.scss */
#header-bap ul#nav-bap li ul li a {
text-transform: uppercase;
font-size: 13px;
}

/* line 68, ../sass/_layout.scss */
#header {
background-color: #BB8757;
text-align: center;
@@ -76,15 +137,15 @@ body {
padding-bottom: 70px;
border-bottom: solid 1px #e0e0e0;
}
/* line 16, ../sass/_layout.scss */
/* line 75, ../sass/_layout.scss */
#header .container {
position: relative;
}
/* line 20, ../sass/_layout.scss */
/* line 79, ../sass/_layout.scss */
#header h1, #header h2 {
color: white;
}
/* line 24, ../sass/_layout.scss */
/* line 83, ../sass/_layout.scss */
#header h1 {
text-transform: uppercase;
font-family: "myriadpro-regular";
@@ -92,12 +153,12 @@ body {
padding-bottom: 10px;
font-weight: bold;
}
/* line 32, ../sass/_layout.scss */
/* line 91, ../sass/_layout.scss */
#header h2 {
font-family: "myriadpro-it";
font-size: 18px;
}
/* line 37, ../sass/_layout.scss */
/* line 96, ../sass/_layout.scss */
#header #credit {
position: absolute;
top: 0px;
@@ -107,16 +168,16 @@ body {
border-bottom: solid 1px white;
padding: 7px 10px;
}
/* line 46, ../sass/_layout.scss */
/* line 105, ../sass/_layout.scss */
#header #credit span {
font-family: "myriadpro-light";
}

/* line 52, ../sass/_layout.scss */
/* line 111, ../sass/_layout.scss */
#main {
background-color: #FAFAFA;
background-color: #F8F1DD;
}
/* line 55, ../sass/_layout.scss */
/* line 114, ../sass/_layout.scss */
#main #main-nav {
width: 100%;
position: relative;
@@ -124,20 +185,20 @@ body {
background-color: white;
border-bottom: solid 1px #e0e0e0;
}
/* line 64, ../sass/_layout.scss */
/* line 123, ../sass/_layout.scss */
#main #main-nav ul li a {
color: #BB8757;
text-transform: uppercase;
font-family: "myriadpro-regular";
border-right: solid 1px #e0e0e0;
}
/* line 73, ../sass/_layout.scss */
/* line 132, ../sass/_layout.scss */
#main #main-nav #user {
color: #BB8757;
float: right;
padding: 10px;
}
/* line 80, ../sass/_layout.scss */
/* line 139, ../sass/_layout.scss */
#main .container {
padding: 0px;
background-color: white;
@@ -145,21 +206,21 @@ body {
border-left: solid 1px #e0e0e0;
border-right: solid 1px #e0e0e0;
}
/* line 88, ../sass/_layout.scss */
/* line 147, ../sass/_layout.scss */
#main #content {
padding: 0px 20px 20px 20px;
}

/* line 93, ../sass/_layout.scss */
/* line 152, ../sass/_layout.scss */
#footer {
background-color: #BB8757;
height: 100px;
}
/* line 97, ../sass/_layout.scss */
/* line 156, ../sass/_layout.scss */
#footer .container {
padding: 0px;
}
/* line 99, ../sass/_layout.scss */
/* line 158, ../sass/_layout.scss */
#footer .container .overflow {
height: 30px;
background-color: white;
@@ -167,12 +228,12 @@ body {
border-right: solid 1px #e0e0e0;
border-bottom: solid 1px #e0e0e0;
}
/* line 107, ../sass/_layout.scss */
/* line 166, ../sass/_layout.scss */
#footer .container .content {
padding-top: 20px;
color: white;
}
/* line 111, ../sass/_layout.scss */
/* line 170, ../sass/_layout.scss */
#footer .container .content a {
color: white;
text-decoration: underline;

バイナリ
producer/web/img/laboulange3.png ファイルの表示

変更前 変更後
幅: 200  |  高さ: 199  |  サイズ: 1.7KB

+ 5
- 0
producer/web/js/boulange.js ファイルの表示

@@ -6,11 +6,16 @@

$(document).ready(function()
{
producer_dropdown() ;
boulange_signup() ;
boulange_add_boulangerie() ;
});

function producer_dropdown() {
$(".dropdown-toggle").dropdown();
}

function boulange_scroll(id) {
if($("#"+id).size())
$('html,body').animate({

+ 60
- 1
producer/web/sass/_layout.scss ファイルの表示

@@ -6,6 +6,65 @@ body {
font-family: 'Arial' ;
}

#header-bap {
background-color: $color2 ;
padding-top: 7px ;
padding-bottom: 7px ;
.container {
padding-left: 0px ;
padding-right: 0px ;
}
#logo {
color: black ;
text-decoration: none ;
position: relative ;
top: 3px ;
img {
width: 25px ;
}
.text {
font-size: 17px ;
font-family: 'comfortaalight' ;
position: relative ;
bottom: 6px ;
left: 3px ;
}
}
ul#nav-bap {
float: right ;
li {
float: right ;
a {
color: black ;
font-size: 15px ;
color: $color1 ;
&:hover, &:focus {
color: #333 ;
color: $color1 ;
background: none ;
}
}
ul {
background-color: $color2 ;
border-top: solid 2px $color1 ;
li {
a {
text-transform: uppercase ;
font-size: 13px ;
}
}
}
}
}
}

#header {
background-color: $color1 ;
text-align: center ;
@@ -50,7 +109,7 @@ body {
}

#main {
background-color: #FAFAFA ;
background-color: $color2 ;
#main-nav {
width: 100% ;

読み込み中…
キャンセル
保存