fix change user class + medal display

This commit is contained in:
xiaomlove
2023-01-10 17:25:53 +08:00
parent 3612edbb5b
commit d7d63c8fd2
20 changed files with 249 additions and 16 deletions

View File

@@ -44,15 +44,18 @@ class MedalResource extends Resource
Forms\Components\Radio::make('get_type')
->options(Medal::listGetTypes(true))
->inline()
->columnSpan(['sm' => 2])
->label(__('label.medal.get_type'))
->required(),
Forms\Components\Toggle::make('display_on_medal_page')
->label(__('label.medal.display_on_medal_page'))
->required(),
Forms\Components\TextInput::make('duration')
->integer()
->columnSpan(['sm' => 2])
->label(__('label.medal.duration'))
->helperText(__('label.medal.duration_help')),
Forms\Components\Textarea::make('description')->columnSpan(['sm' => 2])->label(__('label.description')),
Forms\Components\Textarea::make('description')
->label(__('label.description'))
,
]);
}
@@ -67,6 +70,7 @@ class MedalResource extends Resource
Tables\Columns\TextColumn::make('getTypeText')->label('Get type')->label(__('label.medal.get_type')),
Tables\Columns\TextColumn::make('price')->label(__('label.price')),
Tables\Columns\TextColumn::make('duration')->label(__('label.medal.duration')),
Tables\Columns\IconColumn::make('display_on_medal_page')->label(__('label.medal.display_on_medal_page'))->boolean(),
])
->defaultSort('id', 'desc')
->filters([

View File

@@ -16,4 +16,9 @@ class EditMedal extends EditRecord
Actions\DeleteAction::make(),
];
}
protected function getRedirectUrl(): ?string
{
return $this->getResource()::getUrl('index');
}
}

View File

@@ -22,7 +22,7 @@ class UsernameChangeLogResource extends Resource
protected static ?string $navigationGroup = 'User';
protected static ?int $navigationSort = 8;
protected static ?int $navigationSort = 100;
protected static function getNavigationLabel(): string
{