Blade -> Twig

This commit is contained in:
Pig Fang 2019-09-18 23:06:48 +08:00
parent 146c12f26e
commit 3b1866ffba
58 changed files with 606 additions and 920 deletions

View File

@ -18,6 +18,17 @@ use App\Exceptions\PrettyPageException;
class AuthController extends Controller
{
public function login()
{
return view('auth.login', [
'extra' => [
'tooManyFails' => cache(sha1('login_fails_'.get_client_ip())) > 3,
'recaptcha' => option('recaptcha_sitekey'),
'invisible' => (bool) option('recaptcha_invisible'),
],
]);
}
public function handleLogin(Request $request, Captcha $captcha)
{
$this->validate($request, [
@ -88,6 +99,7 @@ class AuthController extends Controller
{
if (option('user_can_register')) {
return view('auth.register', [
'site_name' => option_localized('site_name'),
'extra' => [
'player' => (bool) option('register_with_player_name'),
'recaptcha' => option('recaptcha_sitekey'),
@ -265,7 +277,7 @@ class AuthController extends Controller
$user->verified = true;
$user->save();
return view('auth.verify');
return view('auth.verify', ['site_name' => option_localized('site_name')]);
}
public function jwtLogin(Request $request)

View File

@ -2,21 +2,38 @@
namespace App\Http\Controllers;
use Illuminate\Support\Arr;
class HomeController extends Controller
{
public function index()
{
return view('index')->with('user', auth()->user())
->with('transparent_navbar', option('transparent_navbar', false))
->with('home_pic_url', option('home_pic_url') ?: config('options.home_pic_url'));
return view('home')->with('user', auth()->user())
->with('site_description', option_localized('site_description'))
->with('transparent_navbar', (bool) option('transparent_navbar', false))
->with('fixed_bg', option('fixed_bg'))
->with('hide_intro', option('hide_intro'))
->with('home_pic_url', option('home_pic_url') ?: config('options.home_pic_url'))
->with('user_can_register', option('user_can_register'));
}
public function apiRoot()
{
$copyright = Arr::get(
[
'Powered with ❤ by Blessing Skin Server.',
'Powered by Blessing Skin Server.',
'Proudly powered by Blessing Skin Server.',
'由 Blessing Skin Server 强力驱动。',
'自豪地采用 Blessing Skin Server。',
],
option_localized('copyright_prefer', 0)
);
return response()->json([
'blessing_skin' => config('app.version'),
'spec' => 0,
'copyright' => bs_copyright(),
'copyright' => $copyright,
'site_name' => option('site_name'),
]);
}

View File

@ -32,11 +32,6 @@ class SkinlibController extends Controller
8 => 'A PHP extension stopped the file upload.',
];
public function index()
{
return view('skinlib.index', ['user' => Auth::user()]);
}
/**
* Get skin library data filtered.
* Available Query String: filter, uploader, page, sort, keyword, items_per_page.
@ -138,10 +133,18 @@ class SkinlibController extends Controller
}
}
$commentScript = get_string_replaced(
option('comment_script'),
[
'{tid}' => $texture->tid,
'{name}' => $texture->name,
'{url}' => request()->url(),
]
);
return view('skinlib.show')
->with('texture', $texture)
->with('with_out_filter', true)
->with('user', $user)
->with('comment_script', $commentScript)
->with('extra', [
'download' => option('allow_downloading_texture'),
'currentUid' => $user ? $user->uid : 0,
@ -164,7 +167,6 @@ class SkinlibController extends Controller
public function upload()
{
return view('skinlib.upload')
->with('user', Auth::user())
->with('extra', [
'rule' => ($regexp = option('texture_name_regexp'))
? trans('skinlib.upload.name-rule-regexp', compact('regexp'))
@ -177,8 +179,7 @@ class SkinlibController extends Controller
'scorePrivate' => intval(option('private_score_per_storage')),
'award' => intval(option('score_award_per_texture')),
'contentPolicy' => app('parsedown')->text(option_localized('content_policy')),
])
->with('with_out_filter', true);
]);
}
public function handleUpload(Request $request)

View File

@ -10,7 +10,7 @@ class ViewServiceProvider extends ServiceProvider
{
public function boot()
{
View::composer(['*.base', 'shared.header'], function ($view) {
View::composer(['home', '*.base', 'shared.header'], function ($view) {
$view->with([
'site_name' => option_localized('site_name'),
'color_scheme' => option('color_scheme'),
@ -35,7 +35,7 @@ class ViewServiceProvider extends ServiceProvider
View::composer('shared.user-panel', Composers\UserPanelComposer::class);
View::composer('shared.footer', function ($view) {
View::composer('shared.copyright', function ($view) {
$customCopyright = get_string_replaced(
option_localized('copyright_text'),
[
@ -50,5 +50,14 @@ class ViewServiceProvider extends ServiceProvider
});
View::composer('shared.foot', Composers\FootComposer::class);
View::composer('auth.*', function ($view) {
$view->with('enable_recaptcha', (bool) option('recaptcha_sitekey'));
$view->with(
'recaptcha_url',
'https://www.recaptcha.net/recaptcha/api.js'
.'?onload=vueRecaptchaApiLoaded&render=explicit'
);
});
}
}

View File

@ -55,44 +55,6 @@ if (! function_exists('json')) {
}
}
if (! function_exists('bs_footer_extra')) {
function bs_footer_extra(): string
{
$extraContents = [];
Event::dispatch(new App\Events\RenderingFooter($extraContents));
return implode("\n", $extraContents);
}
}
if (! function_exists('bs_header_extra')) {
function bs_header_extra(): string
{
$extraContents = [];
Event::dispatch(new App\Events\RenderingHeader($extraContents));
return implode("\n", $extraContents);
}
}
if (! function_exists('bs_copyright')) {
function bs_copyright(): string
{
return Arr::get(
[
'Powered with ❤ by Blessing Skin Server.',
'Powered by Blessing Skin Server.',
'Proudly powered by Blessing Skin Server.',
'由 Blessing Skin Server 强力驱动。',
'自豪地采用 Blessing Skin Server。',
],
option_localized('copyright_prefer', 0)
);
}
}
if (! function_exists('option')) {
/**
* Get / set the specified option value.

View File

@ -1,9 +1,8 @@
.login-logo a, .register-logo a, .reset-logo a
.login-logo a
font-family Minecraft, Ubuntu, 'Segoe UI', 'Microsoft Yahei', 'Microsoft Jhenghei', sans-serif
transition all 0.2s ease-in-out
.login-logo a:hover, .register-logo a:hover, .reset-logo a:hover
color #42a5f5
&:hover
color #42a5f5
.captcha
cursor pointer

View File

@ -17,7 +17,9 @@
{% block content %}{% endblock %}
</section>
</div>
{{ include('shared.footer') }}
<footer class="main-footer">
{{ include('shared.copyright') }}
</footer>
</div>
{% block before_foot %}{% endblock %}
{{ include('shared.foot') }}

View File

@ -11,7 +11,9 @@
@include('shared.header')
@include('shared.sidebar', ['scope' => 'admin'])
@yield('content')
@include('shared.footer')
<footer class="main-footer">
@include('shared.footer')
</footer>
</div>
@include('shared.foot')

View File

@ -0,0 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{ include('shared.head') }}
<title>{% block title %}{% endblock %} - {{ site_name }}</title>
</head>
<body class="hold-transition login-page">
<div class="login-box">
<div class="login-logo">
<a href="{{ url('/') }}">{{ site_name }}</a>
</div>
<div class="login-box-body">
{% block content %}{% endblock %}
</div>
</div>
{% block before_foot %}{% endblock %}
{{ include('shared.foot') }}
</body>
</html>

View File

@ -1,41 +0,0 @@
@extends('auth.master')
@section('title', trans('auth.bind.title'))
@section('content')
<div class="login-box">
<div class="login-logo">
<a href="{{ url('/') }}">{{ option_localized('site_name') }}</a>
</div>
<!-- /.login-logo -->
<div class="login-box-body">
<p class="login-box-msg">@lang('auth.bind.message')</p>
<form method="post" id="login-form" action="{{ url('/auth/bind') }}">
@csrf
<div class="form-group has-feedback">
<input name="email" type="email" class="form-control" placeholder="@lang('auth.email')">
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<p>@lang('auth.bind.introduction')</p>
@if ($errors->count() > 0)
<div id="msg" class="callout callout-warning">{{ $errors->first() }}</div>
@endif
<div class="row">
<div class="col-xs-8"></div>
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat">@lang('auth.bind.button')</button>
</div><!-- /.col -->
</div>
</form>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
@endsection

View File

@ -0,0 +1,34 @@
{% extends 'auth.base' %}
{% block title %}{{ trans('auth.bind.title') }}{% endblock %}
{% block content %}
<p class="login-box-msg">{{ trans('auth.bind.message') }}</p>
<form method="post" id="login-form" action="{{ url('/auth/bind') }}">
{{ csrf_field() }}
<div class="form-group has-feedback">
<input
name="email"
type="email"
class="form-control"
placeholder="{{ trans('auth.email') }}"
>
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<p>{{ trans('auth.bind.introduction') }}</p>
{% if errors.any %}
<div id="msg" class="callout callout-warning">{{ errors.first }}</div>
{% endif %}
<div class="row">
<div class="col-xs-8"></div>
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat">
{{ trans('auth.bind.button') }}
</button>
</div>
</div>
</form>
{% endblock %}

View File

@ -1,32 +0,0 @@
@extends('auth.master')
@section('title', trans('auth.forgot.title'))
@section('content')
<div class="login-box">
<div class="login-logo">
<a href="{{ url('/') }}">{{ option_localized('site_name') }}</a>
</div>
<!-- /.login-logo -->
<div class="login-box-body">
<p class="login-box-msg">@lang('auth.forgot.message')</p>
@if (Session::has('msg'))
<div class="callout callout-warning">{{ Session::pull('msg') }}</div>
@endif
<form></form>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
@include('common.recaptcha')
<script>
Object.defineProperty(blessing, 'extra', {
get: () => Object.freeze(@json($extra)),
configurable: false
})
</script>
@endsection

View File

@ -0,0 +1,23 @@
{% extends 'auth.base' %}
{% block title %}{{ trans('auth.forgot.title') }}{% endblock %}
{% block content %}
<p class="login-box-msg">{{ trans('auth.forgot.message') }}</p>
{% if session_has('msg') %}
<div class="callout callout-warning">{{ session_pull('msg') }}</div>
{% endif %}
<form></form>
{% endblock %}
{% block before_foot %}
{% if enable_recaptcha %}
<script src="{{ recaptcha_url }}" async defer></script>
{% endif %}
<script>
Object.defineProperty(blessing, 'extra', {
configurable: false,
get: () => Object.freeze({{ extra|json_encode|raw }})
})
</script>
{% endblock %}

View File

@ -1,41 +0,0 @@
@extends('auth.master')
@section('title', trans('auth.login.title'))
@section('content')
<div class="login-box">
<div class="login-logo">
<a href="{{ url('/') }}">{{ option_localized('site_name') }}</a>
</div>
<!-- /.login-logo -->
<div class="login-box-body">
<p class="login-box-msg">@lang('auth.login.message')</p>
@if (Session::has('msg'))
<div class="callout callout-warning">{{ Session::pull('msg') }}</div>
@endif
<form></form>
<br>
<a href="{{ url('auth/register') }}" class="pull-left" style="margin-top: -10px;">@lang('auth.register-link')</a>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
@include('common.recaptcha')
@php
$extra = [
'tooManyFails' => cache(sha1('login_fails_'.get_client_ip())) > 3,
'recaptcha' => option('recaptcha_sitekey'),
'invisible' => (bool) option('recaptcha_invisible'),
];
@endphp
<script>
Object.defineProperty(blessing, 'extra', {
configurable: false,
get: () => Object.freeze(@json($extra))
})
</script>
@endsection

View File

@ -0,0 +1,27 @@
{% extends 'auth.base' %}
{% block title %}{{ trans('auth.login.title') }}{% endblock %}
{% block content %}
<p class="login-box-msg">{{ trans('auth.login.message') }}</p>
{% if session_has('msg') %}
<div class="callout callout-warning">{{ session_pull('msg') }}</div>
{% endif %}
<form></form>
<br>
<a href="{{ url('auth/register') }}" class="pull-left" style="margin-top: -10px;">
{{ trans('auth.register-link') }}
</a>
{% endblock %}
{% block before_foot %}
{% if enable_recaptcha %}
<script src="{{ recaptcha_url }}" async defer></script>
{% endif %}
<script>
Object.defineProperty(blessing, 'extra', {
configurable: false,
get: () => Object.freeze({{ extra|json_encode|raw }})
})
</script>
{% endblock %}

View File

@ -1,30 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>@yield('title') - {{ option_localized('site_name') }}</title>
@include('common.favicon')
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta name="csrf-token" content="{{ csrf_token() }}">
@include('common.theme-color')
@include('common.seo-meta-tags')
<!-- App Styles -->
@include('common.dependencies.style')
</head>
<body class="hold-transition login-page">
@yield('content')
<!-- YOU CAN NOT MODIFIY THE COPYRIGHT TEXT W/O PERMISSION -->
<div id="copyright-text" class="hide">
@include('common.copyright')
</div>
<!-- App Scripts -->
@include('common.dependencies.script')
@yield('script')
</body>
</html>

View File

@ -1,27 +0,0 @@
@extends('auth.master')
@section('title', trans('auth.register.title'))
@section('content')
<div class="register-box">
<div class="register-logo">
<a href="{{ url('/') }}">{{ option_localized('site_name') }}</a>
</div>
<div class="register-box-body">
<p class="login-box-msg">@lang('auth.register.message', ['sitename' => option_localized('site_name')])</p>
<form></form>
</div>
<!-- /.form-box -->
</div>
<!-- /.register-box -->
@include('common.recaptcha')
<script>
Object.defineProperty(blessing, 'extra', {
get: () => Object.freeze(@json($extra)),
configurable: false
})
</script>
@endsection

View File

@ -0,0 +1,22 @@
{% extends 'auth.base' %}
{% block title %}{{ trans('auth.register.title') }}{% endblock %}
{% block content %}
<p class="login-box-msg">
{{ trans('auth.register.message', {sitename: site_name}) }}
</p>
<form></form>
{% endblock %}
{% block before_foot %}
{% if enable_recaptcha %}
<script src="{{ recaptcha_url }}" async defer></script>
{% endif %}
<script>
Object.defineProperty(blessing, 'extra', {
configurable: false,
get: () => Object.freeze({{ extra|json_encode|raw }})
})
</script>
{% endblock %}

View File

@ -1,21 +0,0 @@
@extends('auth.master')
@section('title', trans('auth.reset.title'))
@section('content')
<div class="login-box">
<div class="login-logo">
<a href="{{ url('/') }}">{{ option_localized('site_name') }}</a>
</div>
<div class="login-box-body">
<p class="login-box-msg">@lang('auth.reset.message', ['username' => $user->nickname])</p>
<form></form>
</div>
<!-- /.form-box -->
</div>
<!-- /.login-box -->
@endsection

View File

@ -0,0 +1,10 @@
{% extends 'auth.base' %}
{% block title %}{{ trans('auth.reset.title') }}{% endblock %}
{% block content %}
<p class="login-box-msg">
{{ trans('auth.reset.message', {username: user.nickname}) }}
</p>
<form></form>
{% endblock %}

View File

@ -1,32 +0,0 @@
@extends('auth.master')
@section('title', trans('auth.verify.title'))
@section('content')
<div class="login-box">
<div class="login-logo">
<a href="{{ url('/') }}">{{ option_localized('site_name') }}</a>
</div>
<!-- /.login-logo -->
<div class="login-box-body">
<p class="login-box-msg">@lang('auth.verify.message', ['sitename' => option_localized('site_name')])</p>
<div class="callout callout-success">
<i class="icon fa fa-check"></i> @lang('auth.verify.success')
</div>
<div class="row">
<div class="col-xs-6 pull-right">
<a href="{{ url('/') }}" class="btn btn-primary btn-block btn-flat">
@lang('auth.verify.button')
</a>
</div><!-- /.col -->
</div>
</div>
<!-- /.login-box-body -->
</div>
<!-- /.login-box -->
@endsection

View File

@ -0,0 +1,19 @@
{% extends 'auth.base' %}
{% block title %}{{ trans('auth.verify.title') }}{% endblock %}
{% block content %}
<p class="login-box-msg">
{{ trans('auth.verify.message', {sitename: site_name}) }}
</p>
<div class="callout callout-success">
<i class="icon fa fa-check"></i> {{ trans('auth.verify.success') }}
</div>
<div class="row">
<div class="col-xs-6 pull-right">
<a href="{{ url('/') }}" class="btn btn-primary btn-block btn-flat">
{{ trans('auth.verify.button') }}
</a>
</div>
</div>
{% endblock %}

View File

@ -1,7 +0,0 @@
{!!
str_replace(
'Blessing Skin Server',
'<a href="https://github.com/bs-community/blessing-skin-server">Blessing Skin Server</a>',
bs_copyright()
)
!!}

View File

@ -1,8 +0,0 @@
{!!
get_string_replaced(
option_localized('copyright_text'), [
'{site_name}' => option_localized('site_name'),
'{site_url}' => option('site_url'),
]
)
!!}

View File

@ -1,9 +0,0 @@
@inject('intl', 'App\Services\Translations\JavaScript')
<script src="{{ $intl->generate(app()->getLocale()) }}"></script>
@if ($pluginI18n = $intl->plugin(app()->getLocale()))
<script src="{{ $pluginI18n }}"></script>
@endif
<script src="{{ webpack_assets('index.js') }}"></script>
<script>{!! option('custom_js') !!}</script>
{{-- Content added by plugins dynamically --}}
{!! bs_footer_extra() !!}

View File

@ -1,16 +0,0 @@
<!-- Bundled styles -->
@if (app()->environment('development'))
<script src="{{ webpack_assets('style.js') }}"></script>
@endif
<link rel="stylesheet" href="{{ webpack_assets('style.css') }}">
<!-- AdminLTE color scheme -->
<link rel="stylesheet" href="{{ webpack_assets('skins/'.option('color_scheme').'.min.css') }}">
@if (isset($module))
<link rel="stylesheet" href="{{ webpack_assets($module . '.css') }}">
@endif
<!-- User custom styles -->
<style>{!! option('custom_css') !!}</style>
{{-- Content added by plugins dynamically --}}
{!! bs_header_extra() !!}

View File

@ -1,6 +0,0 @@
@php
$faviconUrl = \Illuminate\Support\Str::startsWith($url = (option('favicon_url') ?: config('options.favicon_url')), 'http') ? $url : url($url);
@endphp
<link rel="shortcut icon" href="{{ $faviconUrl }}">
<link rel="icon" type="image/png" href="{{ $faviconUrl }}" sizes="192x192">
<link rel="apple-touch-icon" href="{{ $faviconUrl }}" sizes="180x180">

View File

@ -1,26 +0,0 @@
<!-- Language Menu -->
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-language" aria-hidden="true"></i>
<span class="description-text">{{ config('locales.'.App::getLocale(), config('locales.'.config('app.fallback_locale')))['short_name'] }}</span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu" id="language-menu">
@foreach(config('locales') as $code => $langInfo)
@if (!isset($langInfo['alias']))
<?php
if (count($_GET) == 0) {
$link = "?lang=$code";
} elseif(isset($_GET['lang'])) {
$link = str_replace("lang={$_GET['lang']}", "lang=$code", $_SERVER['REQUEST_URI']);
} else {
$link = $_SERVER['REQUEST_URI']."&lang=$code";
}
?>
<li class="locale" data-code="{{ $code }}">
<a href="{{ $link }}">{{ $langInfo['name'] }}</a>
</li>
@endif
@endforeach
</ul>
</li>

View File

@ -1,30 +0,0 @@
@php
$notifications = $user->unreadNotifications;
$count = $notifications->count();
@endphp
<li class="dropdown notifications-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-bell"></i>
@if ($count > 0)
<span class="label label-warning notifications-counter">{{ $count }}</span>
@endif
</a>
<ul class="dropdown-menu">
@if ($count === 0)
<li class="header text-center">@lang('user.no-unread')</li>
@else
<li>
<ul class="menu notifications-list">
@foreach ($notifications as $notification)
<li>
<a href="#" data-nid="{{ $notification->id }}">
<i class="far fa-circle text-aqua"></i> {{ $notification->data['title'] }}
</a>
</li>
@endforeach
</ul>
</li>
@endif
</ul>
</li>

View File

@ -1,4 +0,0 @@
@if (option('recaptcha_sitekey'))
<script src="https://www.recaptcha.net/recaptcha/api.js?onload=vueRecaptchaApiLoaded&render=explicit" async defer>
</script>
@endif

View File

@ -1,3 +0,0 @@
<meta name="keywords" content="{{ option('meta_keywords') }}">
<meta name="description" content="{{ option('meta_description') }}">
{!! option('meta_extras') !!}

View File

@ -1,13 +0,0 @@
@php
$colors = [
'blue' => '#3c8dbc',
'yellow' => '#f39c12',
'green' => '#00a65a',
'purple' => '#605ca8',
'red' => '#dd4b39',
'black' => '#ffffff',
];
preg_match('/skin-(\w+)?(?:-light)?/', option('color_scheme'), $matches);
@endphp
<meta name="theme-color" content="{{ $colors[$matches[1]] }}">

View File

@ -1,48 +0,0 @@
<!-- User Account Menu -->
<li class="dropdown user user-menu">
<!-- Menu Toggle Button -->
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
@if (app('request')->is('skinlib*') || app('request')->is('/'))
<!-- The user image in the navbar-->
<img src="{{ url("avatar/25/".base64_encode($user->email).'.png?tid='.$user->avatar) }}" class="user-image" alt="User Image">
@else
<i class="fas fa-user"></i>
@endif
<!-- hidden-xs hides the username on small devices so only the image appears. -->
<span class="hidden-xs nickname">{{ $user->nickname ?? $user->email }}</span>
</a>
<ul class="dropdown-menu">
<!-- The user image in the menu -->
<li class="user-header">
<img src="{{ url("avatar/128/".base64_encode($user->email).'.png?tid='.$user->avatar) }}" alt="User Image">
<p>{{ $user->email }}</p>
</li>
@admin($user)
<!-- Menu Body -->
<li class="user-body">
<div class="row">
<div class="col-xs-4 text-center">
<a href="{{ url('admin') }}">@lang('general.admin-panel')</a>
</div>
<div class="col-xs-4 text-center">
<a href="{{ url('admin/users') }}">@lang('general.user-manage')</a>
</div>
<div class="col-xs-4 text-center">
<a href="{{ url('admin/options') }}">@lang('general.options')</a>
</div>
</div>
</li>
<style>li.user-header { height: initial !important; }</style>
@endadmin
<!-- Menu Footer-->
<li class="user-footer">
<div class="pull-left">
<a href="{{ url('user') }}" class="btn btn-default btn-flat">@lang('general.user-center')</a>
</div>
<div class="pull-right">
<button id="logout-button" class="btn btn-default btn-flat">@lang('general.logout')</button>
</div>
</li>
</ul>
</li>

View File

@ -1,33 +0,0 @@
@php
$roles = [
App\Models\User::BANNED => 'banned',
App\Models\User::NORMAL => 'normal',
App\Models\User::ADMIN => 'admin',
App\Models\User::SUPER_ADMIN => 'super-admin',
];
$role = $roles[$user->permission];
@endphp
@php
$badges = [];
event(new \App\Events\RenderingBadges($badges));
@endphp
<div class="user-panel">
<div class="pull-left image">
<img src="{{ url("avatar/45/".base64_encode($user->email).'.png?tid='.$user->avatar) }}" alt="User Image">
</div>
<div class="pull-left info">
<p class="nickname">{{ $user->nickname ?? $user->email }}</p>
<i class="fas fa-circle text-success"></i> @lang("admin.users.status.$role")
@if (count($badges) === 1)
<small class="label bg-{{ $badges[0][1] }}">{{ $badges[0][0] }}</small>
@endif
</div>
</div>
@if (count($badges) > 1)
<div class="user-panel" style="padding-top: 0">
@foreach ($badges as $badge)
<small class="label bg-{{ $badge[1] }}">{{ $badge[0] }}</small>
@endforeach
</div>
@endif

154
resources/views/home.twig Normal file
View File

@ -0,0 +1,154 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{ include('shared.head') }}
<title>{{ site_name }}</title>
<style>
.hp-wrapper {
{% if fixed_bg %}
background-color: rgba(0, 0, 0, 0);
{% else %}
background-image: url('{{ home_pic_url }}');
{% endif %}
height: 100vh;
}
{% if hide_intro %}
#copyright {
color: white;
position: fixed;
bottom: 0;
width: 100%;
padding: 0 50px 16px 50px;
}
{% else %}
#copyright {
background: #222;
padding: 16px 0 20px;
color: white;
}
{% endif %}
</style>
</head>
<body class="hold-transition {{ color_scheme }} layout-top-nav">
<div class="hp-wrapper">
{% if fixed_bg %}
<div id="fixed-bg" style="background-image: url('{{ home_pic_url }}')"></div>
{% endif %}
<header class="main-header {{ transparent_navbar ? 'transparent'}}">
<nav class="navbar navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a href="{{ url('/') }}" class="navbar-brand">{{ site_name }}</a>
</div>
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
<ul class="nav navbar-nav">
<li class="active">
<a href="{{ url('/') }}">{{ trans('general.index') }}</a>
</li>
<li>
<a href="{{ url('skinlib') }}">{{ trans('general.skinlib') }}</a>
</li>
</ul>
</div>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
{{ include('shared.languages') }}
{% if auth_check() %}
{{ include('shared.user-menu') }}
{% else %}
<li class="dropdown user user-menu">
<a href="{{ url('auth/login') }}" class="btn btn-login">
{{ trans('general.login') }}
</a>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>
</header>
<div class="container">
<div class="splash">
<h1 class="splash-head">{{ site_name }}</h1>
<p class="splash-subhead">
{{ site_description }}
</p>
<p>
{% if auth_check() %}
<a href="{{ url('user') }}" class="button">
{{ trans('general.user-center') }}
</a>
{% else %}
{% if user_can_register %}
<a href="{{ url('auth/register') }}" id="btn-register" class="button">
{{ trans('general.register') }}
</a>
{% else %}
<a href="{{ url('auth/login') }}" id="btn-close-register" class="button">
{{ trans('general.login') }}
</a>
{% endif %}
{% endif %}
</p>
</div>
</div>
{% if hide_intro %}
<div id="copyright">
<div class="container">
{{ include('shared.copyright') }}
</div>
</div>
{% endif %}
</div>
{% if not hide_intro %}
<div id="intro">
<div class="container">
<div class="row text-center">
<h1>{{ trans('index.features.title') }}</h1>
<br>
<br>
{% for item in ['first', 'second', 'third'] %}
<div class="col-lg-4">
<i class="fas {{ trans("index.features.#{item}.icon") }}" aria-hidden="true"></i>
<h3>{{ trans("index.features.#{item}.name") }}</h3>
<p>{{ trans("index.features.#{item}.desc") }}</p>
</div>
{% endfor %}
</div>
<br>
</div>
</div>
<div id="footerwrap">
<div class="container">
<div class="col-lg-6">
{{ trans('index.introduction', {sitename: site_name}) }}
</div>
<div class="col-lg-6">
<a href="{{ url('auth/register') }}" id="btn-register" class="button">
{{ trans('index.start') }}
</a>
</div>
</div>
</div>
<div id="copyright">
<div class="container">
{{ include('shared.copyright') }}
</div>
</div>
{% endif %}
<script>
blessing.extra = { transparent_navbar: {{ transparent_navbar }} }
</script>
{{ include('shared.foot') }}
</body>
</html>

View File

@ -1,171 +0,0 @@
<!DOCTYPE html>
<html>
<head>
@include('shared.head')
<title>{{ option_localized('site_name') }}</title>
<style>
.hp-wrapper {
@if (option('fixed_bg'))
background-color: rgba(0, 0, 0, 0);
@else
background-image: url('{{ $home_pic_url }}');
@endif
height: 100vh;
}
@if (option('hide_intro'))
#copyright {
color: white;
position: fixed;
bottom: 0;
width: 100%;
padding: 0 50px 16px 50px;
}
@else
#copyright {
background: #222;
padding: 16px 0 20px;
color: white;
}
@endif
</style>
</head>
<body class="hold-transition {{ option('color_scheme') }} layout-top-nav">
<div class="hp-wrapper">
@if (option('fixed_bg'))
<div id="fixed-bg" style="background-image: url('{{ $home_pic_url }}')"></div>
@endif
<!-- Navigation -->
<header class="main-header {{ $transparent_navbar ? 'transparent' : ''}}">
<nav class="navbar navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a href="{{ option('site_url') }}" class="navbar-brand">{{ option_localized('site_name') }}</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="{{ url('/') }}">@lang('general.index')</a></li>
<li><a href="{{ url('skinlib') }}">@lang('general.skinlib')</a></li>
</ul>
</div><!-- /.navbar-collapse -->
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
@include('shared.languages')
@auth
@include('shared.user-menu')
@else {{-- Anonymous User --}}
<!-- User Account Menu -->
<li class="dropdown user user-menu">
<a href="{{ url('auth/login') }}" class="btn btn-login">@lang('general.login')</a>
</li>
@endauth
</ul>
</div><!-- /.navbar-custom-menu -->
</div><!-- /.container-fluid -->
</nav>
</header>
<div class="container">
<div class="splash">
<h1 class="splash-head">{{ option_localized('site_name') }}</h1>
<p class="splash-subhead">
{{ option_localized('site_description') }}
</p>
<p>
@guest
@if (option('user_can_register'))
<a href="{{ url('auth/register') }}" id="btn-register" class="button">@lang('general.register')</a>
@else
<a href="{{ url('auth/login') }}" id="btn-close-register" class="button">@lang('general.login')</a>
@endif
@else
<a href="{{ url('user') }}" class="button">@lang('general.user-center')</a>
@endguest
</p>
</div>
</div> <!--/ .container -->
@if (option('hide_intro'))
<div id="copyright">
<!-- Designed by Pratt -->
<div class="container">
<!-- YOU CAN NOT MODIFIY THE COPYRIGHT TEXT W/O PERMISSION -->
<div id="copyright-text" class="pull-right hidden-xs">
@include('common.copyright')
</div>
<!-- Default to the left -->
@include('common.custom-copyright')
</div>
</div>
@endif
</div><!--/ #headerwrap -->
@if (! option('hide_intro'))
<!-- INTRO WRAP -->
<div id="intro">
<div class="container">
<div class="row text-center">
<h1>{!! trans('index.features.title') !!}</h1>
<br>
<br>
<div class="col-lg-4">
<i class="fas {{ trans('index.features.first.icon') }}" aria-hidden="true"></i>
<h3>{!! trans('index.features.first.name') !!}</h3>
<p>{!! trans('index.features.first.desc') !!}</p>
</div>
<div class="col-lg-4">
<i class="fas {{ trans('index.features.second.icon') }}" aria-hidden="true"></i>
<h3>{!! trans('index.features.second.name') !!}</h3>
<p>{!! trans('index.features.second.desc') !!}</p>
</div>
<div class="col-lg-4">
<i class="fas {{ trans('index.features.third.icon') }}" aria-hidden="true"></i>
<h3>{!! trans('index.features.third.name') !!}</h3>
<p>{!! trans('index.features.third.desc') !!}</p>
</div>
</div>
<br>
</div> <!--/ .container -->
</div><!--/ #introwrap -->
<div id="footerwrap">
<div class="container">
<div class="col-lg-6">
{!! trans('index.introduction', ['sitename' => option_localized('site_name')]) !!}
</div>
<div class="col-lg-6">
<a href="{{ url('auth/register') }}" id="btn-register" class="button">@lang('index.start')</a>
</div>
</div>
</div>
@endif
@if (! option('hide_intro'))
<div id="copyright">
<!-- Designed by Pratt -->
<div class="container">
<!-- YOU CAN NOT MODIFIY THE COPYRIGHT TEXT W/O PERMISSION -->
<div id="copyright-text" class="pull-right hidden-xs">
@include('common.copyright')
</div>
<!-- Default to the left -->
@include('common.custom-copyright')
</div>
</div>
@endif
<script>
blessing.extra = @json(['transparent_navbar' => (bool) $transparent_navbar])
</script>
<!-- App Scripts -->
@include('common.dependencies.script')
</body>
</html>

View File

@ -0,0 +1,19 @@
{% set repo = 'https://github.com/bs-community/blessing-skin-server' %}
<!-- YOU CAN NOT MODIFIY THE COPYRIGHT TEXT W/O PERMISSION -->
<div id="copyright-text" class="pull-right hidden-xs">
{% if copyright == 0 %}
Powered with ❤ by <a href="{{ repo }}">Blessing Skin Server</a>.
{% elseif copyright == 1 %}
Powered by <a href="{{ repo }}">Blessing Skin Server</a>.
{% elseif copyright == 2 %}
Proudly powered by <a href="{{ repo }}">Blessing Skin Server</a>.
{% elseif copyright == 3 %}
由 <a href="{{ repo }}">Blessing Skin Server</a> 强力驱动。
{% else %}
自豪地采用 <a href="{{ repo }}">Blessing Skin Server</a>。
{% endif %}
</div>
<!-- Default to the left -->
{{ custom_copyright|raw }}

View File

@ -1,20 +1,3 @@
{% set repo = 'https://github.com/bs-community/blessing-skin-server' %}
<footer class="main-footer">
<!-- YOU CAN NOT MODIFIY THE COPYRIGHT TEXT W/O PERMISSION -->
<div id="copyright-text" class="pull-right hidden-xs">
{% if copyright == 0 %}
Powered with ❤ by <a href="{{ repo }}">Blessing Skin Server</a>.
{% elseif copyright == 1 %}
Powered by <a href="{{ repo }}">Blessing Skin Server</a>.
{% elseif copyright == 2 %}
Proudly powered by <a href="{{ repo }}">Blessing Skin Server</a>.
{% elseif copyright == 3 %}
由 <a href="{{ repo }}">Blessing Skin Server</a> 强力驱动。
{% else %}
自豪地采用 <a href="{{ repo }}">Blessing Skin Server</a>。
{% endif %}
</div>
<!-- Default to the left -->
{{ custom_copyright|raw }}
{{ include('shared.copyright') }}
</footer>

View File

@ -0,0 +1,85 @@
<!DOCTYPE html>
<html lang="en">
<head>
{{ include('shared.head') }}
<title>{% block title %}{% endblock %} - {{ site_name }}</title>
</head>
<body class="hold-transition {{ color_scheme }} layout-top-nav">
<div class="wrapper">
<header class="main-header">
<nav class="navbar navbar-static-top">
<div class="container">
<div class="navbar-header">
<a href="{{ url('/') }}" class="navbar-brand">{{ site_name }}</a>
<button
type="button"
class="navbar-toggle collapsed"
data-toggle="collapse"
data-target="#navbar-collapse"
>
<i class="fas fa-bars"></i>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
<ul class="nav navbar-nav">
<li class="active">
<a href="{{ url('skinlib') }}">{{ trans('general.skinlib') }}</a>
</li>
{% if auth_check() %}
<li>
<a href="{{ url('user/closet') }}">
{{ trans('general.my-closet') }}
</a>
</li>
{% endif %}
</ul>
</div>
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
{% if auth_check() %}
<li>
<a href="{{ url('skinlib/upload') }}">
<i class="fas fa-upload" aria-hidden="true"></i>&nbsp;
<span class="description-text">
{{ trans('skinlib.general.upload-new-skin') }}
</span>
</a>
</li>
{{ include('shared.notifications') }}
{% endif %}
{{ include('shared.languages') }}
{% if auth_check() %}
{{ include('shared.user-menu') }}
{% else %}
<li class="dropdown user user-menu">
<a href="{{ url('auth/login') }}">
<i class="fas fa-user"></i>
<span class="hidden-xs nickname">
{{ trans('general.anonymous') }}
</span>
</a>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>
</header>
{% block content %}{% endblock %}
<footer class="main-footer">
<div class="container">
{{ include('shared.copyright') }}
</div>
</footer>
</div>
{% block before_foot %}{% endblock %}
{{ include('shared.foot') }}
</body>
</html>

View File

@ -1,7 +0,0 @@
@extends('skinlib.master')
@section('title', trans('general.skinlib'))
@section('content')
<div class="content-wrapper"></div>
@endsection

View File

@ -0,0 +1,7 @@
{% extends 'skinlib.base' %}
{% block title %}{{ trans('general.skinlib') }}{% endblock %}
{% block content %}
<div class="content-wrapper"></div>
{% endblock %}

View File

@ -1,87 +0,0 @@
<!DOCTYPE html>
<html>
<head>
@include('shared.head')
<title>@yield('title') - {{ option_localized('site_name') }}</title>
@yield('style')
</head>
<body class="hold-transition {{ option('color_scheme') }} layout-top-nav">
<div class="wrapper">
<header class="main-header">
<nav class="navbar navbar-static-top">
<div class="container">
<div class="navbar-header">
<a href="{{ option('site_url') }}" class="navbar-brand">
{{ option_localized('site_name') }}
</a>
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
<i class="fas fa-bars"></i>
</button>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse pull-left" id="navbar-collapse">
<ul class="nav navbar-nav">
<li class="active">
<a href="{{ url('skinlib') }}">@lang('general.skinlib')</a>
</li>
@auth
<li>
<a href="{{ url('user/closet') }}">@lang('general.my-closet')</a>
</li>
@endauth
</ul>
</div><!-- /.navbar-collapse -->
<!-- Navbar Right Menu -->
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
@auth
<li><a href="{{ url('skinlib/upload') }}"><i class="fas fa-upload" aria-hidden="true"></i> <span class="description-text">@lang('skinlib.general.upload-new-skin')</span></a></li>
@include('common.notifications-menu')
@endauth
@include('common.language')
@if (!is_null($user))
@include('common.user-menu')
@else {{-- Anonymous User --}}
<!-- User Account Menu -->
<li class="dropdown user user-menu">
<!-- Menu Toggle Button -->
<a href="{{ url('auth/login') }}">
<i class="fas fa-user"></i>
<!-- hidden-xs hides the username on small devices so only the image appears. -->
<span class="hidden-xs nickname">@lang('general.anonymous')</span>
</a>
</li>
@endif
</ul>
</div><!-- /.navbar-custom-menu -->
</div><!-- /.container-fluid -->
</nav>
</header>
@yield('content')
<!-- Main Footer -->
<footer class="main-footer">
<div class="container">
<!-- YOU CAN NOT MODIFIY THE COPYRIGHT TEXT W/O PERMISSION -->
<div id="copyright-text" class="pull-right hidden-xs">
@include('common.copyright')
</div>
<!-- Default to the left -->
@include('common.custom-copyright')
</div>
</footer>
</div><!-- ./wrapper -->
<!-- App Scripts -->
@include('common.dependencies.script')
@yield('script')
</body>
</html>

View File

@ -1,50 +0,0 @@
@extends('skinlib.master')
@section('title', $texture->name)
@section('content')
<!-- Full Width Column -->
<div class="content-wrapper">
<div class="container">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
@lang('skinlib.show.title')
</h1>
</section>
<!-- Main content -->
<section class="content">
<div class="row"></div>
@if (option('comment_script'))
<div class="row">
<div class="col-md-12">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">@lang('skinlib.show.comment')</h3>
</div>
<div class="box-body">
{!! get_string_replaced(option('comment_script'), [
'{tid}' => $texture->tid,
'{name}' => $texture->name,
'{url}' => request()->url()
]) !!}
</div>
</div>
</div>
</div>
@endif
</section><!-- /.content -->
</div><!-- /.container -->
</div><!-- /.content-wrapper -->
<script>
Object.defineProperty(blessing, 'extra', {
configurable: false,
get: () => Object.freeze(@json($extra))
})
</script>
@endsection

View File

@ -0,0 +1,41 @@
{% extends 'skinlib.base' %}
{% block title %}{{ texture.name }}{% endblock %}
{% block content %}
<div class="content-wrapper">
<div class="container">
<section class="content-header">
<h1>{{ trans('skinlib.show.title') }}</h1>
</section>
<section class="content">
<div class="row"></div>
{% if comment_script %}
<div class="row">
<div class="col-md-12">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('skinlib.show.comment') }}</h3>
</div>
<div class="box-body">
{{ comment_script|raw }}
</div>
</div>
</div>
</div>
{% endif %}
</section>
</div>
</div>
{% endblock %}
{% block before_foot %}
<script>
Object.defineProperty(blessing, 'extra', {
configurable: false,
get: () => Object.freeze({{ extra|json_encode|raw }})
})
</script>
{% endblock %}

View File

@ -1,24 +0,0 @@
@extends('skinlib.master')
@section('title', trans('skinlib.upload.title'))
@section('content')
<!-- Full Width Column -->
<div class="content-wrapper">
<div class="container">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
@lang('skinlib.upload.title')
</h1>
</section>
<!-- Main content -->
<section class="content"></section><!-- /.content -->
</div><!-- /.container -->
</div><!-- /.content-wrapper -->
<script>
blessing.extra = @json($extra)
</script>
@endsection

View File

@ -0,0 +1,20 @@
{% extends 'skinlib.base' %}
{% block title %}{{ trans('skinlib.upload.title') }}{% endblock %}
{% block content %}
<div class="content-wrapper">
<div class="container">
<section class="content-header">
<h1>{{ block('title') }}</h1>
</section>
<section class="content"></section>
</div>
</div>
{% endblock %}
{% block before_foot %}
<script>
blessing.extra = {{ extra|json_encode|raw }}
</script>
{% endblock %}

View File

@ -17,7 +17,9 @@
{% block content %}{% endblock %}
</section>
</div>
{{ include('shared.footer') }}
<footer class="main-footer">
{{ include('shared.copyright') }}
</footer>
</div>
{% block before_foot %}{% endblock %}
{{ include('shared.foot') }}

View File

@ -1,16 +0,0 @@
@extends('auth.master')
@section('title', trans('user.player.bind.title'))
@section('content')
<div class="login-box">
<div class="login-logo">
<a href="{{ url('/') }}">{{ option_localized('site_name') }}</a>
</div>
<!-- /.login-logo -->
<div class="login-box-body">
<p class="login-box-msg">@lang('user.player.bind.title')</p>
<form></form>
</div>
</div>
@endsection

View File

@ -0,0 +1,8 @@
{% extends 'auth.base' %}
{% block title %}{{ trans('user.player.bind.title') }}{% endblock %}
{% block content %}
<p class="login-box-msg">{{ trans('user.player.bind.title') }}</p>
<form></form>
{% endblock %}

View File

@ -11,7 +11,9 @@
@include('shared.header')
@include('shared.sidebar', ['scope' => 'user'])
@yield('content')
@include('shared.footer')
<footer class="main-footer">
@include('shared.footer')
</footer>
</div>
@include('shared.foot')

View File

@ -1,39 +0,0 @@
@extends('auth.master')
@section('title', trans('auth.oauth.authorization.title'))
@section('content')
<div class="login-box">
<div class="login-logo">
<a href="{{ url('/') }}">{{ option_localized('site_name') }}</a>
</div>
<div class="login-box-body">
<p class="login-box-msg">
@lang('auth.oauth.authorization.introduction', ['name' => $client->name])
</p>
<div class="row">
<div class="col-xs-6">
<form method="post" action="{{ route('passport.authorizations.approve') }}">
@csrf
<input type="hidden" name="state" value="{{ $request->state }}">
<input type="hidden" name="client_id" value="{{ $client->id }}">
<button type="submit" class="btn btn-success btn-block btn-flat">
@lang('auth.oauth.authorization.button')
</button>
</form>
</div>
<div class="col-xs-6">
<form method="post" action="{{ route('passport.authorizations.deny') }}">
@csrf
@method('DELETE')
<input type="hidden" name="state" value="{{ $request->state }}">
<input type="hidden" name="client_id" value="{{ $client->id }}">
<button class="btn btn-default btn-block btn-flat">@lang('general.cancel')</button>
</form>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,33 @@
{% extends 'auth.base' %}
{% block title %}{{ trans('auth.oauth.authorization.title') }}{% endblock %}
{% block content %}
<p class="login-box-msg">
{{ trans('auth.oauth.authorization.introduction', {name: client.name}) }}
</p>
<div class="row">
<div class="col-xs-6">
<form method="post" action="{{ route('passport.authorizations.approve') }}">
{{ csrf_field() }}
<input type="hidden" name="state" value="{{ request.state }}">
<input type="hidden" name="client_id" value="{{ client.id }}">
<button type="submit" class="btn btn-success btn-block btn-flat">
{{ trans('auth.oauth.authorization.button') }}
</button>
</form>
</div>
<div class="col-xs-6">
<form method="post" action="{{ route('passport.authorizations.deny') }}">
{{ csrf_field() }}
{{ method_field('DELETE') }}
<input type="hidden" name="state" value="{{ request.state }}">
<input type="hidden" name="client_id" value="{{ client.id }}">
<button class="btn btn-default btn-block btn-flat">
{{ trans('general.cancel') }}
</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -23,7 +23,7 @@ Route::get('/locale/{lang}', 'HomeController@locale');
*/
Route::group(['prefix' => 'auth'], function () {
Route::group(['middleware' => 'guest'], function () {
Route::view('/login', 'auth.login');
Route::get('/login', 'AuthController@login');
Route::get('/register', 'AuthController@register');
Route::get('/forgot', 'AuthController@forgot');
Route::get('/reset/{uid}', 'AuthController@reset')->name('auth.reset')->middleware('signed');
@ -92,7 +92,7 @@ Route::group([
* Skin Library
*/
Route::group(['prefix' => 'skinlib'], function () {
Route::get('', 'SkinlibController@index');
Route::view('', 'skinlib.index');
Route::any('/info/{tid}', 'SkinlibController@info');
Route::any('/show/{tid}', 'SkinlibController@show');
Route::any('/data', 'SkinlibController@getSkinlibFiltered');

View File

@ -36,6 +36,9 @@ class AuthControllerTest extends TestCase
public function testLogin()
{
$this->get('/auth/login')->assertSee('Log in');
option(['recaptcha_sitekey' => 'key']);
$this->get('/auth/login')->assertSee('recaptcha.net');
}
public function testHandleLogin()

View File

@ -48,7 +48,7 @@ class HomeControllerTest extends TestCase
$this->get('/api')->assertJson([
'blessing_skin' => config('app.version'),
'spec' => 0,
'copyright' => bs_copyright(),
'copyright' => 'Powered with ❤ by Blessing Skin Server.',
'site_name' => option('site_name'),
]);
}

View File

@ -44,7 +44,7 @@ class PluginControllerTest extends TestCase
->once()
->andReturn(new Plugin('', []));
$plugin = new Plugin(resource_path(''), ['config' => 'common/favicon.blade.php']);
$plugin = new Plugin(resource_path(''), ['config' => 'shared/head.twig']);
$plugin->setEnabled(true);
$mock->shouldReceive('get')
->with('fake4')

View File

@ -14,11 +14,6 @@ class SkinlibControllerTest extends TestCase
{
use DatabaseTransactions;
public function testIndex()
{
$this->get('/skinlib')->assertViewHas('user');
}
public function testGetSkinlibFiltered()
{
$this->getJson('/skinlib/data')
@ -290,10 +285,7 @@ class SkinlibControllerTest extends TestCase
// Show a texture
$texture = factory(Texture::class)->create();
Storage::disk('textures')->put($texture->hash, '');
$this->get('/skinlib/show/'.$texture->tid)
->assertViewHas('texture')
->assertViewHas('with_out_filter', true)
->assertViewHas('user');
$this->get('/skinlib/show/'.$texture->tid)->assertViewHas('texture');
// Guest should not see private texture
$uploader = factory(User::class)->create();
@ -349,10 +341,7 @@ class SkinlibControllerTest extends TestCase
public function testUpload()
{
$this->actAs('normal')
->get('/skinlib/upload')
->assertViewHas('user')
->assertViewHas('with_out_filter', true);
$this->actAs('normal')->get('/skinlib/upload');
option(['texture_name_regexp' => 'abc']);
$this->get('/skinlib/upload')->assertViewHas('extra');

View File

@ -29,7 +29,7 @@ class RedirectToSetupTest extends TestCase
->with(base_path('.env'))
->andReturn(true);
});
$this->get('/')->assertViewIs('index');
$this->get('/')->assertViewIs('home');
$this->get('/setup')->assertViewIs('setup.wizard.welcome');
$this->get('/')->assertRedirect('/setup');
}