Skip to content

Commit

Permalink
refactor status
Browse files Browse the repository at this point in the history
  • Loading branch information
atmonshi committed Sep 17, 2022
1 parent 4daae9c commit cd0707e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 21 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"orchestra/testbench": "^6.0 || ^7.0",
"laravel/pint": "^1.0",
"nunomaduro/larastan": "^2.0.1",
"orchestra/testbench": "^7.0",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.1",
"pestphp/pest-plugin-livewire": "^1.0",
Expand Down
9 changes: 0 additions & 9 deletions resources/views/status-clasess.blade.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function statusDesc(): string
$PostStatus = PostStatus::where('name', $this->status)->first();
$icon = Blade::render('@svg("' . $PostStatus->icon . '","w-4 h-4 inline-flex")');

return "<span title='" . __('post status') . "' class='px-2 py-0.5 text-xs rounded-xl text-{$PostStatus->class}-700 bg-{$PostStatus->class}-500/10'> " . $icon . " {$PostStatus->label}</span>";
return "<span title='" . __('post status') . "' class='$PostStatus->class'> " . $icon . " {$PostStatus->label}</span>";
}

public function author()
Expand Down
16 changes: 8 additions & 8 deletions src/Models/PostStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ class PostStatus extends Model
public function getRows()
{
return [
['name' => 'publish', 'label' => __('Publish'), 'class' => 'success', 'icon' => 'iconpark-filesuccessone'],
['name' => 'future', 'label' => __('Future'), 'class' => 'warning', 'icon' => 'iconpark-filedateone'],
['name' => 'draft', 'label' => __('Draft'), 'class' => 'secondary', 'icon' => 'iconpark-filehidingone'],
['name' => 'auto-draft', 'label' => __('Auto draft'), 'class' => 'primary', 'icon' => 'iconpark-filesearchone'],
['name' => 'pending', 'label' => __('Pending'), 'class' => 'info', 'icon' => 'iconpark-fileeditingone'],
['name' => 'private', 'label' => __('Private'), 'class' => 'danger', 'icon' => 'iconpark-filelockone'],
['name' => 'trash', 'label' => __('Trash'), 'class' => 'danger', 'icon' => 'iconpark-filetextone'],
['name' => 'inherit', 'label' => __('Inherit'), 'class' => 'primary', 'icon' => 'iconpark-filetipsone'],
['name' => 'publish', 'label' => __('Publish'), 'class' => 'px-2 py-0.5 text-xs rounded-xl text-success-700 bg-success-500/10', 'icon' => 'iconpark-filesuccessone'],
['name' => 'future', 'label' => __('Future'), 'class' => 'px-2 py-0.5 text-xs rounded-xl text-warning-700 bg-warning-500/10', 'icon' => 'iconpark-filedateone'],
['name' => 'draft', 'label' => __('Draft'), 'class' => 'px-2 py-0.5 text-xs rounded-xl text-secondary-700 bg-secondary-500/10', 'icon' => 'iconpark-filehidingone'],
['name' => 'auto-draft', 'label' => __('Auto draft'), 'class' => 'px-2 py-0.5 text-xs rounded-xl text-primary-700 bg-primary-500/10', 'icon' => 'iconpark-filesearchone'],
['name' => 'pending', 'label' => __('Pending'), 'class' => 'px-2 py-0.5 text-xs rounded-xl text-info-700 bg-info-500/10', 'icon' => 'iconpark-fileeditingone'],
['name' => 'private', 'label' => __('Private'), 'class' => 'px-2 py-0.5 text-xs rounded-xl text-danger-700 bg-danger-500/10', 'icon' => 'iconpark-filelockone'],
['name' => 'trash', 'label' => __('Trash'), 'class' => 'px-2 py-0.5 text-xs rounded-xl text-danger-700 bg-danger-500/10', 'icon' => 'iconpark-filetextone'],
['name' => 'inherit', 'label' => __('Inherit'), 'class' => 'px-2 py-0.5 text-xs rounded-xl text-primary-700 bg-primary-500/10', 'icon' => 'iconpark-filetipsone'],
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/SkyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class SkyServiceProvider extends PluginServiceProvider

public function boot()
{
View::share('theme', 'zeus-sky::themes.' . config('zeus-sky.theme'));
View::share('theme', 'zeus-sky::themes.' . config('zeus-sky.theme', 'zeus'));

App::singleton('theme', function () {
return 'zeus-sky::themes.' . config('zeus-sky.theme');
return 'zeus-sky::themes.' . config('zeus-sky.theme', 'zeus');
});

return parent::boot();
Expand Down

0 comments on commit cd0707e

Please sign in to comment.