Skip to content

Commit

Permalink
Merge branch 'upstream-master' into polimorphyc_relation_form
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayMurha committed Aug 15, 2022
2 parents bc95090 + 27f535e commit 4e7d41b
Show file tree
Hide file tree
Showing 15 changed files with 123 additions and 16 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ Configurations
------------
The file `config/admin.php` contains an array of configurations, you can find the default configurations in there.

Right to left support
------------
just go to this path `<YOUR_PROJECT_PATH>\vendor\encore\laravel-admin\src\Traits\HasAssets.php` and modify `$baseCss` array for loading right to left (rtl) version of bootstap and AdminLTE css files.
**bootstrap.min.css** change it to **bootstrap.rtl.min.css**
**AdminLTE.min.css** change it to **AdminLTE.rtl.min.css**

## Extensions

| Extension | Description | laravel-admin |
Expand Down
9 changes: 9 additions & 0 deletions resources/assets/AdminLTE/bootstrap/css/bootstrap.rtl.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions resources/assets/AdminLTE/dist/css/AdminLTE.rtl.min.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions resources/assets/flatpickr/dist/flatpickr.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions resources/assets/flatpickr/dist/flatpickr.min.css

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions resources/assets/flatpickr/dist/l10n/zh.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.zh = {}));
}(this, (function (exports) { 'use strict';

var fp = typeof window !== "undefined" && window.flatpickr !== undefined
? window.flatpickr
: {
l10ns: {},
};
var Mandarin = {
weekdays: {
shorthand: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
longhand: [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
],
},
months: {
shorthand: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
longhand: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
},
rangeSeparator: " 至 ",
weekAbbreviation: "周",
scrollTitle: "滚动切换",
toggleTitle: "点击切换 12/24 小时时制",
};
fp.l10ns.zh = Mandarin;
var zh = fp.l10ns;

exports.Mandarin = Mandarin;
exports.default = zh;

Object.defineProperty(exports, '__esModule', { value: true });

})));

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function title()
*
* @return string|void
*/
public function favicon($favicon = null)
public static function favicon($favicon = null)
{
if (is_null($favicon)) {
return static::$favicon;
Expand Down
9 changes: 7 additions & 2 deletions src/AdminServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Str;

class AdminServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -99,7 +100,7 @@ public function boot()
*/
protected function ensureHttps()
{
$is_admin = \Str::startsWith(request()->getRequestUri(), '/'.ltrim(config('admin.route.prefix'), '/'));
$is_admin = Str::startsWith(request()->getRequestUri(), '/'.ltrim(config('admin.route.prefix'), '/'));
if ((config('admin.https') || config('admin.secure')) && $is_admin) {
url()->forceScheme('https');
$this->app['request']->server->set('HTTPS', true);
Expand All @@ -115,7 +116,11 @@ protected function registerPublishing()
{
if ($this->app->runningInConsole()) {
$this->publishes([__DIR__.'/../config' => config_path()], 'laravel-admin-config');
$this->publishes([__DIR__.'/../resources/lang' => resource_path('lang')], 'laravel-admin-lang');
if (version_compare($this->app->version(), '9.0.0', '>=')) {
$this->publishes([__DIR__.'/../resources/lang' => base_path('lang')], 'laravel-admin-lang');
} else {
$this->publishes([__DIR__.'/../resources/lang' => resource_path('lang')], 'laravel-admin-lang');
}
$this->publishes([__DIR__.'/../database/migrations' => database_path('migrations')], 'laravel-admin-migrations');
$this->publishes([__DIR__.'/../resources/assets' => public_path('vendor/laravel-admin')], 'laravel-admin-assets');
}
Expand Down
11 changes: 5 additions & 6 deletions src/Form/Field/DateMultiple.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
class DateMultiple extends Text
{
protected static $css = [
'https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css',
'https://cdn.jsdelivr.net/npm/shortcut-buttons-flatpickr@0.3.0/dist/themes/light.min.css',
'/vendor/laravel-admin/flatpickr/dist/flatpickr.min.css',
'/vendor/laravel-admin/flatpickr/dist/shortcut-buttons-flatpickr/themes/light.min.css',

];

protected static $js = [
'https://cdn.jsdelivr.net/npm/flatpickr',
'https://cdn.jsdelivr.net/npm/[email protected]/dist/shortcut-buttons-flatpickr.min.js',
'https://npmcdn.com/[email protected]/dist/l10n/zh.js',

'/vendor/laravel-admin/flatpickr/dist/flatpickr.js',
'/vendor/laravel-admin/flatpickr/dist/shortcut-buttons-flatpickr/shortcut-buttons-flatpickr.min.js',
'/vendor/laravel-admin/flatpickr/dist/l10n/zh.js',
];

protected $format = 'YYYY-MM-DD';
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Field/UploadField.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public function destroy()
$this->destroyThumbnail();
}

if ($this->storage->exists($this->original)) {
if (!empty($this->original) && $this->storage->exists($this->original)) {
$this->storage->delete($this->original);
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/Show/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,12 @@ public function badge($style = 'blue')
}

/**
* Show field as number
*
* @param int $decimals
* Show field as number.
*
* @param int $decimals
* @param string $decimal_seperator
* @param string $thousands_seperator
*
* @return Field
*/
public function number($decimals = 0, $decimal_seperator = '.', $thousands_seperator = ',')
Expand Down
2 changes: 1 addition & 1 deletion src/Tree/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Tools implements Renderable
/**
* Create a new Tools instance.
*
* @param Builder $builder
* @param Tree $tree
*/
public function __construct(Tree $tree)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Widgets/Box.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct($title = '', $content = '', $footer = '')
/**
* Set box content.
*
* @param string $content
* @param string|Renderable $content
*
* @return $this
*/
Expand All @@ -80,7 +80,7 @@ public function content($content)
/**
* Set box footer.
*
* @param string $footer
* @param string|Renderable $footer
*
* @return $this
*/
Expand Down

0 comments on commit 4e7d41b

Please sign in to comment.