1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

New design for error pages. closes #252

This commit is contained in:
Toby Zerner
2017-11-29 13:03:55 +10:30
parent 68ca96cb7b
commit ca1f2d8a80
7 changed files with 38 additions and 84 deletions

View File

@@ -0,0 +1,22 @@
@extends('flarum.forum::layouts.basic')
@section('content')
<p>
{{-- TODO: Change below to @php when Laravel is upgraded --}}
<?php
$getTranslationIfExists = function ($code) use ($translator, $settings) {
$key = 'core.views.error.'.$code.'_message';
$translation = $translator->trans($key, ['{forum}' => $settings->get('forum_title')]);
return $translation === $key ? false : $translation;
};
if (! $translation = $getTranslationIfExists($error->getCode())) {
if (! $translation = $getTranslationIfExists(500)) {
$translation = 'An error occurred while trying to load this page.';
}
}
?>
{{ $translation }}
</p>
@endsection