working on i18n of admin panel

This commit is contained in:
printempw 2016-12-30 20:37:27 +08:00
parent 9f1446fafb
commit d4453df8c2
11 changed files with 217 additions and 276 deletions

View File

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use Arr;
use Log;
use Utils;
use Option;
use ZipArchive;
use App\Services\Storage;
use Illuminate\Http\Request;
@ -35,7 +36,7 @@ class UpdateController extends Controller
'release_url' => '',
'pre_release' => false,
// fallback to current time
'release_time' => time(),
'release_time' => '',
'new_version_available' => false
];
@ -43,10 +44,6 @@ class UpdateController extends Controller
if ($this->getUpdateInfo()) {
$info['latest_version'] = $this->getUpdateInfo('latest_version');
if ($current_release = $this->getReleaseInfo($this->currentVersion)) {
$info['release_time'] = Arr::get($current_release, 'release_time') ?: time();
}
$info['new_version_available'] = version_compare(
$info['latest_version'],
$info['current_version'], '>'
@ -63,10 +60,26 @@ class UpdateController extends Controller
// if detailed release info is not given
$info['new_version_available'] = false;
}
if (!$info['new_version_available']) {
$info['release_time'] = Arr::get($this->getReleaseInfo($this->currentVersion), 'release_time');
}
}
$update = Option::form('update', '更新选项', function($form)
{
$form->checkbox('check_update', '检查更新')->label('自动检查更新并提示');
$form->text('update_source', '更新源')
->description('可用的更新源列表可以在这里查看:<a href="https://github.com/printempw/blessing-skin-server/wiki/%E6%9B%B4%E6%96%B0%E6%BA%90%E5%88%97%E8%A1%A8">@GitHub Wiki</a>');
})->handle()->always(function($form) {
try {
$response = file_get_contents(option('update_source'));
} catch (\Exception $e) {
$form->addMessage('无法访问当前更新源。详细信息:'.$e->getMessage(), 'danger');
}
});
return view('admin.update')->with('info', $info);
return view('admin.update')->with('info', $info)->with('update', $update);
}
public function checkUpdates()

View File

@ -1,70 +1,80 @@
index:
total-users: Registered Users
total-players: Players
total-textures: Uploaded Textures
disk-usage: Disk Usage
overview: Overview
customize:
change-color: Change theme color
color:
colors:
blue: Blue (Default)
blue-white-sidebar: Blue with white sidebar
blue-light: Blue Light
yellow: Yellow
yellow-white-sidebar: Yellow with white sidebar
yellow-light: Yellow Light
green: Green
green-white-sidebar: Green with white sidebar
green-light: Green Light
purple: Purple
purple-white-sidebar: Purple with white sidebar
purple-light: Purple Light
red: Red
red-white-sidebar: Red with white sidebar
red-light: Red Light
black: Black
black-white-sidebar: Black with white sidebar
index:
users-count: 注册用户
players-count: 角色总数
textures-count: 上传材质总数
usage: Usage
overview: Overview
black-light: Black Light
plugins:
name: Name
description: Description
author: Author
version: Version
status: Status
opration: Opration
enabled: Enabled
disabled: Disabled
disable-plugin: Disable plugin
enable-plugin: Enable plugin
plugin-config: Plugin configuration
no-cofig: Plugin has been disabled or no configuration.
delete-plugin: delete-plugin
status:
title: Status
enabled: Enabled
disabled: Disabled
no-result: No result
operations:
title: Operations
disable: Disable
enable: Enable
configure: Configure
no-config-notice: The plugin has been disabled or no configuration is provided.
delete: Delete
empty: No result
update:
update-info: Update information
update-available: New version available.
latest-version: 'Latest version:'
current-version: 'Current version'
release-time: 'Release time:'
change-log: 'Change log:'
no-log: 'Empty'
download-link: 'Download link:'
download-full: Click here to download full zip file
pre-release-warning: 本次更新为预发布版,请谨慎选择是否更新。
latest-now: It is latest version.
pre-release: 当前版本为未发布测试版
button: Update
check-forum: 查看 MCBBS 发布贴
forum-url: 'http://www.mcbbs.net/thread-552877-1-1.html'
caution: Cautions
choose-source: Please choose update source according to location (China or not) of your server.
choose-wrong: 如错选至相对于你的主机速度较慢的源,可能会造成检查/下载更新页面长时间无响应。
update-options: Update options
config-saved: Saved
connection-error: 无法访问当前更新源。详细信息:
check-update: Check update
auto-check: 自动检查更新并提示
source: Sources
source-list: Available sources list
downloading: Downloading
size: 'Package size:'
info:
title: Update Information
up-to-date: Already up-to-date.
available: New version available.
pre-release-warning: This update is a pre-release, please double check before updating.
versions:
latest: "Latest Version:"
current: "Current Version:"
release-time: "Release Time:"
pre-release: You are now using pre-release version.
change-log:
text: "Change Log:"
empty: Empty
downloads:
text: "Download Link:"
link: Click to download full program package.
check-github: <a href=":url" target="_blank" class="btn btn-default pull-right">Check GitHub Releases</a>
button: Update Now
cautions:
title: Cautions
text: |
Please choose update source according to your host location.
Low-speed connection between update source and your host will cause long-time loading at checking/downloading page.
download:
downloading: Downloading update package...
size: "Size of package:"

