Commit f873d7fa by mushishixian

全局样式

parent d8cdbd89
<?php
namespace App\Admin\Actions;
use App\Admin\Forms\AdminSetting as AdminSettingForm;
use Dcat\Admin\Actions\Action;
use Dcat\Admin\Widgets\Modal;
class AdminSetting extends Action
{
/**
* @return string
*/
protected $title = '<i class="feather icon-settings" style="font-size: 1.5rem"></i>';
public function render()
{
$modal = Modal::make()
->id('admin-setting-config') // 导航栏显示弹窗,必须固定ID,随机ID会在刷新后失败
->title($this->title())
->body(AdminSettingForm::make())
->lg()
->button(
<<<HTML
<ul class="nav navbar-nav">
<li class="nav-item"> &nbsp;{$this->title()} &nbsp;</li>
</ul>
HTML
);
return $modal->render();
}
}
......@@ -6,4 +6,6 @@ use Dcat\Admin\Http\Controllers\AuthController as BaseAuthController;
class AuthController extends BaseAuthController
{
// 自定义登陆view模板
protected $view = 'admin.login';
}
......@@ -19,7 +19,7 @@ class UserAddressController extends AdminController
{
return Grid::make(new UserAddress(), function (Grid $grid) {
$grid->column('id')->sortable();
$grid->column('user_id');
$grid->column('user_id')->width(70);
$grid->column('country');
$grid->column('first_name');
$grid->column('last_name');
......@@ -29,10 +29,9 @@ class UserAddressController extends AdminController
$grid->column('postal_code');
$grid->column('created_at');
$grid->column('updated_at')->sortable();
$grid->filter(function (Grid\Filter $filter) {
$filter->equal('id');
});
});
}
......@@ -78,7 +77,7 @@ class UserAddressController extends AdminController
$form->text('address_line2');
$form->text('city');
$form->text('postal_code');
$form->display('created_at');
$form->display('updated_at');
});
......
<?php
namespace App\Admin\Forms;
use Dcat\Admin\Contracts\LazyRenderable;
use Dcat\Admin\Traits\LazyWidget;
use Dcat\Admin\Widgets\Form;
use Illuminate\Support\Arr;
class AdminSetting extends Form implements LazyRenderable
{
use LazyWidget;
/**
* 主题颜色.
*
* @var array
*/
protected $colors = [
'default' => 'Default',
'blue' => 'Blue',
'blue-light' => 'Blue Light',
// 'blue-dark' => 'Blue Dark',
'green' => 'Green',
];
protected $sidebarStyle = [
'light',
'primary',
'dark',
];
/**
* 处理表单请求.
*
* @param array $input
*
* @return mixed
*/
public function handle(array $input)
{
$input['layout']['horizontal_menu'] = in_array('horizontal_menu', $input['layout']['body_class'], true);
foreach (Arr::dot($input) as $k => $v) {
$this->update($k, $v);
}
return $this->response()->success(trans('admin.succeeded'));
}
/**
* 构建表单.
*/
public function form()
{
$this->radio('lang', trans('admin.lang'))->required()->options(['en' => 'English', 'zh_CN' => '简体中文']);
$this->radio('layout.color', trans('admin.layout.color'))
->required()
->options($this->colors);
$this->radio('layout.sidebar_style', trans('admin.layout.sidebar_style'))
->options(['light' => 'Light', 'primary' => 'Primary', 'dark' => 'Dark']);
$this->radio('layout.navbar_color', trans('admin.layout.navbar_color'))
->options([
'bg-primary' => 'Primary',
'bg-info' => 'Info',
'bg-warning' => 'Warning',
'bg-success' => 'Success',
'bg-danger' => 'Danger',
'bg-dark' => 'Dark',
]);
$this->checkbox('layout.body_class', trans('admin.layout.sidebar_style'))
->options([
'horizontal_menu' => 'Horizontal',
'sidebar-separate' => 'Sidebar Separate',
]);
}
/**
* 设置接口保存成功后的回调JS代码.
*
* 1.2秒后刷新整个页面.
*
* @return string|void
*/
public function savedScript()
{
return <<<'JS'
if (data.status) {
setTimeout(function () {
location.reload()
}, 1200);
}
JS;
}
/**
* 返回表单数据.
*
* @return array
*/
public function default()
{
return user_admin_config();
}
/**
* 更新配置.
*
* @param string $key
* @param string $value
*/
protected function update($key, $value)
{
user_admin_config([$key => $value]);
}
}
<?php
namespace App\Admin\Forms;
use Dcat\Admin\Models\Administrator;
use Dcat\Admin\Support\Helper;
use Dcat\Admin\Traits\LazyWidget;
use Dcat\Admin\Widgets\Form;
use Dcat\Admin\Contracts\LazyRenderable;
class ResetPassword extends Form implements LazyRenderable
{
use LazyWidget; // 使用异步加载功能
// 处理请求
public function handle(array $input)
{
// 获取外部传递参数
//$id = $this->payload['id'] ?? null;
$id = Helper::array($input['id'] ?? null);
// 表单参数
$password = $input['password'] ?? null;
if (! $id) {
return $this->error('参数错误');
}
$user = Administrator::query()->find($id);
if (! $user) {
return $this->error('用户不存在');
}
$user->update(['password' => bcrypt($password)]);
return $this->success('密码修改成功');
}
public function form()
{
// 获取外部传递参数
//$id = $this->payload['id'] ?? null;
$this->password('password')->required();
// 密码确认表单
$this->password('password_confirm')->same('password');
$this->hidden('id')->attribute('id', 'reset-password-id');
}
// 返回表单数据,如不需要可以删除此方法
public function default()
{
return [
'password' => '',
'password_confirm' => '',
];
}
}
<?php
namespace App\Admin\Forms;
use Dcat\Admin\Widgets\Form;
use Symfony\Component\HttpFoundation\Response;
class Setting extends Form
{
/**
* Handle the form request.
*
* @param array $input
*
* @return Response
*/
public function handle(array $input)
{
// dump($input);
// return $this->error('Your error message.');
return $this->success('Processed successfully.', '/');
}
/**
* Build a form here.
*/
public function form()
{
$this->text('name')->required();
$this->email('email')->rules('email');
}
/**
* The data of the form.
*
* @return array
*/
public function default()
{
return [
'name' => 'John Doe',
'email' => 'John.Doe@gmail.com',
];
}
}
<?php
namespace App\Admin\Forms;
use Dcat\Admin\Contracts\LazyRenderable;
use Dcat\Admin\Traits\LazyWidget;
use Dcat\Admin\Widgets\Form;
class UserProfile extends Form implements LazyRenderable
{
use LazyWidget;
public function handle(array $input)
{
return $this->success('保存成功');
}
public function default()
{
return [
// 展示上个页面传递过来的值
'name' => $this->payload['name'] ?? '',
];
}
public function form()
{
$this->text('name', trans('admin.name'))->required()->help('用户昵称');
$this->image('avatar', trans('admin.avatar'))->autoUpload();
$this->password('old_password', trans('admin.old_password'));
$this->password('password', trans('admin.password'))
->minLength(5)
->maxLength(20)
->customFormat(function ($v) {
if ($v == $this->password) {
return;
}
return $v;
})
->help('请输入5-20个字符');
$this->password('password_confirmation', trans('admin.password_confirmation'))
->same('password')
->help('请输入确认密码');
}
}
......@@ -4,6 +4,7 @@ use Dcat\Admin\Admin;
use Dcat\Admin\Grid;
use Dcat\Admin\Form;
use Dcat\Admin\Grid\Filter;
use Dcat\Admin\Layout\Navbar;
use Dcat\Admin\Show;
/**
......@@ -24,3 +25,117 @@ use Dcat\Admin\Show;
* Admin::js('/packages/prettydocs/js/main.js');
*
*/
// 覆盖默认配置
config(['admin' => user_admin_config()]);
config(['app.locale' => config('admin.lang') ?: config('app.locale')]);
$primaryColor = Admin::color()->primary();
Admin::style(
<<<CSS
body {
font-size: 12px;
}
[class*=sidebar-dark-] {
background-image: linear-gradient(0deg, #191A23, #191A23);
}
.nav-link {
color: #B7B7B3;
font-weight: 200;
font-size:14px!important;
}
.nav-item {
margin-top:3px;
margin-bottom:3px;
}
a.nav-link.active {
background-color: $primaryColor!important;
}
body:not(.dark-mode) .table-collapse .custom-data-table tbody td {
height:30px;
}
body.dark-mode .table-collapse table.custom-data-table.data-table tbody td {
height:30px;
}
.form-group {
margin-bottom:5px;
}
.content-header {
display:none;
}
.datetime-range-fix {
}
/* .input-group {
max-height:30px;
} */
.table-main{
table-layout: fixed;
width: 100%;
}
.table-main table.custom-data-table td,
.table-main table.custom-data-table th{
z-index: 0;
}
.table-main table.custom-data-table thead,
.table-fixed table.custom-data-table thead tr th{
position: sticky;
top: 0;
background-color: #ececf1;
}
.table-fixed table.custom-data-table thead tr th {
z-index: 99;
}
CSS
);
// 追加菜单
Admin::menu()->add(include __DIR__.'/menu.php', 0);
Admin::navbar(function (Navbar $navbar) {
$method = config('admin.layout.horizontal_menu') ? 'left' : 'right';
$navbar->$method(
<<<HTML
<ul class="nav navbar-nav">
</ul>
HTML
);
// ajax请求不执行
if (! Dcat\Admin\Support\Helper::isAjaxRequest()) {
$navbar->$method(App\Admin\Actions\AdminSetting::make()->render());
}
// $navbar->right(view('admin.navbar-2'));
// 搜索框
$navbar->right(
<<<HTML
HTML
);
// 下拉面板
// $navbar->right(view('admin.navbar-1'));
});
Grid::resolving(function (Grid $grid) {
$grid->tableCollapse(true);
// $grid->withBorder();
$grid->paginate(20);
$grid->fixColumns(2);
});
<?php
return [
];
......@@ -13,5 +13,6 @@ Route::group([
], function (Router $router) {
$router->get('/', 'HomeController@index');
$router->resource('userAddress', 'UserAddressController');
});
<?php
namespace App\Http\Middleware;
use Dcat\Admin\Admin;
use Dcat\Admin\Http\Auth\Permission;
use Illuminate\Http\Request;
use Symfony\Component\HttpKernel\Exception\HttpException;
class AccessControl
{
protected $denyMethods = ['POST', 'PUT', 'DELETE'];
protected $excepts = [
'POST' => [
'admin/auth/login',
'admin/form/step',
'admin/form',
'admin/dcat-api/value',
'admin/helpers/scaffold/table',
'admin/dcat-api/form',
],
];
public function handle(Request $request, \Closure $next)
{
// if (! config('app.deny_update')) {
// return $next($request);
// }
//
// foreach ($this->excepts as $method => $route) {
// if ($request->isMethod($method) && $request->is(...$route)) {
// return $next($request);
// }
// }
//
// if (in_array($request->getMethod(), $this->denyMethods)) {
// try {
// Permission::error();
// } catch (HttpException $e) {
// return Admin::json()->error('对不起,演示站点不支持修改数据。')->send();
// }
// }
return $next($request);
}
}
......@@ -14,6 +14,7 @@ class AppServiceProvider extends ServiceProvider
public function register()
{
//
require_once __DIR__.'/../helpers.php';
}
/**
......
<?php
use Illuminate\Support\Arr;
if (! function_exists('user_admin_config')) {
function user_admin_config($key = null, $value = null)
{
$session = session();
if (! $config = $session->get('admin.config')) {
$config = config('admin');
$config['lang'] = config('app.locale');
}
if (is_array($key)) {
// 保存
foreach ($key as $k => $v) {
Arr::set($config, $k, $v);
}
$session->put('admin.config', $config);
return;
}
if ($key === null) {
return $config;
}
return Arr::get($config, $key, $value);
}
}
......@@ -11,7 +11,7 @@ return [
| login page.
|
*/
'name' => 'Dcat Admin',
'name' => 'Semour Admin',
/*
|--------------------------------------------------------------------------
......@@ -22,7 +22,7 @@ return [
| `img` tag, eg '<img src="http://logo-url" alt="Admin logo">'.
|
*/
'logo' => '<img src="/vendor/dcat-admin/images/logo.png" width="35"> &nbsp;Dcat Admin',
'logo' => '<img src="/vendor/dcat-admin/images/logo.png" width="35"> &nbsp;Semour Admin',
/*
|--------------------------------------------------------------------------
......@@ -330,12 +330,12 @@ return [
'sidebar_collapsed' => false,
// light, primary, dark
'sidebar_style' => 'light',
'sidebar_style' => 'dark',
'dark_mode_switch' => false,
'dark_mode_switch' => true,
// bg-primary, bg-info, bg-warning, bg-success, bg-danger, bg-dark
'navbar_color' => '',
'navbar_color' => 'bg-dark',
],
/*
......
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="facebook-f" class="svg-inline--fa fa-facebook-f fa-w-9" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 264 512"><path fill="currentColor" d="M215.8 85H264V3.6C255.7 2.5 227.1 0 193.8 0 124.3 0 76.7 42.4 76.7 120.3V192H0v91h76.7v229h94V283h73.6l11.7-91h-85.3v-62.7c0-26.3 7.3-44.3 45.1-44.3z"></path></svg>
\ No newline at end of file
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="github-alt" class="svg-inline--fa fa-github-alt fa-w-15" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 480 512"><path fill="currentColor" d="M186.1 328.7c0 20.9-10.9 55.1-36.7 55.1s-36.7-34.2-36.7-55.1 10.9-55.1 36.7-55.1 36.7 34.2 36.7 55.1zM480 278.2c0 31.9-3.2 65.7-17.5 95-37.9 76.6-142.1 74.8-216.7 74.8-75.8 0-186.2 2.7-225.6-74.8-14.6-29-20.2-63.1-20.2-95 0-41.9 13.9-81.5 41.5-113.6-5.2-15.8-7.7-32.4-7.7-48.8 0-21.5 4.9-32.3 14.6-51.8 45.3 0 74.3 9 108.8 36 29-6.9 58.8-10 88.7-10 27 0 54.2 2.9 80.4 9.2 34-26.7 63-35.2 107.8-35.2 9.8 19.5 14.6 30.3 14.6 51.8 0 16.4-2.6 32.7-7.7 48.2 27.5 32.4 39 72.3 39 114.2zm-64.3 50.5c0-43.9-26.7-82.6-73.5-82.6-18.9 0-37 3.4-56 6-14.9 2.3-29.8 3.2-45.1 3.2-15.2 0-30.1-.9-45.1-3.2-18.7-2.6-37-6-56-6-46.8 0-73.5 38.7-73.5 82.6 0 87.8 80.4 101.3 150.4 101.3h48.2c70.3 0 150.6-13.4 150.6-101.3zm-82.6-55.1c-25.8 0-36.7 34.2-36.7 55.1s10.9 55.1 36.7 55.1 36.7-34.2 36.7-55.1-10.9-55.1-36.7-55.1z"></path></svg>
\ No newline at end of file
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="google" class="svg-inline--fa fa-google fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 488 512"><path fill="currentColor" d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"></path></svg>
\ No newline at end of file
<svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="twitter" class="svg-inline--fa fa-twitter fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg>
\ No newline at end of file
......@@ -2,16 +2,17 @@
return [
'titles' => [
'index' => '主页',
'admin' => '系统',
'users' => '管理员',
'roles' => '角色',
'permission' => '权限',
'menu' => '菜单',
'index' => '主页',
'admin' => '系统',
'users' => '管理员',
'roles' => '角色',
'permission' => '权限',
'menu' => '菜单',
'operation_log' => '操作日志',
'helpers' => '开发工具',
'extensions' => '扩展',
'scaffold' => '代码生成器',
'icons' => '图标',
'helpers' => '开发工具',
'extensions' => '扩展',
'scaffold' => '代码生成器',
'icons' => '图标',
'userAddress' => '用户地址',
],
];
<style>
.row {
margin: 0;
}
.col-md-12,
.col-md-3 {
padding: 0;
}
@media screen and (min-width: 1000px) and (max-width: 1150px) {
.col-lg-3,
.col-lg-9 {
flex: 0 0 50%;
max-width: 50%;
}
}
@media screen and (min-width: 1151px) and (max-width: 1300px) {
.col-lg-3 {
flex: 0 0 40%;
max-width: 40%;
}
.col-lg-9 {
flex: 0 0 60%;
max-width: 60%;
}
}
@media screen and (min-width: 1301px) and (max-width: 1700px) {
.col-lg-3 {
flex: 0 0 35%;
max-width: 35%;
}
.col-lg-9 {
flex: 0 0 65%;
max-width: 65%;
}
}
.login-page {
height: auto;
}
.login-main {
position: relative;
display: flex;
min-height: 100vh;
flex-direction: row;
align-items: stretch;
margin: 0;
}
.login-main .login-page {
background-color: #fff;
}
.login-main .card {
box-shadow: none;
}
.login-main .auth-brand {
margin: 4rem 0 4rem;
font-size: 26px;
width: 325px;
}
@media (max-width: 576px) {
.login-main .auth-brand {
width: 90%;
margin-left: 24px
}
}
.login-main .login-logo {
font-size: 2.1rem;
font-weight: 300;
margin-bottom: 0.9rem;
text-align: left;
margin-left: 20px;
}
.login-main .login-box-msg {
margin: 0;
padding: 0 0 20px;
font-size: 0.9rem;
font-weight: 400;
text-align: left;
}
.login-main .btn {
width: 100%;
}
.login-page-right {
padding: 6rem 3rem;
flex: 1;
position: relative;
color: #fff;
background-color: rgba(0, 0, 0, 0.3);
text-align: center !important;
background: url(/vendor/dcat-admin/images/pages/login/bg.jpg) center;
background-size: cover;
}
.login-description {
position: absolute;
margin: 0 auto;
padding: 0 1.75rem;
bottom: 3rem;
left: 0;
right: 0;
}
.content-front {
position: absolute;
left: 0;
right: 0;
height: 100vh;
background: rgba(0,0,0,.1);
margin-top: -6rem;
}
body.dark-mode .content-front {
background: rgba(0,0,0,.3);
}
body.dark-mode .auth-brand {
color: #cacbd6
}
</style>
<div class="row login-main">
<div class="col-lg-3 col-12 bg-white">
<div class="login-page">
<div class="auth-brand text-lg-left">
{!! config('admin.logo') !!}
</div>
<div class="login-box">
<div class="login-logo mb-2">
<h4 class="mt-0"></h4>
<p class="login-box-msg mt-1 mb-1">{{ __('admin.welcome_back') }}</p>
</div>
<div class="card">
<div class="card-body login-card-body">
<form id="login-form" method="POST" action="{{ admin_url('auth/login') }}">
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
<fieldset class="form-label-group form-group position-relative has-icon-left">
<input
type="text"
class="form-control {{ $errors->has('username') ? 'is-invalid' : '' }}"
name="username"
placeholder="{{ trans('admin.username') }}"
value="admin"
required
autofocus
>
<div class="form-control-position">
<i class="feather icon-user"></i>
</div>
<label for="email">{{ trans('admin.username') }}</label>
<div class="help-block with-errors"></div>
@if($errors->has('username'))
<span class="invalid-feedback text-danger" role="alert">
@foreach($errors->get('username') as $message)
<span class="control-label" for="inputError"><i class="feather icon-x-circle"></i> {{$message}}</span><br>
@endforeach
</span>
@endif
</fieldset>
<br/>
<fieldset class="form-label-group form-group position-relative has-icon-left">
<input
minlength="5"
maxlength="20"
id="password"
type="password"
class="form-control {{ $errors->has('password') ? 'is-invalid' : '' }}"
name="password"
placeholder="{{ trans('admin.password') }}"
required
value="admin"
autocomplete="current-password"
>
<div class="form-control-position">
<i class="feather icon-lock"></i>
</div>
<label for="password">{{ trans('admin.password') }}</label>
<div class="help-block with-errors"></div>
@if($errors->has('password'))
<span class="invalid-feedback text-danger" role="alert">
@foreach($errors->get('password') as $message)
<span class="control-label" for="inputError"><i class="feather icon-x-circle"></i> {{$message}}</span><br>
@endforeach
</span>
@endif
</fieldset>
<div class="form-group d-flex justify-content-between align-items-center">
<div class="text-left">
<fieldset class="checkbox">
<div class="vs-checkbox-con vs-checkbox-primary">
<input id="remember" name="remember" value="1" type="checkbox" {{ old('remember') ? 'checked' : '' }}>
<span class="vs-checkbox">
<span class="vs-checkbox--check">
<i class="vs-icon feather icon-check"></i>
</span>
</span>
<span> {{ trans('admin.remember_me') }}</span>
</div>
</fieldset>
</div>
</div>
<button type="submit" class="btn btn-primary float-right login-btn">
{{ __('admin.login') }}
&nbsp;
<i class="feather icon-arrow-right"></i>
</button>
</form>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-9 col-12 login-page-right">
<div class="content-front"></div>
<div class="login-description">
<p class="lead">
十分钟内构建一个功能完善的高颜值后台系统。
</p>
<p>
Dcat Admin
</p>
</div>
</div>
</div>
<script>
Dcat.ready(function () {
// ajax表单提交
$('#login-form').form({
validate: true,
});
});
</script>
<ul class="nav navbar-nav">
<li class="dropdown dropdown-notification nav-item">
<a class="nav-link nav-link-label" href="#" data-toggle="dropdown" aria-expanded="true"><i class="ficon feather icon-bell"></i><span class="badge badge-pill badge-primary badge-up">5</span></a>
<ul class="dropdown-menu dropdown-menu-media dropdown-menu-right ">
<li class="dropdown-menu-header">
<div class="dropdown-header m-0 p-2">
<h3 class="white">5 New</h3><span class="grey darken-2">App Notifications</span>
</div>
</li>
<li class="scrollable-container media-list ps ps--active-y">
<a class="d-flex justify-content-between" href="javascript:void(0)">
<div class="media d-flex align-items-start">
<div class="media-left"><i class="feather icon-plus-square font-medium-5 primary"></i></div>
<div class="media-body">
<h6 class="primary media-heading">You have new order!</h6><small class="notification-text"> Are
your going to meet me
tonight?</small>
</div><small>
<time class="media-meta" datetime="2015-06-11T18:29:20+08:00">9 hours
ago</time></small>
</div>
</a><a class="d-flex justify-content-between" href="javascript:void(0)">
<div class="media d-flex align-items-start">
<div class="media-left"><i class="feather icon-download-cloud font-medium-5 success"></i></div>
<div class="media-body">
<h6 class="success media-heading red darken-1">99% Server load</h6>
<small class="notification-text">You got new order of goods.</small>
</div><small>
<time class="media-meta" datetime="2015-06-11T18:29:20+08:00">5 hour
ago</time></small>
</div>
</a><a class="d-flex justify-content-between" href="javascript:void(0)">
<div class="media d-flex align-items-start">
<div class="media-left"><i class="feather icon-alert-triangle font-medium-5 danger"></i></div>
<div class="media-body">
<h6 class="danger media-heading yellow darken-3">Warning notifixation
</h6><small class="notification-text">Server have 99% CPU usage.</small>
</div><small>
<time class="media-meta" datetime="2015-06-11T18:29:20+08:00">Today</time></small>
</div>
</a>
<div class="ps__rail-x" style="left: 0px; bottom: 0px;"><div class="ps__thumb-x" tabindex="0" style="left: 0px; width: 0px;"></div></div><div class="ps__rail-y" style="top: 0px; right: 0px; height: 254px;"><div class="ps__thumb-y" tabindex="0" style="top: 0px; height: 184px;"></div></div></li>
<li class="dropdown-menu-footer"><a class="dropdown-item p-1 text-center" href="javascript:void(0)">Read
all notifications</a></li>
</ul>
</li>
</ul>
\ No newline at end of file
<ul class="nav navbar-nav">
<li class="dropdown dropdown-language nav-item">
<a class="dropdown-toggle nav-link" href="#" id="dropdown-flag" data-toggle="dropdown">
<i class="flag-icon flag-icon-us"></i>
<span class="selected-language">English</span>
</a>
<ul class="dropdown-menu" aria-labelledby="dropdown-flag">
<li class="dropdown-item" href="#" data-language="en">
<a><i class="flag-icon flag-icon-us"></i> English</a>
</li>
<li class="dropdown-item" href="#" data-language="fr">
<a><i class="flag-icon flag-icon-fr"></i> French</a>
</li>
<lia class="dropdown-item" href="#" data-language="de">
<a><i class="flag-icon flag-icon-de"></i> German</a>
</lia>
</ul>
</li>
</ul>
\ No newline at end of file
<style>
.color-block {
width: 100px;
height: 20px;
background: #5c6bc6;
display: inline-block;
border-radius: .1rem;
color: white;
font-size: 13px;
text-align: center;
line-height: 20px;
}
.block-sm {
width: 40px;
}
</style>
<ul class="nav navbar-nav">
<li class="dropdown dropdown-language nav-item">
<a class="dropdown-toggle nav-link" href="#" id="dropdown-color" data-toggle="dropdown">
<span class="color-block" style="background: {{ $map[request()->get('_color_')] ?? \Dcat\Admin\Admin::color()->indigo() }}">
主题
</span>
</a>
<ul class="dropdown-menu" aria-labelledby="dropdown-color">
<li class="dropdown-item" href="#" data-language="en">
<a class="switch-color" data-value="indigo">
<span class="color-block" style="background: {{ \Dcat\Admin\Admin::color()->indigo() }}">indigo</span>
</a>
</li>
<li class="dropdown-item" href="#" data-language="fr">
<a class="switch-color" data-value="blue">
<span class="color-block" style="background: #5686d4">blue</span>
</a>
</li>
<lia class="dropdown-item" href="#" data-language="de">
<a class="switch-color" data-value="blue-dark">
<span class="color-block" style="background: #5686d4">
blue-dark
</span>
</a>
</lia>
</ul>
</li>
</ul>
<script>
Dcat.ready(function () {
$('.switch-color').click(function (e) {
window.location.href = '{{ admin_url('/') }}?_color_='+$(this).data('value');
})
});
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment