mirror of
https://github.com/pelican-dev/panel.git
synced 2025-12-16 00:31:21 +01:00
Fix File global search path & rename to nested search (#1985)
This commit is contained in:
parent
f278041bc0
commit
1ab4ddb07c
@ -557,15 +557,15 @@ class ListFiles extends ListRecords
|
||||
Action::make('search')
|
||||
->authorize(fn () => user()?->can(Permission::ACTION_FILE_READ, $server))
|
||||
->hiddenLabel()->iconButton()->iconSize(IconSize::ExtraLarge)
|
||||
->tooltip(trans('server/file.actions.global_search.title'))
|
||||
->tooltip(trans('server/file.actions.nested_search.title'))
|
||||
->color('primary')
|
||||
->icon('tabler-world-search')
|
||||
->modalHeading(trans('server/file.actions.global_search.title'))
|
||||
->modalSubmitActionLabel(trans('server/file.actions.global_search.search'))
|
||||
->modalHeading(trans('server/file.actions.nested_search.title'))
|
||||
->modalSubmitActionLabel(trans('server/file.actions.nested_search.search'))
|
||||
->schema([
|
||||
TextInput::make('searchTerm')
|
||||
->label(trans('server/file.actions.global_search.search_term'))
|
||||
->placeholder(trans('server/file.actions.global_search.search_term_placeholder'))
|
||||
->label(trans('server/file.actions.nested_search.search_term'))
|
||||
->placeholder(trans('server/file.actions.nested_search.search_term_placeholder'))
|
||||
->required()
|
||||
->regex('/^[^*]*\*?[^*]*$/')
|
||||
->minValue(3),
|
||||
|
||||
@ -36,7 +36,7 @@ class SearchFiles extends ListRecords
|
||||
|
||||
return [
|
||||
$resource::getUrl() => $resource::getBreadcrumb(),
|
||||
self::getUrl(['searchTerm' => $this->searchTerm]) => trans('server/file.actions.global_search.search_for_term', ['term' => ' "' . $this->searchTerm . '"']),
|
||||
self::getUrl(['searchTerm' => $this->searchTerm]) => trans('server/file.actions.nested_search.search_for_term', ['term' => ' "' . $this->searchTerm . '"']),
|
||||
];
|
||||
}
|
||||
|
||||
@ -67,15 +67,15 @@ class SearchFiles extends ListRecords
|
||||
])
|
||||
->recordUrl(function (File $file) {
|
||||
if ($file->is_directory) {
|
||||
return ListFiles::getUrl(['path' => join_paths($this->path, $file->name)]);
|
||||
return ListFiles::getUrl(['path' => $file->name]);
|
||||
}
|
||||
|
||||
return $file->canEdit() ? EditFiles::getUrl(['path' => join_paths($this->path, $file->name)]) : null;
|
||||
return $file->canEdit() ? EditFiles::getUrl(['path' => $file->name]) : null;
|
||||
});
|
||||
}
|
||||
|
||||
public function getTitle(): string|Htmlable
|
||||
{
|
||||
return trans('server/file.actions.global_search.title');
|
||||
return trans('server/file.actions.nested_search.title');
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,8 +67,8 @@ return [
|
||||
'title' => 'New folder',
|
||||
'folder_name' => 'New folder name',
|
||||
],
|
||||
'global_search' => [
|
||||
'title' => 'Global Search',
|
||||
'nested_search' => [
|
||||
'title' => 'Nested Search',
|
||||
'search_term' => 'Search term',
|
||||
'search_term_placeholder' => 'Enter a search term, ex. *.txt',
|
||||
'search' => 'Search',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user