View File

@ -13,11 +13,11 @@ anonymous: Guest
back: Back
dashboard: Dashboard
my-closet: Closet
player-manage: Player Manage
user-manage: User Manage
plugin-manage: Plugin Manage
player-manage: Players
user-manage: Users
plugin-manage: Plugins
plugin-market: Plugin Market
plugin-installed: Installed
plugin-installed: Installed Plugins
customize: Customize
options: Options
import-v2: Import Data

View File

@ -127,14 +127,14 @@
cape: 'Cape',
pid: 'Texture ID',
pidNotice: 'Please enter the tid of texture',
changePlayerTexture: 'Change textures of :player'
changePlayerTexture: 'Change textures of :player',
// Index
textureUpload: 'Texture Upload',
registration: 'Registration'
textureUploads: 'Texture Uploads',
userRegistration: 'User Registration',
// Plugins
deletionConfirmation: 'Really delete this plugin?'
confirmDeletion: 'Are you sure to delete this plugin?'
},
utils: {
fatalError: 'Fatal Error (Please contact the author)'

View File

@ -1,70 +0,0 @@
customize:
change-color: 更改配色
color:
blue: 蓝色主题(默认)
blue-white-sidebar: 蓝色主题-白色侧边栏
yellow: 黄色主题
yellow-white-sidebar: 黄色主题-白色侧边栏
green: 绿色主题
green-white-sidebar: 绿色主题-白色侧边栏
purple: 基佬紫
purple-white-sidebar: 紫色主题-白色侧边栏
red: 喜庆红(笑)
red-white-sidebar: 红色主题-白色侧边栏
black: 高端黑
black-white-sidebar: 黑色主题-白色侧边栏
index:
users-count: 注册用户
players-count: 角色总数
textures-count: 上传材质总数
usage: 占用空间大小
overview: 概览
plugins:
name: 名称
description: 描述
author: 作者
version: 版本
status: 状态
opration: 操作
enabled: 已启用
disabled: 已禁用
disable-plugin: 禁用插件
enable-plugin: 启用插件
plugin-config: 插件配置
no-cofig: 插件已被禁用或无配置页
delete-plugin: 删除插件
no-result: 无结果
update:
update-info: 更新信息
update-available: 有更新可用。
latest-version: 最新版本:
current-version: 当前版本:
release-time: 发布时间:
change-log: 更新日志:
no-log: 无内容
download-link: 下载地址:
download-full: 点击下载完整安装包
pre-release-warning: 本次更新为预发布版,请谨慎选择是否更新。
latest-now: 已更新至最新版本。
pre-release: 当前版本为未发布测试版
button: 马上升级
check-forum: 查看 MCBBS 发布贴
forum-url: 'http://www.mcbbs.net/thread-552877-1-1.html'
caution: 注意事项
choose-source: 请根据你的主机所在位置(国内/国外)选择更新源。
choose-wrong: 如错选至相对于你的主机速度较慢的源,可能会造成检查/下载更新页面长时间无响应。
update-options: 更新选项
config-saved: 设置已保存。
connection-error: 无法访问当前更新源。详细信息:
check-update: 检查更新
auto-check: 自动检查更新并提示
source: 更新源
source-list: 可用的更新源列表可以在这里查看:
downloading: 正在下载更新包
size: 更新包大小:

View File

@ -0,0 +1,80 @@
index:
total-users: 注册用户
total-players: 角色总数
total-textures: 上传材质总数
disk-usage: 占用空间大小
overview: 概览
customize:
change-color: 更改配色
colors:
blue: 蓝色主题(默认)
blue-light: 蓝色主题 - 白色侧边栏
yellow: 黄色主题
yellow-light: 黄色主题 - 白色侧边栏
green: 绿色主题
green-light: 绿色主题 - 白色侧边栏
purple: 基佬紫
purple-light: 紫色主题 - 白色侧边栏
red: 喜庆红(笑)
red-light: 红色主题 - 白色侧边栏
black: 高端黑
black-light: 黑色主题 - 白色侧边栏
plugins:
name: 名称
description: 描述
author: 作者
version: 版本
status:
title: 状态
enabled: 已启用
disabled: 已禁用
operations:
title: 操作
disable: 禁用插件
enable: 启用插件
configure: 插件配置
no-config-notice: 插件已被禁用或无配置页
delete: 删除插件
empty: 无结果
update:
info:
title: 更新信息
up-to-date: 已更新至最新版本。
available: 有更新可用。
pre-release-warning: 本次更新为预发布版,请谨慎选择是否更新。
versions:
latest: 最新版本:
current: 当前版本:
release-time: 发布时间:
pre-release: 当前版本为未发布测试版
change-log:
text: 更新日志:
empty: 无内容
downloads:
text: 下载地址:
link: 点击下载完整安装包
check-github: <a href=":url" target="_blank" class="btn btn-default pull-right">查看 GitHub Releases</a>
button: 马上升级
cautions:
title: 注意事项
text: |
请根据你的主机所在位置(国内/国外)选择更新源。
如错选至相对于你的主机速度较慢的源,可能会造成检查/下载更新页面长时间无响应。
download:
downloading: 正在下载更新包
size: 更新包大小:

View File

@ -127,14 +127,14 @@
cape: '披风',
pid: '材质 ID',
pidNotice: '输入要更换的材质的 TID',
changePlayerTexture: '更换角色 :player 的材质'
changePlayerTexture: '更换角色 :player 的材质',
// Index
textureUpload: '材质上传',
registration: '用户注册'
textureUploads: '材质上传',
userRegistration: '用户注册',
// Plugins
deletionConfirmation: '真的要删除这个插件吗?'
confirmDeletion: '真的要删除这个插件吗?'
},
utils: {
fatalError: '严重错误(请联系作者)'

View File

@ -30,54 +30,14 @@
<div class="box-body no-padding">
<table id="layout-skins-list" class="table table-striped bring-up nth-2-center">
<tbody>
<tr>
<td>{{ trans('admin.customize.color.blue') }}</td>
<td><a href="#" data-skin="skin-blue" class="btn btn-primary btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.blue-white-sidebar') }}</td>
<td><a href="#" data-skin="skin-blue-light" class="btn btn-primary btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.yellow') }}</td>
<td><a href="#" data-skin="skin-yellow" class="btn btn-warning btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.yellow-white-sidebar') }}</td>
<td><a href="#" data-skin="skin-yellow-light" class="btn btn-warning btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.green') }}</td>
<td><a href="#" data-skin="skin-green" class="btn btn-success btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.green-white-sidebar') }}</td>
<td><a href="#" data-skin="skin-green-light" class="btn btn-success btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.purple') }}</td>
<td><a href="#" data-skin="skin-purple" class="btn bg-purple btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.purple-white-sidebar') }}</td>
<td><a href="#" data-skin="skin-purple-light" class="btn bg-purple btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.red') }}</td>
<td><a href="#" data-skin="skin-red" class="btn btn-danger btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.red-white-sidebar') }}</td>
<td><a href="#" data-skin="skin-red-light" class="btn btn-danger btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.black') }}</td>
<td><a href="#" data-skin="skin-black" class="btn bg-black btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
<tr>
<td>{{ trans('admin.customize.color.black-white-sidebar') }}</td>
<td><a href="#" data-skin="skin-black-light" class="btn bg-black btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
@foreach(['blue', 'yellow', 'green', 'purple', 'red', 'black'] as $color)
@foreach([$color, "$color-light"] as $innerColor)
<tr>
<td>{{ trans("admin.customize.colors.$innerColor") }}</td>
<td><a href="#" data-skin="skin-{{ $innerColor }}" class="btn bg-{{ $color }} btn-xs"><i class="fa fa-eye"></i></a></td>
</tr>
@endforeach
@endforeach
</tbody>
</table>
</div><!-- /.box-body -->

View File

@ -25,7 +25,7 @@
<a href="{{ url('admin/users') }}">
<span class="info-box-icon bg-aqua"><i class="fa fa-users"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('admin.index.users-count') }}</span>
<span class="info-box-text">{{ trans('admin.index.total-users') }}</span>
<span class="info-box-number">{{ App\Models\User::all()->count() }}</span>
</div><!-- /.info-box-content -->
</a>
@ -37,7 +37,7 @@
<a href="{{ url('admin/players') }}">
<span class="info-box-icon bg-green"><i class="fa fa-gamepad"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('admin.index.players-count') }}</span>
<span class="info-box-text">{{ trans('admin.index.total-players') }}</span>
<span class="info-box-number">{{ App\Models\Player::all()->count() }}</span>
</div><!-- /.info-box-content -->
</a>
@ -48,7 +48,7 @@
<div class="info-box">
<span class="info-box-icon bg-aqua" style="background-color: #605ca8 !important;"><i class="fa fa-files-o"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('admin.index.textures-count') }}</span>
<span class="info-box-text">{{ trans('admin.index.total-textures') }}</span>
<span class="info-box-number">{{ \Database::table('textures')->getRecordNum() }}</span>
</div><!-- /.info-box-content -->
</div><!-- /.info-box -->
@ -56,7 +56,7 @@
<div class="info-box">
<span class="info-box-icon bg-yellow"><i class="fa fa-hdd-o"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('admin.index.usage') }}</span>
<span class="info-box-text">{{ trans('admin.index.disk-usage') }}</span>
<?php $size = \Database::table('textures')->fetchArray("SELECT SUM(`size`) AS total_size FROM `{table}` WHERE 1")['total_size'] ?: 0; ?>
<span class="info-box-number">{{ $size > 1024 ? round($size / 1024, 1)."MB" : $size."KB" }}</span>
</div><!-- /.info-box-content -->
@ -113,7 +113,7 @@
labels: {!! json_encode($labels) !!},
datasets: [
{
label: trans("admin.textureUpload"),
label: trans("admin.textureUploads"),
fillColor: "rgba(210, 214, 222, 1)",
strokeColor: "rgba(210, 214, 222, 1)",
pointColor: "rgba(210, 214, 222, 1)",
@ -123,7 +123,7 @@
data: {!! json_encode($data['texture_upload']) !!}
},
{
label: trans("admin.registration"),
label: trans("admin.userRegistration"),
fillColor: "rgba(60,141,188,0.9)",
strokeColor: "rgba(60,141,188,0.8)",
pointColor: "#3b8bba",

View File

@ -36,8 +36,8 @@ td#description {
<th>{{ trans('admin.plugins.description') }}</th>
<th>{{ trans('admin.plugins.author') }}</th>
<th>{{ trans('admin.plugins.version') }}</th>
<th>{{ trans('admin.plugins.status') }}</th>
<th>{{ trans('admin.plugins.operation') }}</th>
<th>{{ trans('admin.plugins.status.title') }}</th>
<th>{{ trans('admin.plugins.operations.title') }}</th>
</tr>
</thead>
@ -50,33 +50,33 @@ td#description {
<td id="version">{{ $plugin->version }}</td>
<td id="status">
@if ($plugin->isEnabled())
{{ trans('admin.plugins.enabled') }}
{{ trans('admin.plugins.status.enabled') }}
@else
{{ trans('admin.plugins.disabled') }}
{{ trans('admin.plugins.status.disabled') }}
@endif
</td>
<td>
@if ($plugin->isEnabled())
<a class="btn btn-warning btn-sm" href="?action=disable&id={{ $plugin->name }}">{{ trans('admin.plugins.disable-plugin') }}</a>
<a class="btn btn-warning btn-sm" href="?action=disable&id={{ $plugin->name }}">{{ trans('admin.plugins.operations.disable') }}</a>
@else
<a class="btn btn-primary btn-sm" href="?action=enable&id={{ $plugin->name }}">{{ trans('admin.plugins.enable-plugin') }}</a>
<a class="btn btn-primary btn-sm" href="?action=enable&id={{ $plugin->name }}">{{ trans('admin.plugins.operations.enable') }}</a>
@endif
@if ($plugin->isEnabled() && $plugin->hasConfigView())
<a class="btn btn-default btn-sm" href="?action=config&id={{ $plugin->name }}">{{ trans('admin.plugins.plugin-config') }}</a>
<a class="btn btn-default btn-sm" href="?action=config&id={{ $plugin->name }}">{{ trans('admin.plugins.operations.configure') }}</a>
@else
<a class="btn btn-default btn-sm" disabled="disabled" title="{{ trans('admin.plugins.no-config') }}" data-toggle="tooltip" data-placement="top">{{ trans('admin.plugins.no-config') }}</a>
<a class="btn btn-default btn-sm" disabled="disabled" title="{{ trans('admin.plugins.operations.no-config-notice') }}" data-toggle="tooltip" data-placement="top">{{ trans('admin.plugins.operations.configure') }}</a>
@endif
<a class="btn btn-danger btn-sm" href="javascript:deletePlugin('{{ $plugin->name }}');">{{ trans('admin.plugins.delete-plugin') }}</a>
<a class="btn btn-danger btn-sm" href="javascript:deletePlugin('{{ $plugin->name }}');">{{ trans('admin.plugins.operations.delete') }}</a>
</td>
</tr>
@empty
<tr>
<td>0</td>
<td>{{ trans('admin.plugins.no-result') }}</td>
<td>{{ trans('admin.plugins.empty') }}</td>
<td>(´・ω・`)</td>
</tr>
@endforelse
@ -105,7 +105,7 @@ td#description {
function deletePlugin(name) {
swal({
text: trans('admin.deletionConfirmation'),
text: trans('admin.confirmDeletion'),
type: 'warning',
showCancelButton: true
}).then(function() {

View File

@ -27,67 +27,67 @@
<div class="col-md-6">
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('admin.update.update-info') }}</h3>
<h3 class="box-title">{{ trans('admin.update.info.title') }}</h3>
</div><!-- /.box-header -->
<div class="box-body">
@if ($info['new_version_available'])
<div class="callout callout-info">{{ trans('admin.update.update-available') }}</div>
<div class="callout callout-info">{{ trans('admin.update.info.available') }}</div>
<table class="table">
<tbody>
<tr>
<td class="key">{{ trans('admin.update.latest-version') }}</td>
<td class="key">{{ trans('admin.update.info.versions.latest') }}</td>
<td class="value">
v{{ $info['latest_version'] }}
</td>
</tr>
<tr>
<td class="key">{{ trans('admin.update.current-version') }}</td>
<td class="key">{{ trans('admin.update.info.versions.current') }}</td>
<td class="value">
v{{ $info['current_version'] }}
</td>
</tr>
<tr>
<td class="key">{{ trans('admin.update.release-time') }}</td>
<td class="key">{{ trans('admin.update.info.release-time') }}</td>
<td class="value">
{{ Utils::getTimeFormatted($info['release_time']) }}
</td>
</tr>
<tr>
<td class="key">{{ trans('admin.update.change-log') }}</td>
<td class="key">{{ trans('admin.update.info.change-log.text') }}</td>
<td class="value">
{!! nl2br($info['release_note']) ?: "{{ trans('admin.update.no-log') }}" !!}
{!! nl2br($info['release_note']) ?: trans('admin.update.info.change-log.empty') !!}
</td>
</tr>
<tr>
<td class="key">{{ trans('admin.update.download-link') }}</td>
<td class="key">{{ trans('admin.update.info.downloads.text') }}</td>
<td class="value">
<a href="{!! $info['release_url'] !!}">{{ trans('admin.update.download-full') }}</a>
<a href="{!! $info['release_url'] !!}">{{ trans('admin.update.info.downloads.link') }}</a>
</td>
</tr>
@if($info['pre_release'])
<div class="callout callout-warning">{{ trans('admin.update.pre-release-warning') }}</div>
<div class="callout callout-warning">{{ trans('admin.update.info.pre-release-warning') }}</div>
@endif
</tbody>
</table>
@else
<div class="callout callout-success">{{ trans('admin.update.latest-now') }}</div>
<div class="callout callout-success">{{ trans('admin.update.info.up-to-date') }}</div>
<table class="table">
<tbody>
<tr>
<td class="key">{{ trans('admin.update.current-version') }}</td>
<td class="key">{{ trans('admin.update.info.versions.current') }}</td>
<td class="value">
v{{ $info['current_version'] }}
</td>
</tr>
<tr>
<td class="key">{{ trans('admin.update.release-time') }}</td>
<td class="key">{{ trans('admin.update.info.release-time') }}</td>
<td class="value">
@if (isset($info['release_time']))
@if ($info['release_time'])
{{ Utils::getTimeFormatted($info['release_time']) }}
@else
{{ trans('admin.update.pre-release') }}
{{ trans('admin.update.info.pre-release') }}
@endif
</td>
</tr>
@ -96,75 +96,23 @@
@endif
</div><!-- /.box-body -->
<div class="box-footer">
<a class="btn btn-primary" id="update-button" {!! !$info['new_version_available'] ? 'disabled="disabled"' : 'href="javascript:downloadUpdates();"' !!}>{{ trans('admin.update.button') }}</a>
<a href="{{ trans('admin.update.forum-url') }}" style="float: right;" class="btn btn-default">{{ trans('admin.update.check-forum') }}</a>
<a class="btn btn-primary" id="update-button" {!! !$info['new_version_available'] ? 'disabled="disabled"' : 'href="javascript:downloadUpdates();"' !!}>{{ trans('admin.update.info.button') }}</a>
{!! trans('admin.update.info.check-github', ['url' => 'https://github.com/printempw/blessing-skin-server/releases']) !!}
</div>
</div>
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('admin.update.caution') }}</h3>
<h3 class="box-title">{{ trans('admin.update.cautions.title') }}</h3>
</div><!-- /.box-header -->
<div class="box-body">
<p>{{ trans('admin.update.choose-source') }}</p>
<p>{{ trans('admin.update.choose-wrong') }}</p>
<p>{!! nl2br(trans('admin.update.cautions.text')) !!}</p>
</div><!-- /.box-body -->
</div>
</div>
<div class="col-md-6">
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('admin.update.update-options') }}</h3>
</div><!-- /.box-header -->
<form method="post">
<div class="box-body">
<?php
if (isset($_POST['submit'])) {
$_POST['check_update'] = isset($_POST['check_update']) ? $_POST['check_update'] : "0";
foreach ($_POST as $key => $value) {
if ($key != "option" && $key != "submit")
Option::set($key, $value);
}
echo '<div class="callout callout-success">{{ trans('admin.update.config-saved') }}</div>';
}
try {
$response = file_get_contents(option('update_source'));
} catch (Exception $e) {
echo '<div class="callout callout-danger">{{ trans('admin.update.connection-error') }}'.$e->getMessage().'</div>';
}
?>
<table class="table">
<tbody>
<tr>
<td class="key">{{ trans('admin.update.check-update') }}</td>
<td class="value">
<label for="check_update">
<input {{ (option('check_update') == '1') ? 'checked="true"' : '' }} type="checkbox" id="check_update" name="check_update" value="1"> {{ trans('admin.update.auto-check') }}
</label>
</td>
</tr>
<tr>
<td class="key">{{ trans('admin.update.source') }}</td>
<td class="value">
<input type="text" class="form-control" name="update_source" value="{{ option('update_source') }}">
<p class="description">{{ trans('admin.update.source-list') }}<a href="https://github.com/printempw/blessing-skin-server/wiki/%E6%9B%B4%E6%96%B0%E6%BA%90%E5%88%97%E8%A1%A8">@GitHub Wiki</a></p>
</td>
</tr>
</tbody>
</table>
</div><!-- /.box-body -->
<div class="box-footer">
<button type="submit" name="submit" class="btn btn-primary">{{ trans('general.submit') }}</button>
</div>
</form>
</div>
{!! $update->render() !!}
</div>
</div>