Update Staging Deploy
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Helpers\EntryHelpers;
|
||||
use App\Models\EntryFile;
|
||||
use App\Services\FileServersService;
|
||||
use Illuminate\Http\Client\ConnectionException;
|
||||
@@ -52,7 +53,7 @@ class FileServerController extends Controller {
|
||||
'filesize' => $data['file']['size'],
|
||||
'favorite_server' => $data['favorite_server'],
|
||||
'favorite_at' => time(),
|
||||
'state' => 'public'
|
||||
'state' => 'public',
|
||||
], now()->addHours(2) );
|
||||
|
||||
$data['finished'] = true;
|
||||
|
||||
@@ -49,7 +49,7 @@ class SubmissionController extends Controller
|
||||
if( section_must_be( 'romhacks', $section ) ){
|
||||
$data['modifications'] = Modification::orderBy('name')->get();
|
||||
}
|
||||
if( section_must_be( [ 'romhacks', 'translations' ], $section ) ){
|
||||
if( section_must_be( [ 'romhacks', 'translations', 'homebrew' ], $section ) ){
|
||||
$data['statuses'] = Status::orderBy('id')->get();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\EntryFile;
|
||||
use App\Services\FileServersService;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ToolsController extends Controller
|
||||
@@ -10,11 +12,21 @@ class ToolsController extends Controller
|
||||
public function patcher()
|
||||
{
|
||||
|
||||
return view('tools.patcher');
|
||||
}
|
||||
|
||||
public function directPatch( Request $request, int $entry_id, EntryFile $file )
|
||||
{
|
||||
if( $file->entry_id != $entry_id ) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
$service = app(FileServersService::class);
|
||||
|
||||
$patches = [
|
||||
'file' => 'ZELDA.ips',
|
||||
'name' => "Meltin",
|
||||
'description' => 'Blablabla',
|
||||
'outputName' => 'Game...'
|
||||
'file' => $service->getDownloadFileUrl( $file ),
|
||||
'name' => $file->entry->title,
|
||||
'outputName' => $file->filename
|
||||
];
|
||||
|
||||
return view('tools.patcher', compact('patches'));
|
||||
|
||||
@@ -64,7 +64,7 @@ class StoreEntryRequest extends FormRequest
|
||||
$rules['files_state.*'] = 'string|in:public,private,archived';
|
||||
}
|
||||
|
||||
if( section_must_not_be( 'translations', $section ) ){
|
||||
if( section_must_not_be( ['translations','homebrew'], $section ) ){
|
||||
$rules['entry_title'] = "required|string|max:255";
|
||||
} else {
|
||||
$rules['entry_title'] = "nullable|string|max:255";
|
||||
@@ -124,6 +124,12 @@ class StoreEntryRequest extends FormRequest
|
||||
}
|
||||
}
|
||||
|
||||
if( $isEdit ){
|
||||
$rules['files_metadata'] = 'array|nullable';
|
||||
$rules['files_metadata.*.online_patcher'] = 'nullable|boolean';
|
||||
$rules['files_metadata.*.secondary_online_patcher'] = 'nullable|boolean|required_with:files_metadata.*.online_patcher';
|
||||
}
|
||||
|
||||
if( $isEdit && $this->user()->can('moderate', $this->route('entry') ) ){
|
||||
$rules['staff_comment'] = 'nullable|string';
|
||||
$rules['owner_user_id'] = [ 'required', 'integer', new XfUserExists ];
|
||||
|
||||
Reference in New Issue
Block a user