Browse Source

Intégration pages d'erreurs

feature/souke
Guillaume Bourgeois 8 months ago
parent
commit
141f5ca722
6 changed files with 40 additions and 28 deletions
  1. +2
    -3
      common/views/error_info.php
  2. +17
    -11
      common/web/css/screen.css
  3. +10
    -4
      common/web/sass/_common.scss
  4. +4
    -6
      frontend/views/site/error.php
  5. +3
    -0
      producer/controllers/SiteController.php
  6. +4
    -4
      producer/views/site/error.php

+ 2
- 3
common/views/error_info.php View File

@@ -1,4 +1,3 @@
Le développeur a été prévenu et va faire le nécessaire pour corriger le problème.
<?php if(isset($lineBreak) && $lineBreak): ?><br /><?php endif; ?>
N'hésitez pas à <a href="<?= $urlContact ?>">le contacter</a>
Nous avons été prévenu et allons faire le nécessaire pour corriger le problème.
<?php if(isset($lineBreak) && $lineBreak): ?><br /><?php endif; ?> N'hésitez pas nous <a href="<?= $urlContact ?>">contacter</a>
si le problème persiste.

+ 17
- 11
common/web/css/screen.css View File

@@ -488,41 +488,47 @@ termes.
margin: 0px auto;
float: none;
}
/* line 358, ../sass/_common.scss */
#main #content .site-error .panel .panel-body {
padding-bottom: 0px;
}
/* line 362, ../sass/_common.scss */
#main #content .site-error .panel h2 {
text-transform: none;
font-size: 25px;
margin-top: 0px;
margin-bottom: 20px;
}
/* line 369, ../sass/_common.scss */
#main #content .site-error .panel p:last-child {
margin-bottom: 0px;
padding-bottom: 0px;
}
/* line 370, ../sass/_common.scss */
/* line 375, ../sass/_common.scss */
#main #content .site-error .alert {
padding-bottom: 5px;
}
/* line 373, ../sass/_common.scss */
#main #content .site-error .alert h2 {
/* line 378, ../sass/_common.scss */
#main #content .site-error .alert h3 {
margin-top: 5px;
margin-bottom: 18px;
}
/* line 377, ../sass/_common.scss */
/* line 383, ../sass/_common.scss */
#main #content .site-error .alert p {
margin-bottom: 15px;
}
/* line 381, ../sass/_common.scss */
/* line 387, ../sass/_common.scss */
#main #content .site-error .alert .btn {
text-decoration: none;
}
/* line 392, ../sass/_common.scss */
#main #content .site-error p.error-message {
font-weight: bold;
}

/* Paiement */
/* line 392, ../sass/_common.scss */
/* line 398, ../sass/_common.scss */
.payment-detail-remaining-surplus {
font-size: 13px;
color: gray;
}
/* line 396, ../sass/_common.scss */
/* line 402, ../sass/_common.scss */
.payment-detail-remaining-surplus strong {
font-weight: bold;
}

+ 10
- 4
common/web/sass/_common.scss View File

@@ -356,22 +356,28 @@

.panel {
.panel-body {
padding-bottom: 0px;
}

h2 {
text-transform: none;
font-size: 25px;
margin-top: 0px;
margin-bottom: 20px;
}

p:last-child {
margin-bottom: 0px;
padding-bottom: 0px;
}
}

.alert {
padding-bottom: 5px;

h2 {
h3 {
margin-top: 5px;
margin-bottom: 18px;
}

p {
@@ -383,8 +389,8 @@
}
}

.actions {
//text-align: center;
p.error-message {
font-weight: bold;
}
}


+ 4
- 6
frontend/views/site/error.php View File

@@ -46,22 +46,20 @@ $this->setMeta('description', 'Une erreur est survenue.') ;
<div class="site-error">
<div class="row">
<div class="col-lg-6">
<div class="panel panel-primary">
<div class="panel panel-primary panel-padding-large">
<div class="panel-body">
<h2>Erreur <?= $exception->statusCode ?></h2>
<p><?= nl2br(Html::encode($exception->getMessage())) ?></p>
<p class="error-message"><?= nl2br(Html::encode($exception->getMessage())) ?></p>
<p>
<span class="glyphicon glyphicon-info-sign"></span>
<?= $this->renderFile('@common/views/error_info.php', [
'urlContact' => Yii::$app->urlManager->createUrl('site/contact'),
'lineBreak' => true
'lineBreak' => false
]) ?>
</p>
<p><?= Html::a("<i class=\"bi bi-house-door\"></i> Retour à l'accueil", ['site/index'], ['class' => 'btn btn-secondary']) ?></p>
</div>
</div>
<div class="actions">
<p><?= Html::a("Retour à l'accueil", ['site/index'], ['class' => 'btn btn-default']) ?></p>
</div>
</div>
</div>
</div>

+ 3
- 0
producer/controllers/SiteController.php View File

@@ -41,6 +41,7 @@ namespace producer\controllers;
use common\forms\ContactForm;
use domain\Feature\Feature\Feature;
use domain\Product\Product\Product;
use yii\base\ErrorException;
use yii\data\ActiveDataProvider;
use yii\helpers\Html;

@@ -85,6 +86,8 @@ class SiteController extends ProducerBaseController

public function actionIndex()
{
throw new ErrorException('test');

return $this->render('index');
}


+ 4
- 4
producer/views/site/error.php View File

@@ -42,9 +42,9 @@ $this->setTitle('La serveur a renvoyé une erreur', 'Erreur');
?>

<div class="site-error">
<div class="alert alert-warning">
<h2>Erreur <?= $exception->statusCode ?></h2>
<p><?= nl2br(Html::encode($exception->getMessage())) ?></p>
<div class="alert alert-danger">
<h3>Erreur <?= $exception->statusCode ?></h3>
<p class="error-message"><?= nl2br(Html::encode($exception->getMessage())) ?></p>
<p>
<span class="glyphicon glyphicon-info-sign"></span>
<?= $this->renderFile('@common/views/error_info.php', [
@@ -54,6 +54,6 @@ $this->setTitle('La serveur a renvoyé une erreur', 'Erreur');
</p>
</div>
<div class="actions">
<p><?= Html::a("Retour à l'accueil", ['site/index'], ['class' => 'btn btn-default']) ?></p>
<p><?= Html::a("<i class=\"bi bi-house-door\"></i> Retour à l'accueil", ['site/index'], ['class' => 'btn btn-secondary']) ?></p>
</div>
</div>

Loading…
Cancel
Save