From bc7679fd0d1d97f88c93769d7060eab252d2826e Mon Sep 17 00:00:00 2001 From: printempw Date: Sat, 5 Aug 2017 14:35:28 +0800 Subject: [PATCH] Use default background image when option leaved empty --- app/Http/Controllers/HomeController.php | 3 ++- resources/lang/en/options.yml | 2 +- resources/lang/zh_CN/options.yml | 2 +- resources/views/index.tpl | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 48b83f3d..05173729 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -9,7 +9,8 @@ class HomeController extends Controller { public function index(UserRepository $users, Request $request) { - return view('index')->with('user', $users->getCurrentUser()); + return view('index')->with('user', $users->getCurrentUser()) + ->with('home_pic_url', option('home_pic_url') ?: config('options.home_pic_url')); } } diff --git a/resources/lang/en/options.yml b/resources/lang/en/options.yml index d28b4d0e..461aeb28 100644 --- a/resources/lang/en/options.yml +++ b/resources/lang/en/options.yml @@ -5,7 +5,7 @@ homepage: home_pic_url: title: Picture URL at Homepage - hint: Path relative to homepage or full URL. + hint: Path relative to homepage or full URL, leave empty to use default image favicon_url: title: Website Icon hint: Path relative to resources/assets/ or full URL. diff --git a/resources/lang/zh_CN/options.yml b/resources/lang/zh_CN/options.yml index 58beb710..93fd035b 100644 --- a/resources/lang/zh_CN/options.yml +++ b/resources/lang/zh_CN/options.yml @@ -5,7 +5,7 @@ homepage: home_pic_url: title: 首页图片地址 - hint: 相对于首页的路径或者完整的 URL + hint: 相对于首页的路径或者完整的 URL,留空以使用默认背景 favicon_url: title: 网站图标 hint: 相对 resources/assets/ 的路径或者完整的 URL diff --git a/resources/views/index.tpl b/resources/views/index.tpl index f7a21d9e..6475ccfa 100644 --- a/resources/views/index.tpl +++ b/resources/views/index.tpl @@ -13,7 +13,7 @@ -
+