diff --git a/app/Http/Controllers/Admin/AdminBlacklistController.php b/app/Http/Controllers/Admin/AdminBlacklistController.php index 0ff9537bb..ffd57de24 100644 --- a/app/Http/Controllers/Admin/AdminBlacklistController.php +++ b/app/Http/Controllers/Admin/AdminBlacklistController.php @@ -13,7 +13,7 @@ class AdminBlacklistController extends BasePageController /** * @throws \Exception */ - public function index(): void + public function index() { $this->setAdminPrefs(); $svc = new BlacklistService; @@ -21,11 +21,14 @@ class AdminBlacklistController extends BasePageController $meta_title = $title = 'Binary Black/White List'; $binlist = $svc->getBlacklist(false); - $this->smarty->assign('binlist', $binlist); - $content = $this->smarty->fetch('binaryblacklist-list.tpl'); - $this->smarty->assign(compact('title', 'meta_title', 'content')); - $this->adminrender(); + $this->viewData = array_merge($this->viewData, [ + 'binlist' => $binlist, + 'title' => $title, + 'meta_title' => $meta_title, + ]); + + return view('admin.binaryblacklist-list', $this->viewData); } /** @@ -89,25 +92,23 @@ class AdminBlacklistController extends BasePageController break; } - $this->smarty->assign( - [ - 'error' => $error, - 'regex' => $regex, - 'status_ids' => [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE], - 'status_names' => ['Yes', 'No'], - 'optype_ids' => [1, 2], - 'optype_names' => ['Black', 'White'], - 'msgcol_ids' => [ - Binaries::BLACKLIST_FIELD_SUBJECT, - Binaries::BLACKLIST_FIELD_FROM, - Binaries::BLACKLIST_FIELD_MESSAGEID, - ], - 'msgcol_names' => ['Subject', 'Poster', 'MessageId'], - ] - ); + $this->viewData = array_merge($this->viewData, [ + 'error' => $error, + 'regex' => (object) $regex, + 'status_ids' => [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE], + 'status_names' => ['Yes', 'No'], + 'optype_ids' => [1, 2], + 'optype_names' => ['Black', 'White'], + 'msgcol_ids' => [ + Binaries::BLACKLIST_FIELD_SUBJECT, + Binaries::BLACKLIST_FIELD_FROM, + Binaries::BLACKLIST_FIELD_MESSAGEID, + ], + 'msgcol_names' => ['Subject', 'Poster', 'MessageId'], + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $content = $this->smarty->fetch('binaryblacklist-edit.tpl'); - $this->smarty->assign(compact('title', 'meta_title', 'content')); - $this->adminrender(); + return view('admin.binaryblacklist-edit', $this->viewData); } } diff --git a/app/Http/Controllers/Admin/AdminCategoryController.php b/app/Http/Controllers/Admin/AdminCategoryController.php index b21a390b6..6af2a7436 100644 --- a/app/Http/Controllers/Admin/AdminCategoryController.php +++ b/app/Http/Controllers/Admin/AdminCategoryController.php @@ -11,23 +11,24 @@ class AdminCategoryController extends BasePageController /** * @throws \Exception */ - public function index(): void + public function index() { $this->setAdminPrefs(); $meta_title = $title = 'Category List'; $categorylist = Category::getFlat(); - $this->smarty->assign('categorylist', $categorylist); + $this->viewData = array_merge($this->viewData, [ + 'categorylist' => $categorylist, + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $content = $this->smarty->fetch('category-list.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - $this->adminrender(); + return view('admin.category-list', $this->viewData); } /** - * @return \Illuminate\Http\RedirectResponse|void + * @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View * * @throws \Exception */ @@ -50,29 +51,25 @@ class AdminCategoryController extends BasePageController ); return redirect()->to('admin/category-list'); - break; case 'view': default: + $category = null; + $title = 'Category Edit'; if ($request->has('id')) { - $this->title = 'Category Edit'; $id = $request->input('id'); - $cat = Category::find($id); - $this->smarty->assign('category', $cat); + $category = Category::find($id); } break; } - $this->smarty->assign('status_ids', [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE, Category::STATUS_DISABLED]); - $this->smarty->assign('status_names', ['Yes', 'No', 'Disabled']); + $this->viewData = array_merge($this->viewData, [ + 'category' => $category, + 'status_ids' => [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE, Category::STATUS_DISABLED], + 'status_names' => ['Yes', 'No', 'Disabled'], + 'title' => $title, + 'meta_title' => 'View/Edit categories', + ]); - $content = $this->smarty->fetch('category-edit.tpl'); - - $this->smarty->assign( - [ - 'content' => $content, - 'meta_title' => 'View/Edit categories', - ] - ); - $this->adminrender(); + return view('admin.category-edit', $this->viewData); } } diff --git a/app/Http/Controllers/Admin/AdminCategoryRegexesController.php b/app/Http/Controllers/Admin/AdminCategoryRegexesController.php index ef1d7f9d0..0599c848c 100644 --- a/app/Http/Controllers/Admin/AdminCategoryRegexesController.php +++ b/app/Http/Controllers/Admin/AdminCategoryRegexesController.php @@ -12,7 +12,7 @@ class AdminCategoryRegexesController extends BasePageController /** * @throws \Exception */ - public function index(Request $request): void + public function index(Request $request) { $this->setAdminPrefs(); $regexes = new Regexes(['Settings' => null, 'Table_Name' => 'category_regexes']); @@ -22,22 +22,18 @@ class AdminCategoryRegexesController extends BasePageController $group = $request->has('group') && ! empty($request->input('group')) ? $request->input('group') : ''; $regex = $regexes->getRegex($group); - $this->smarty->assign( - [ - 'group' => $group, - 'regex' => $regex, - ] - ); + $this->viewData = array_merge($this->viewData, [ + 'group' => $group, + 'regex' => $regex, + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $content = $this->smarty->fetch('category_regexes-list.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.category-regexes-list', $this->viewData); } /** - * @return \Illuminate\Http\RedirectResponse|void + * @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View * * @throws \Exception */ @@ -56,24 +52,26 @@ class AdminCategoryRegexesController extends BasePageController 'description' => '', 'ordinal' => '', 'categories_id' => '', - 'status' => 1, ]; + 'status' => 1, + ]; - $this->smarty->assign('regex', $regex); + $error = ''; + $meta_title = $title = 'Category Regex'; switch ($action) { case 'submit': if (empty($request->input('group_regex'))) { - $this->smarty->assign('error', 'Group regex must not be empty!'); + $error = 'Group regex must not be empty!'; break; } if (empty($request->input('regex'))) { - $this->smarty->assign('error', 'Regex cannot be empty'); + $error = 'Regex cannot be empty'; break; } if (! is_numeric($request->input('ordinal')) || $request->input('ordinal') < 0) { - $this->smarty->assign('error', 'Ordinal must be a number, 0 or higher.'); + $error = 'Ordinal must be a number, 0 or higher.'; break; } @@ -83,8 +81,7 @@ class AdminCategoryRegexesController extends BasePageController $regexes->updateRegex($request->all()); } - return redirect()->to('admin/category_regexes-list'); - break; + return redirect()->to('admin/category-regexes-list'); case 'view': default: @@ -95,13 +92,9 @@ class AdminCategoryRegexesController extends BasePageController } else { $meta_title = $title = 'Category Regex Add'; } - $this->smarty->assign('regex', $regex); break; } - $this->smarty->assign('status_ids', [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE]); - $this->smarty->assign('status_names', ['Yes', 'No']); - $categories_db = Category::query() ->select(['c.id', 'c.title', 'cp.title as parent_title']) ->from('categories as c') @@ -109,18 +102,25 @@ class AdminCategoryRegexesController extends BasePageController ->whereNotNull('c.root_categories_id') ->orderBy('c.id') ->get(); - // Build arrays for Smarty html_options helper. Previously only last row was kept. + $category_ids = []; $category_names = []; foreach ($categories_db as $category_db) { $category_ids[] = $category_db->id; $category_names[] = $category_db->parent_title.' '.$category_db->title.': '.$category_db->id; } - $this->smarty->assign('category_names', $category_names); - $this->smarty->assign('category_ids', $category_ids); - $content = $this->smarty->fetch('category_regexes-edit.tpl'); - $this->smarty->assign(compact('title', 'meta_title', 'content')); - $this->adminrender(); + $this->viewData = array_merge($this->viewData, [ + 'error' => $error, + 'regex' => (object) $regex, + 'status_ids' => [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE], + 'status_names' => ['Yes', 'No'], + 'category_ids' => $category_ids, + 'category_names' => $category_names, + 'title' => $title, + 'meta_title' => $meta_title, + ]); + + return view('admin.category-regexes-edit', $this->viewData); } } diff --git a/app/Http/Controllers/Admin/AdminCollectionRegexesController.php b/app/Http/Controllers/Admin/AdminCollectionRegexesController.php index 9fe35abc9..bbf265ff7 100644 --- a/app/Http/Controllers/Admin/AdminCollectionRegexesController.php +++ b/app/Http/Controllers/Admin/AdminCollectionRegexesController.php @@ -12,7 +12,7 @@ class AdminCollectionRegexesController extends BasePageController /** * @throws \Exception */ - public function index(Request $request): void + public function index(Request $request) { $this->setAdminPrefs(); $regexes = new Regexes(['Settings' => null, 'Table_Name' => 'collection_regexes']); @@ -21,17 +21,19 @@ class AdminCollectionRegexesController extends BasePageController $group = ($request->has('group') && ! empty($request->input('group')) ? $request->input('group') : ''); $regex = $regexes->getRegex($group); - $this->smarty->assign(compact('group', 'regex')); - $content = $this->smarty->fetch('collection_regexes-list.tpl'); + $this->viewData = array_merge($this->viewData, [ + 'group' => $group, + 'regex' => $regex, + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.collection-regexes-list', $this->viewData); } /** - * @return \Illuminate\Http\RedirectResponse|void + * @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View * * @throws \Exception */ @@ -41,6 +43,7 @@ class AdminCollectionRegexesController extends BasePageController $regexes = new Regexes(['Settings' => null, 'Table_Name' => 'collection_regexes']); $error = ''; $regex = ['id' => '', 'regex' => '', 'description' => '', 'group_regex' => '', 'ordinal' => '', 'status' => 1]; + $meta_title = $title = 'Collections Regex'; switch ($request->input('action') ?? 'view') { case 'submit': @@ -70,7 +73,6 @@ class AdminCollectionRegexesController extends BasePageController } return redirect()->to('admin/collection_regexes-list'); - break; case 'view': default: @@ -84,22 +86,22 @@ class AdminCollectionRegexesController extends BasePageController break; } - $this->smarty->assign('regex', $regex); - $this->smarty->assign('error', $error); - $this->smarty->assign('status_ids', [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE]); - $this->smarty->assign('status_names', ['Yes', 'No']); + $this->viewData = array_merge($this->viewData, [ + 'regex' => (object) $regex, + 'error' => $error, + 'status_ids' => [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE], + 'status_names' => ['Yes', 'No'], + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $content = $this->smarty->fetch('collection_regexes-edit.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.collection-regexes-edit', $this->viewData); } /** * @throws \Exception */ - public function testRegex(Request $request): void + public function testRegex(Request $request) { $this->setAdminPrefs(); $meta_title = $title = 'Collections Regex Test'; @@ -107,16 +109,21 @@ class AdminCollectionRegexesController extends BasePageController $group = trim($request->has('group') && ! empty($request->input('group')) ? $request->input('group') : ''); $regex = trim($request->has('regex') && ! empty($request->input('regex')) ? $request->input('regex') : ''); $limit = ($request->has('limit') && is_numeric($request->input('limit')) ? $request->input('limit') : 50); - $this->smarty->assign(['group' => $group, 'regex' => $regex, 'limit' => $limit]); + $data = null; if ($group && $regex) { - $this->smarty->assign('data', (new Regexes(['Settings' => null, 'Table_Name' => 'collection_regexes']))->testCollectionRegex($group, $regex, $limit)); + $data = (new Regexes(['Settings' => null, 'Table_Name' => 'collection_regexes']))->testCollectionRegex($group, $regex, $limit); } - $content = $this->smarty->fetch('collection_regexes-test.tpl'); + $this->viewData = array_merge($this->viewData, [ + 'group' => $group, + 'regex' => $regex, + 'limit' => $limit, + 'data' => $data, + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.collection-regexes-test', $this->viewData); } } diff --git a/app/Http/Controllers/Admin/AdminContentController.php b/app/Http/Controllers/Admin/AdminContentController.php index 4ae752046..0c3cc02b0 100644 --- a/app/Http/Controllers/Admin/AdminContentController.php +++ b/app/Http/Controllers/Admin/AdminContentController.php @@ -13,23 +13,22 @@ class AdminContentController extends BasePageController /** * @throws \Exception */ - public function index(): void + public function index() { $this->setAdminPrefs(); $contentList = (new Contents)->getAll(); - $this->smarty->assign('contentlist', $contentList); - $meta_title = 'Content List'; + $this->viewData = array_merge($this->viewData, [ + 'contentlist' => $contentList, + 'meta_title' => 'Content List', + 'title' => 'Content List', + ]); - $content = $this->smarty->fetch('content-list.tpl'); - - $this->smarty->assign(compact('meta_title', 'content')); - - $this->adminrender(); + return view('admin.content-list', $this->viewData); } /** - * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|void + * @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Foundation\Application|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View * * @throws \Exception */ @@ -73,7 +72,6 @@ class AdminContentController extends BasePageController } return redirect('admin/content-add?id='.$returnid); - break; case 'view': default: @@ -86,25 +84,22 @@ class AdminContentController extends BasePageController break; } - $this->smarty->assign('status_ids', [1, 0]); - $this->smarty->assign('status_names', ['Enabled', 'Disabled']); - - $this->smarty->assign('yesno_ids', [1, 0]); - $this->smarty->assign('yesno_names', ['Yes', 'No']); - $contenttypelist = [1 => 'Useful Link', 2 => 'Article', 3 => 'Homepage']; - $this->smarty->assign('contenttypelist', $contenttypelist); - - $this->smarty->assign('content', $content); - $rolelist = [1 => 'Everyone', 2 => 'Logged in Users', 3 => 'Admins']; - $this->smarty->assign('rolelist', $rolelist); - $content = $this->smarty->fetch('content-add.tpl'); + $this->viewData = array_merge($this->viewData, [ + 'status_ids' => [1, 0], + 'status_names' => ['Enabled', 'Disabled'], + 'yesno_ids' => [1, 0], + 'yesno_names' => ['Yes', 'No'], + 'contenttypelist' => $contenttypelist, + 'content' => $content, + 'rolelist' => $rolelist, + 'meta_title' => $meta_title, + 'title' => $meta_title, + ]); - $this->smarty->assign(compact('meta_title', 'content')); - - $this->adminrender(); + return view('admin.content-add', $this->viewData); } public function destroy(Request $request): \Illuminate\Routing\Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application diff --git a/app/Http/Controllers/Admin/AdminPageController.php b/app/Http/Controllers/Admin/AdminPageController.php index 818895be1..f7419b937 100644 --- a/app/Http/Controllers/Admin/AdminPageController.php +++ b/app/Http/Controllers/Admin/AdminPageController.php @@ -9,8 +9,8 @@ class AdminPageController extends BasePageController /** * @throws \Exception */ - public function index(): void + public function index() { - $this->adminBasePage(); + return $this->adminBasePage(); } } diff --git a/app/Http/Controllers/Admin/AdminReleaseNamingRegexesController.php b/app/Http/Controllers/Admin/AdminReleaseNamingRegexesController.php index 34ec48cba..8d85fb37d 100644 --- a/app/Http/Controllers/Admin/AdminReleaseNamingRegexesController.php +++ b/app/Http/Controllers/Admin/AdminReleaseNamingRegexesController.php @@ -12,7 +12,7 @@ class AdminReleaseNamingRegexesController extends BasePageController /** * @throws \Exception */ - public function index(Request $request): void + public function index(Request $request) { $this->setAdminPrefs(); $regexes = new Regexes(['Settings' => null, 'Table_Name' => 'release_naming_regexes']); @@ -24,15 +24,19 @@ class AdminReleaseNamingRegexesController extends BasePageController $group = $request->input('group'); } $regex = $regexes->getRegex($group); - $this->smarty->assign('regex', $regex); - $content = $this->smarty->fetch('release_naming_regexes-list.tpl'); - $this->smarty->assign(compact('title', 'meta_title', 'content')); - $this->adminrender(); + $this->viewData = array_merge($this->viewData, [ + 'group' => $group, + 'regex' => $regex, + 'title' => $title, + 'meta_title' => $meta_title, + ]); + + return view('admin.release-naming-regexes-list', $this->viewData); } /** - * @return \Illuminate\Http\RedirectResponse|void + * @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View * * @throws \Exception */ @@ -43,16 +47,19 @@ class AdminReleaseNamingRegexesController extends BasePageController // Set the current action. $action = $request->input('action') ?? 'view'; + $error = ''; + $regex = ['id' => '', 'group_regex' => '', 'regex' => '', 'description' => '', 'ordinal' => '', 'status' => 1]; + $meta_title = $title = 'Release Naming Regex'; switch ($action) { case 'submit': if (empty($request->input('group_regex'))) { - $this->smarty->assign('error', 'Group regex must not be empty!'); + $error = 'Group regex must not be empty!'; break; } if (empty($request->input('regex'))) { - $this->smarty->assign('error', 'Regex cannot be empty'); + $error = 'Regex cannot be empty'; break; } @@ -61,7 +68,7 @@ class AdminReleaseNamingRegexesController extends BasePageController } if (! is_numeric($request->input('ordinal')) || $request->input('ordinal') < 0) { - $this->smarty->assign('error', 'Ordinal must be a number, 0 or higher.'); + $error = 'Ordinal must be a number, 0 or higher.'; break; } @@ -72,7 +79,6 @@ class AdminReleaseNamingRegexesController extends BasePageController } return redirect()->to('admin/release_naming_regexes-list'); - break; case 'view': default: @@ -87,21 +93,22 @@ class AdminReleaseNamingRegexesController extends BasePageController break; } - $this->smarty->assign('status_ids', [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE]); - $this->smarty->assign('status_names', ['Yes', 'No']); - $this->smarty->assign('regex', $regex); + $this->viewData = array_merge($this->viewData, [ + 'error' => $error, + 'regex' => (object) $regex, + 'status_ids' => [Category::STATUS_ACTIVE, Category::STATUS_INACTIVE], + 'status_names' => ['Yes', 'No'], + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $content = $this->smarty->fetch('release_naming_regexes-edit.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.release-naming-regexes-edit', $this->viewData); } /** * @throws \Exception */ - public function testRegex(Request $request): void + public function testRegex(Request $request) { $this->setAdminPrefs(); $meta_title = $title = 'Release Naming Regex Test'; @@ -110,14 +117,22 @@ class AdminReleaseNamingRegexesController extends BasePageController $regex = trim($request->has('regex') && ! empty($request->input('regex')) ? $request->input('regex') : ''); $showLimit = ($request->has('showlimit') && is_numeric($request->input('showlimit')) ? $request->input('showlimit') : 250); $queryLimit = ($request->has('querylimit') && is_numeric($request->input('querylimit')) ? $request->input('querylimit') : 100000); - $this->smarty->assign(['group' => $group, 'regex' => $regex, 'showlimit' => $showLimit, 'querylimit' => $queryLimit]); + $data = null; if ($group && $regex) { - $this->smarty->assign('data', (new Regexes(['Settings' => null, 'Table_Name' => 'release_naming_regexes']))->testReleaseNamingRegex($group, $regex, $showLimit, $queryLimit)); + $data = (new Regexes(['Settings' => null, 'Table_Name' => 'release_naming_regexes']))->testReleaseNamingRegex($group, $regex, $showLimit, $queryLimit); } - $content = $this->smarty->fetch('release_naming_regexes-test.tpl'); - $this->smarty->assign(compact('title', 'meta_title', 'content')); - $this->adminrender(); + $this->viewData = array_merge($this->viewData, [ + 'group' => $group, + 'regex' => $regex, + 'showlimit' => $showLimit, + 'querylimit' => $queryLimit, + 'data' => $data, + 'title' => $title, + 'meta_title' => $meta_title, + ]); + + return view('admin.release-naming-regexes-test', $this->viewData); } } diff --git a/app/Http/Controllers/Admin/AdminRoleController.php b/app/Http/Controllers/Admin/AdminRoleController.php index 333bf7902..3b485626c 100644 --- a/app/Http/Controllers/Admin/AdminRoleController.php +++ b/app/Http/Controllers/Admin/AdminRoleController.php @@ -11,7 +11,7 @@ class AdminRoleController extends BasePageController /** * @throws \Exception */ - public function index(): void + public function index() { $this->setAdminPrefs(); @@ -20,19 +20,19 @@ class AdminRoleController extends BasePageController // get the user roles $userroles = Role::cursor()->remember(); - $this->smarty->assign('userroles', $userroles); + $this->viewData = array_merge($this->viewData, [ + 'userroles' => $userroles, + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $content = $this->smarty->fetch('role-list.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.role-list', $this->viewData); } /** * @throws \Exception */ - public function create(Request $request): void + public function create(Request $request) { $this->setAdminPrefs(); @@ -91,35 +91,35 @@ class AdminRoleController extends BasePageController if ((int) $request->input('viewother') === 1) { $role->givePermissionTo('view other'); } - redirect()->to('admin/role-list')->sendHeaders(); - break; + + return redirect()->to('admin/role-list'); case 'view': default: $meta_title = $title = 'Add User Role'; - $role = [ - ]; - + $role = []; break; } - $this->smarty->assign('yesno_ids', [1, 0]); - $this->smarty->assign('yesno_names', ['Yes', 'No']); + $this->viewData = array_merge($this->viewData, [ + 'yesno_ids' => [1, 0], + 'yesno_names' => ['Yes', 'No'], + 'title' => $title, + 'meta_title' => $meta_title, + 'role' => $role, + ]); - $content = $this->smarty->fetch('role-add.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content', 'role')); - - $this->adminrender(); + return view('admin.role-add', $this->viewData); } /** * @throws \Exception */ - public function edit(Request $request): void + public function edit(Request $request) { $this->setAdminPrefs(); $meta_title = $title = 'User Roles'; + $role = null; // Get the user roles. $userRoles = Role::cursor()->remember(); @@ -209,28 +209,26 @@ class AdminRoleController extends BasePageController $role->revokePermissionTo('view other'); } - $this->smarty->assign('role', $role); - redirect()->to('admin/role-list')->sendHeaders(); - break; + return redirect()->to('admin/role-list'); case 'view': default: if ($request->has('id')) { $meta_title = $title = 'User Roles Edit'; $role = Role::findById($request->input('id')); - $this->smarty->assign('role', $role); } break; } - $this->smarty->assign('yesno_ids', [1, 0]); - $this->smarty->assign('yesno_names', ['Yes', 'No']); + $this->viewData = array_merge($this->viewData, [ + 'yesno_ids' => [1, 0], + 'yesno_names' => ['Yes', 'No'], + 'title' => $title, + 'meta_title' => $meta_title, + 'role' => $role, + ]); - $content = $this->smarty->fetch('role-edit.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.role-edit', $this->viewData); } public function destroy(Request $request): \Illuminate\Http\RedirectResponse diff --git a/app/Http/Controllers/Admin/AdminSiteController.php b/app/Http/Controllers/Admin/AdminSiteController.php index 7d86b330b..ec3c8eed4 100644 --- a/app/Http/Controllers/Admin/AdminSiteController.php +++ b/app/Http/Controllers/Admin/AdminSiteController.php @@ -16,7 +16,7 @@ use Illuminate\Http\Request; class AdminSiteController extends BasePageController { /** - * @return \Illuminate\Http\RedirectResponse|void + * @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View * * @throws \Exception */ @@ -25,6 +25,7 @@ class AdminSiteController extends BasePageController $this->setAdminPrefs(); $meta_title = $title = 'Site Edit'; + $error = ''; // set the current action $action = $request->input('action') ?? 'view'; @@ -34,7 +35,6 @@ class AdminSiteController extends BasePageController if ($request->missing('book_reqids')) { $request->merge(['book_reqids' => []]); } - $error = ''; $ret = Settings::settingsUpdate($request->all()); if (\is_int($ret)) { if ($ret === Settings::ERR_BADUNRARPATH) { @@ -57,90 +57,26 @@ class AdminSiteController extends BasePageController } if ($error === '') { - $site = $ret; - - return redirect()->to('admin/site-edit'); + return redirect()->to('admin/site-edit')->with('success', 'Settings updated successfully'); } - $this->smarty->assign('error', $error); $site = (object) $request->all(); - $this->smarty->assign('site', $site); - break; case 'view': default: - $site = $this->settings; - $this->smarty->assign('site', $site); - $this->smarty->assign('settings', Settings::toTree()); + // Load all settings from database into an object + $allSettings = Settings::all(); + $site = new \stdClass; + foreach ($allSettings as $setting) { + $site->{$setting->name} = $setting->value; + } break; } - $this->smarty->assign('yesno_ids', [1, 0]); - $this->smarty->assign('yesno_names', ['Yes', 'No']); - - $this->smarty->assign('passwd_ids', [1, 0]); - $this->smarty->assign('passwd_names', ['Deep (requires unrar)', 'None']); - - /* 0 = English, 2 = Danish, 3 = French, 1 = German */ - $this->smarty->assign('langlist_ids', [0, 2, 3, 1]); - $this->smarty->assign('langlist_names', ['English', 'Danish', 'French', 'German']); - - $this->smarty->assign( - 'imdblang_ids', - [ - 'en', 'da', 'nl', 'fi', 'fr', 'de', 'it', 'tlh', 'no', 'po', 'ru', 'es', - 'sv', - ] - ); - $this->smarty->assign( - 'imdblang_names', - [ - 'English', 'Danish', 'Dutch', 'Finnish', 'French', 'German', 'Italian', - 'Klingon', 'Norwegian', 'Polish', 'Russian', 'Spanish', 'Swedish', - ] - ); - - $this->smarty->assign('newgroupscan_names', ['Days', 'Posts']); - - $this->smarty->assign('registerstatus_ids', [Settings::REGISTER_STATUS_OPEN, Settings::REGISTER_STATUS_INVITE, Settings::REGISTER_STATUS_CLOSED]); - $this->smarty->assign('registerstatus_names', ['Open', 'Invite', 'Closed']); - - $this->smarty->assign('passworded_ids', [0, 1]); - $this->smarty->assign('passworded_names', [ - 'Hide passworded', - 'Show everything', - ]); - - $this->smarty->assign('lookuplanguage_iso', ['en', 'de', 'es', 'fr', 'it', 'nl', 'pt', 'sv']); - $this->smarty->assign('lookuplanguage_names', ['English', 'Deutsch', 'Español', 'Français', 'Italiano', 'Nederlands', 'Português', 'Svenska']); - - $this->smarty->assign('imdb_urls', [0, 1]); - $this->smarty->assign('imdburl_names', ['imdb.com', 'akas.imdb.com']); - - $this->smarty->assign('lookupbooks_ids', [0, 1, 2]); - $this->smarty->assign('lookupbooks_names', ['Disabled', 'Lookup All Books', 'Lookup Renamed Books']); - - $this->smarty->assign('lookupgames_ids', [0, 1, 2]); - $this->smarty->assign('lookupgames_names', ['Disabled', 'Lookup All Consoles', 'Lookup Renamed Consoles']); - - $this->smarty->assign('lookupmusic_ids', [0, 1, 2]); - $this->smarty->assign('lookupmusic_names', ['Disabled', 'Lookup All Music', 'Lookup Renamed Music']); - - $this->smarty->assign('lookupmovies_ids', [0, 1, 2]); - $this->smarty->assign('lookupmovies_names', ['Disabled', 'Lookup All Movies', 'Lookup Renamed Movies']); - - $this->smarty->assign('lookuptv_ids', [0, 1, 2]); - $this->smarty->assign('lookuptv_names', ['Disabled', 'Lookup All TV', 'Lookup Renamed TV']); - - $this->smarty->assign('lookup_reqids_ids', [0, 1, 2]); - $this->smarty->assign('lookup_reqids_names', ['Disabled', 'Lookup Request IDs', 'Lookup Request IDs Threaded']); - - $this->smarty->assign('coversPath', config('nntmux_settings.covers_path')); - // return a list of audiobooks, mags, ebooks, technical and foreign books $result = Category::query()->whereIn('id', [Category::MUSIC_AUDIOBOOK, Category::BOOKS_MAGAZINES, Category::BOOKS_TECHNICAL, Category::BOOKS_FOREIGN])->get(['id', 'title']); - // setup the display lists for these categories, this could have been static, but then if names changed they would be wrong + // setup the display lists for these categories $book_reqids_ids = []; $book_reqids_names = []; foreach ($result as $bookcategory) { @@ -149,64 +85,89 @@ class AdminSiteController extends BasePageController } // convert from a string array to an int array as we want to use int - $book_reqids_ids = array_map(function ($value) { - return (int) $value; - }, $book_reqids_ids); - $this->smarty->assign('book_reqids_ids', $book_reqids_ids); - $this->smarty->assign('book_reqids_names', $book_reqids_names); + $book_reqids_ids = array_map(fn ($value) => (int) $value, $book_reqids_ids); - // convert from a list to an array as we need to use an array, but teh Settings table only saves strings + // convert from a list to an array as we need to use an array, but the Settings table only saves strings $books_selected = explode(',', Settings::settingValue('book_reqids')); // convert from a string array to an int array - $books_selected = array_map(function ($value) { - return (int) $value; - }, $books_selected); - $this->smarty->assign('book_reqids_selected', $books_selected); + $books_selected = array_map(fn ($value) => (int) $value, $books_selected); - $this->smarty->assign('themelist', Utility::getThemesList()); + $compress_headers_warning = ! str_contains(config('settings.nntp_server'), 'astra') ? 'compress_headers_warning' : ''; - if (! str_contains(config('settings.nntp_server'), 'astra')) { - $this->smarty->assign('compress_headers_warning', 'compress_headers_warning'); - } + $this->viewData = array_merge($this->viewData, [ + 'site' => $site, + 'settings' => Settings::toTree(), + 'error' => $error, + 'yesno_ids' => [1, 0], + 'yesno_names' => ['Yes', 'No'], + 'passwd_ids' => [1, 0], + 'passwd_names' => ['Deep (requires unrar)', 'None'], + 'langlist_ids' => [0, 2, 3, 1], + 'langlist_names' => ['English', 'Danish', 'French', 'German'], + 'imdblang_ids' => ['en', 'da', 'nl', 'fi', 'fr', 'de', 'it', 'tlh', 'no', 'po', 'ru', 'es', 'sv'], + 'imdblang_names' => ['English', 'Danish', 'Dutch', 'Finnish', 'French', 'German', 'Italian', 'Klingon', 'Norwegian', 'Polish', 'Russian', 'Spanish', 'Swedish'], + 'newgroupscan_names' => ['Days', 'Posts'], + 'registerstatus_ids' => [Settings::REGISTER_STATUS_OPEN, Settings::REGISTER_STATUS_INVITE, Settings::REGISTER_STATUS_CLOSED], + 'registerstatus_names' => ['Open', 'Invite', 'Closed'], + 'passworded_ids' => [0, 1], + 'passworded_names' => ['Hide passworded', 'Show everything'], + 'lookuplanguage_iso' => ['en', 'de', 'es', 'fr', 'it', 'nl', 'pt', 'sv'], + 'lookuplanguage_names' => ['English', 'Deutsch', 'Español', 'Français', 'Italiano', 'Nederlands', 'Português', 'Svenska'], + 'imdb_urls' => [0, 1], + 'imdburl_names' => ['imdb.com', 'akas.imdb.com'], + 'lookupbooks_ids' => [0, 1, 2], + 'lookupbooks_names' => ['Disabled', 'Lookup All Books', 'Lookup Renamed Books'], + 'lookupgames_ids' => [0, 1, 2], + 'lookupgames_names' => ['Disabled', 'Lookup All Consoles', 'Lookup Renamed Consoles'], + 'lookupmusic_ids' => [0, 1, 2], + 'lookupmusic_names' => ['Disabled', 'Lookup All Music', 'Lookup Renamed Music'], + 'lookupmovies_ids' => [0, 1, 2], + 'lookupmovies_names' => ['Disabled', 'Lookup All Movies', 'Lookup Renamed Movies'], + 'lookuptv_ids' => [0, 1, 2], + 'lookuptv_names' => ['Disabled', 'Lookup All TV', 'Lookup Renamed TV'], + 'lookup_reqids_ids' => [0, 1, 2], + 'lookup_reqids_names' => ['Disabled', 'Lookup Request IDs', 'Lookup Request IDs Threaded'], + 'coversPath' => config('nntmux_settings.covers_path'), + 'book_reqids_ids' => $book_reqids_ids, + 'book_reqids_names' => $book_reqids_names, + 'book_reqids_selected' => $books_selected, + 'themelist' => Utility::getThemesList(), + 'compress_headers_warning' => $compress_headers_warning, + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $content = $this->smarty->fetch('site-edit.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.site-edit', $this->viewData); } /** * @throws \Exception */ - public function stats(): void + public function stats() { $this->setAdminPrefs(); $meta_title = $title = 'Site Stats'; $topGrabs = GrabStat::getTopGrabbers(); - $this->smarty->assign('topgrabs', $topGrabs); - $topDownloads = DownloadStat::getTopDownloads(); - $this->smarty->assign('topdownloads', $topDownloads); - $recent = ReleaseStat::getRecentlyAdded(); - $this->smarty->assign('recent', $recent); - $usersByMonth = SignupStat::getUsersByMonth(); - $this->smarty->assign('usersbymonth', $usersByMonth); - $usersByRole = RoleStat::getUsersByRole(); - $this->smarty->assign('usersbyrole', $usersByRole); - $this->smarty->assign('totusers', 0); - $this->smarty->assign('totrusers', 0); - $content = $this->smarty->fetch('site-stats.tpl'); + $this->viewData = array_merge($this->viewData, [ + 'topgrabs' => $topGrabs, + 'topdownloads' => $topDownloads, + 'recent' => $recent, + 'usersbymonth' => $usersByMonth, + 'usersbyrole' => $usersByRole, + 'totusers' => 0, + 'totrusers' => 0, + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.site-stats', $this->viewData); } } diff --git a/app/Http/Controllers/Admin/AdminTmuxController.php b/app/Http/Controllers/Admin/AdminTmuxController.php index cf80b69c5..fe830a895 100644 --- a/app/Http/Controllers/Admin/AdminTmuxController.php +++ b/app/Http/Controllers/Admin/AdminTmuxController.php @@ -11,7 +11,7 @@ class AdminTmuxController extends BasePageController /** * @throws \Exception */ - public function edit(Request $request): void + public function edit(Request $request) { $this->setAdminPrefs(); @@ -21,51 +21,50 @@ class AdminTmuxController extends BasePageController switch ($action) { case 'submit': Settings::settingsUpdate($request->all()); - $meta_title = $title = 'Tmux Settings Edit'; - $this->smarty->assign('site', $this->settings); - break; + + return redirect()->to('admin/tmux-edit')->with('success', 'Tmux settings updated successfully'); case 'view': default: - $meta_title = $title = 'Tmux Settings Edit'; - $this->smarty->assign('site', $this->settings); break; } - $this->smarty->assign('yesno_ids', [1, 0]); - $this->smarty->assign('yesno_names', ['yes', 'no']); + $meta_title = $title = 'Tmux Settings Edit'; - $this->smarty->assign('backfill_ids', [0, 4, 1]); - $this->smarty->assign('backfill_names', ['Disabled', 'Safe', 'All']); - $this->smarty->assign('backfill_group_ids', [1, 2, 3, 4, 5, 6]); - $this->smarty->assign('backfill_group', ['Newest', 'Oldest', 'Alphabetical', 'Alphabetical - Reverse', 'Most Posts', 'Fewest Posts']); - $this->smarty->assign('backfill_days', ['Days per Group', 'Safe Backfill day']); - $this->smarty->assign('backfill_days_ids', [1, 2]); - $this->smarty->assign('dehash_ids', [0, 1]); - $this->smarty->assign('dehash_names', ['Disabled', 'Enabled']); - $this->smarty->assign('import_ids', [0, 1, 2]); - $this->smarty->assign('import_names', ['Disabled', 'Import - Do Not Use Filenames', 'Import - Use Filenames']); - $this->smarty->assign('releases_ids', [0, 1]); - $this->smarty->assign('releases_names', ['Disabled', 'Update Releases']); - $this->smarty->assign('post_ids', [0, 1, 2, 3]); - $this->smarty->assign('post_names', ['Disabled', 'PostProcess Additional', 'PostProcess NFOs', 'All']); - $this->smarty->assign('fix_crap_radio_ids', ['Disabled', 'All', 'Custom']); - $this->smarty->assign('fix_crap_radio_names', ['Disabled', 'All', 'Custom']); - $this->smarty->assign('fix_crap_check_ids', ['blacklist', 'blfiles', 'executable', 'gibberish', 'hashed', 'installbin', 'passworded', 'passwordurl', 'sample', 'scr', 'short', 'size', 'huge', 'nzb', 'codec']); - $this->smarty->assign('fix_crap_check_names', ['blacklist', 'blfiles', 'executable', 'gibberish', 'hashed', 'installbin', 'passworded', 'passwordurl', 'sample', 'scr', 'short', 'size', 'huge', 'nzb', 'codec']); - $this->smarty->assign('sequential_ids', [0, 1]); - $this->smarty->assign('sequential_names', ['Disabled', 'Enabled']); - $this->smarty->assign('binaries_ids', [0, 1]); - $this->smarty->assign('binaries_names', ['Disabled', 'Enabled']); - $this->smarty->assign('lookup_reqids_ids', [0, 1, 2]); - $this->smarty->assign('lookup_reqids_names', ['Disabled', 'Lookup Request IDs', 'Lookup Request IDs Threaded']); - $this->smarty->assign('predb_ids', [0, 1]); - $this->smarty->assign('predb_names', ['Disabled', 'Enabled']); + $this->viewData = array_merge($this->viewData, [ + 'site' => $this->settings, + 'yesno_ids' => [1, 0], + 'yesno_names' => ['yes', 'no'], + 'backfill_ids' => [0, 4, 1], + 'backfill_names' => ['Disabled', 'Safe', 'All'], + 'backfill_group_ids' => [1, 2, 3, 4, 5, 6], + 'backfill_group' => ['Newest', 'Oldest', 'Alphabetical', 'Alphabetical - Reverse', 'Most Posts', 'Fewest Posts'], + 'backfill_days' => ['Days per Group', 'Safe Backfill day'], + 'backfill_days_ids' => [1, 2], + 'dehash_ids' => [0, 1], + 'dehash_names' => ['Disabled', 'Enabled'], + 'import_ids' => [0, 1, 2], + 'import_names' => ['Disabled', 'Import - Do Not Use Filenames', 'Import - Use Filenames'], + 'releases_ids' => [0, 1], + 'releases_names' => ['Disabled', 'Update Releases'], + 'post_ids' => [0, 1, 2, 3], + 'post_names' => ['Disabled', 'PostProcess Additional', 'PostProcess NFOs', 'All'], + 'fix_crap_radio_ids' => ['Disabled', 'All', 'Custom'], + 'fix_crap_radio_names' => ['Disabled', 'All', 'Custom'], + 'fix_crap_check_ids' => ['blacklist', 'blfiles', 'executable', 'gibberish', 'hashed', 'installbin', 'passworded', 'passwordurl', 'sample', 'scr', 'short', 'size', 'huge', 'nzb', 'codec'], + 'fix_crap_check_names' => ['blacklist', 'blfiles', 'executable', 'gibberish', 'hashed', 'installbin', 'passworded', 'passwordurl', 'sample', 'scr', 'short', 'size', 'huge', 'nzb', 'codec'], + 'sequential_ids' => [0, 1], + 'sequential_names' => ['Disabled', 'Enabled'], + 'binaries_ids' => [0, 1], + 'binaries_names' => ['Disabled', 'Enabled'], + 'lookup_reqids_ids' => [0, 1, 2], + 'lookup_reqids_names' => ['Disabled', 'Lookup Request IDs', 'Lookup Request IDs Threaded'], + 'predb_ids' => [0, 1], + 'predb_names' => ['Disabled', 'Enabled'], + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $content = $this->smarty->fetch('tmux-edit.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.tmux-edit', $this->viewData); } } diff --git a/app/Http/Controllers/Admin/AdminUserController.php b/app/Http/Controllers/Admin/AdminUserController.php index 9b0ee87d2..5f6879584 100644 --- a/app/Http/Controllers/Admin/AdminUserController.php +++ b/app/Http/Controllers/Admin/AdminUserController.php @@ -17,7 +17,7 @@ class AdminUserController extends BasePageController /** * @throws \Throwable */ - public function index(Request $request): void + public function index(Request $request) { $this->setAdminPrefs(); @@ -64,30 +64,29 @@ class AdminUserController extends BasePageController $user->country_code = $position ? $position->countryCode : null; } - $this->smarty->assign( - [ - 'username' => $variables['username'], - 'email' => $variables['email'], - 'host' => $variables['host'], - 'role' => $variables['role'], - 'role_ids' => array_keys($roles), - 'role_names' => $roles, - 'userlist' => $results, - ] - ); - + // Build order by URLs + $orderByUrls = []; foreach ($ordering as $orderType) { - $this->smarty->assign('orderby'.$orderType, url('admin/user-list?ob='.$orderType)); + $orderByUrls['orderby'.$orderType] = url('admin/user-list?ob='.$orderType); } - $content = $this->smarty->fetch('user-list.tpl'); - $this->smarty->assign(compact('title', 'meta_title', 'content')); + $this->viewData = array_merge($this->viewData, [ + 'username' => $variables['username'], + 'email' => $variables['email'], + 'host' => $variables['host'], + 'role' => $variables['role'], + 'role_ids' => array_keys($roles), + 'role_names' => $roles, + 'userlist' => $results, + 'title' => $title, + 'meta_title' => $meta_title, + ], $orderByUrls); - $this->adminrender(); + return view('admin.user-list', $this->viewData); } /** - * @return RedirectResponse|void + * @return RedirectResponse|\Illuminate\View\View * * @throws \Exception */ @@ -123,6 +122,8 @@ class AdminUserController extends BasePageController } } + $error = null; + switch ($action) { case 'add': $user += [ @@ -136,7 +137,6 @@ class AdminUserController extends BasePageController 'gameview' => 0, 'bookview' => 0, ]; - $this->smarty->assign('user', $user); break; case 'submit': if (empty($request->input('id'))) { @@ -147,7 +147,6 @@ class AdminUserController extends BasePageController } } $ret = User::signUp($request->input('username'), $request->input('password'), $request->input('email'), '', $request->input('notes'), $invites, '', true, $request->input('role'), false); - $this->smarty->assign('role', $request->input('role')); } else { $editedUser = User::find($request->input('id')); $ret = User::updateUser($editedUser->id, $request->input('username'), $request->input('email'), $request->input('grabs'), $request->input('role'), $request->input('notes'), $request->input('invites'), ($request->has('movieview') ? 1 : 0), ($request->has('musicview') ? 1 : 0), ($request->has('gameview') ? 1 : 0), ($request->has('xxxview') ? 1 : 0), ($request->has('consoleview') ? 1 : 0), ($request->has('bookview') ? 1 : 0)); @@ -169,22 +168,22 @@ class AdminUserController extends BasePageController switch ($ret) { case User::ERR_SIGNUP_BADUNAME: - $this->smarty->assign('error', 'Bad username. Try a better one.'); + $error = 'Bad username. Try a better one.'; break; case User::ERR_SIGNUP_BADPASS: - $this->smarty->assign('error', 'Bad password. Try a longer one.'); + $error = 'Bad password. Try a longer one.'; break; case User::ERR_SIGNUP_BADEMAIL: - $this->smarty->assign('error', 'Bad email.'); + $error = 'Bad email.'; break; case User::ERR_SIGNUP_UNAMEINUSE: - $this->smarty->assign('error', 'Username in use.'); + $error = 'Username in use.'; break; case User::ERR_SIGNUP_EMAILINUSE: - $this->smarty->assign('error', 'Email in use.'); + $error = 'Email in use.'; break; default: - $this->smarty->assign('error', 'Unknown save error.'); + $error = 'Unknown save error.'; break; } $user += [ @@ -194,7 +193,6 @@ class AdminUserController extends BasePageController 'role' => $request->input('role'), 'notes' => $request->input('notes'), ]; - $this->smarty->assign('user', $user); break; case 'view': default: @@ -202,25 +200,23 @@ class AdminUserController extends BasePageController $title = 'User Edit'; $id = $request->input('id'); $user = User::find($id); - - $this->smarty->assign('user', $user); } break; } - $this->smarty->assign('yesno_ids', [1, 0]); - $this->smarty->assign('yesno_names', ['Yes', 'No']); + $this->viewData = array_merge($this->viewData, [ + 'yesno_ids' => [1, 0], + 'yesno_names' => ['Yes', 'No'], + 'role_ids' => array_keys($roles), + 'role_names' => $roles, + 'user' => $user, + 'error' => $error, + 'title' => $title, + 'meta_title' => $meta_title, + ]); - $this->smarty->assign('role_ids', array_keys($roles)); - $this->smarty->assign('role_names', $roles); - $this->smarty->assign('user', $user); - - $content = $this->smarty->fetch('user-edit.tpl'); - - $this->smarty->assign(compact('title', 'meta_title', 'content')); - - $this->adminrender(); + return view('admin.user-edit', $this->viewData); } public function destroy(Request $request): RedirectResponse diff --git a/app/Http/Controllers/Admin/DeletedUsersController.php b/app/Http/Controllers/Admin/DeletedUsersController.php index 207e09436..9c685d274 100644 --- a/app/Http/Controllers/Admin/DeletedUsersController.php +++ b/app/Http/Controllers/Admin/DeletedUsersController.php @@ -80,7 +80,7 @@ class DeletedUsersController extends BasePageController $qsParams = $request->except(['ob', 'page']); $queryString = http_build_query(array_filter($qsParams, fn ($v) => $v !== '' && $v !== null)); - $this->smarty->assign([ + $this->viewData = array_merge($this->viewData, [ 'deletedusers' => $deletedUsers, 'username' => $username, 'email' => $email, @@ -90,18 +90,14 @@ class DeletedUsersController extends BasePageController 'created_to' => $createdTo, 'deleted_from' => $deletedFrom, 'deleted_to' => $deletedTo, - 'csrf_token' => csrf_token(), 'queryString' => $queryString, + 'meta_title' => 'Deleted Users', + 'meta_keywords' => 'view,deleted,users,softdeleted', + 'meta_description' => 'View and restore soft-deleted user accounts', + 'title' => 'Deleted Users', ]); - $meta_title = 'Deleted Users'; - $meta_keywords = 'view,deleted,users,softdeleted'; - $meta_description = 'View and restore soft-deleted user accounts'; - - $content = $this->smarty->fetch('deleted_users.tpl'); - $this->smarty->assign(compact('content', 'meta_title', 'meta_keywords', 'meta_description')); - - $this->adminrender(); + return view('admin.deleted-users', $this->viewData); } /** diff --git a/app/Http/Controllers/AdultController.php b/app/Http/Controllers/AdultController.php index 52cf65c8e..c634abbc3 100644 --- a/app/Http/Controllers/AdultController.php +++ b/app/Http/Controllers/AdultController.php @@ -78,7 +78,7 @@ class AdultController extends BasePageController // Build order by URLs $orderByUrls = []; foreach ($ordering as $ordertype) { - $orderByUrls['orderby'.$ordertype] = url('/XXX/' . ($id ?: 'All') . '?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0'); + $orderByUrls['orderby'.$ordertype] = url('/XXX/'.($id ?: 'All').'?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0'); } $this->viewData = array_merge($this->viewData, [ diff --git a/app/Http/Controllers/BooksController.php b/app/Http/Controllers/BooksController.php index 1bb318df1..1dab447ef 100644 --- a/app/Http/Controllers/BooksController.php +++ b/app/Http/Controllers/BooksController.php @@ -79,7 +79,7 @@ class BooksController extends BasePageController // Build order by URLs $orderByUrls = []; foreach ($ordering as $ordertype) { - $orderByUrls['orderby'.$ordertype] = url('/Books/' . ($id ?: 'All') . '?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0'); + $orderByUrls['orderby'.$ordertype] = url('/Books/'.($id ?: 'All').'?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0'); } $this->viewData = array_merge($this->viewData, [ diff --git a/app/Http/Controllers/MusicController.php b/app/Http/Controllers/MusicController.php index 39e2a1ae4..8f8aa16ff 100644 --- a/app/Http/Controllers/MusicController.php +++ b/app/Http/Controllers/MusicController.php @@ -86,7 +86,7 @@ class MusicController extends BasePageController // Build order by URLs $orderByUrls = []; foreach ($ordering as $orderType) { - $orderByUrls['orderby'.$orderType] = url('music/' . ($id ?: 'All') . '?ob='.$orderType); + $orderByUrls['orderby'.$orderType] = url('music/'.($id ?: 'All').'?ob='.$orderType); } $this->viewData = array_merge($this->viewData, [ diff --git a/resources/views/admin/binaryblacklist-edit.blade.php b/resources/views/admin/binaryblacklist-edit.blade.php new file mode 100644 index 000000000..f5bb4a39d --- /dev/null +++ b/resources/views/admin/binaryblacklist-edit.blade.php @@ -0,0 +1,172 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Binary Black/Whitelist Edit') + +@section('content') +
+
+
+
+

{{ $title }}

+
+
+ + Back to List + +
+
+
+ +
+ @if($error) + + @endif + +
+ @csrf + + +
+
+ +
+
+
+ + +
+ + The full name of a valid newsgroup. (Wildcard in the format 'alt.binaries.*') + +
+
+ +
+
+ +
+
+
+ + +
+ + The regex to be applied. (Note: Beginning and Ending / are already included) + +
+
+ +
+
+ +
+
+
+ + +
+ + A description for this regex + +
+
+ +
+
+ +
+
+
+ @foreach($msgcol_ids as $i => $id) +
+ msgcol ?? 1) == $id ? 'checked' : '' }}> + +
+ @endforeach +
+ + Which field in the message to apply the black/white list to. + +
+
+ +
+
+ +
+
+
+ @foreach($status_ids as $i => $id) +
+ status ?? 1) == $id ? 'checked' : '' }}> + +
+ @endforeach +
+ + Only active regexes are applied during the release process. + +
+
+ +
+
+ +
+
+
+ @foreach($optype_ids as $i => $id) +
+ optype ?? 1) == $id ? 'checked' : '' }}> + +
+ @endforeach +
+ + Black will exclude all messages for a group which match this regex. White will include only those which match. + +
+
+
+
+ + +
+ +@push('scripts') + +@endpush +@endsection + diff --git a/resources/views/admin/binaryblacklist-list.blade.php b/resources/views/admin/binaryblacklist-list.blade.php new file mode 100644 index 000000000..1946da85f --- /dev/null +++ b/resources/views/admin/binaryblacklist-list.blade.php @@ -0,0 +1,192 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Binary Black/White List') + +@section('content') +
+
+
+
+

{{ $title }}

+
+
+ + Add New Blacklist + +
+
+
+ +
+
+
+
+ +
+
+

+ Binaries can be prevented from being added to the index if they match a regex in the blacklist. + They can also be included only if they match a regex (whitelist). + Click Edit or on the blacklist to enable/disable. +

+
+
+
+ +
+ +
+ + + + + + + + + + + + + + + + @forelse($binlist as $bin) + + + + + + + + + + + + @empty + + + + @endforelse + +
IDGroupDescriptionTypeFieldStatusRegexLast ActivityActions
{{ $bin->id }} + + {{ str_replace('alt.binaries', 'a.b', $bin->groupname) }} + + + + {{ $bin->description }} + + + @if($bin->optype == 1) + Black + @else + White + @endif + + @if($bin->msgcol == 1) + Subject + @elseif($bin->msgcol == 2) + Poster + @else + MessageID + @endif + + @if($bin->status == 1) + Active + @else + Disabled + @endif + + + + @if($bin->last_activity) + + {{ $bin->last_activity }} + + @else + Never + @endif + +
+ + + + +
+
+
+ No blacklist entries found +
+
+
+
+ + +
+ +@push('scripts') + +@endpush +@endsection + diff --git a/resources/views/admin/category-edit.blade.php b/resources/views/admin/category-edit.blade.php new file mode 100644 index 000000000..ac5677218 --- /dev/null +++ b/resources/views/admin/category-edit.blade.php @@ -0,0 +1,174 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Category Edit') + +@section('content') +
+
+
+

{{ $title }}

+ + Back to Categories + +
+
+ + @if(session('error')) +
+ {{ session('error') }} +
+ @endif + +
+ @if($category) +
+ @csrf + + +
+
+ +
+
+

{{ $category->title }}

+
+
+ +
+
+ +
+
+
+ + +
+ Parent category cannot be changed from this interface +
+
+ +
+
+ +
+
+
+ + +
+ Brief explanation of what belongs in this category +
+
+ +
+
+ +
+
+
+ + +
+ Minimum file size for releases in this category (in bytes). Set to 0 to disable. +
+
+ +
+
+ +
+
+
+ + +
+ Maximum file size for releases in this category (in bytes). Set to 0 to disable. +
+
+ +
+
+ +
+
+ @foreach($status_ids as $index => $statusId) +
+ status ?? 0) == $statusId ? 'checked' : '' }}> + +
+ @endforeach +
+ Inactive categories won't appear in menus but can still be used for release matching +
+
+
+ +
+
+ +
+
+
+ disablepreview ?? 0) == 0 ? 'checked' : '' }}> + +
+
+ disablepreview ?? 0) == 1 ? 'checked' : '' }}> + +
+
+ Disabling prevents ffmpeg from generating previews for releases in this category +
+
+
+ + +
+ @else +
+ No category selected. Please select a category to edit. +
+ + @endif +
+
+ +@push('scripts') + +@endpush +@endsection + diff --git a/resources/views/admin/category-list.blade.php b/resources/views/admin/category-list.blade.php new file mode 100644 index 000000000..3edfd8604 --- /dev/null +++ b/resources/views/admin/category-list.blade.php @@ -0,0 +1,224 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Category List') + +@section('content') +
+
+
+

{{ $title }}

+ + Add New Category + +
+
+ +
+
+ + Make a category inactive to remove it from the menu. This does not prevent binaries being matched into an + appropriate category. Disable preview prevents ffmpeg being used for releases in the category. +
+ +
+ + + + + + + + + + + + + + + @foreach($categorylist as $category) + + + + + + + + + + + @endforeach + +
+
+ ID + +
+
+
+ Title + +
+
ParentMin SizeMax SizeStatusPreviewActions
{{ $category->id }} + + {{ $category->title }} + + + @if($category->parent) + + {{ $category->parent->title }} + + @else + N/A + @endif + + @if($category->minsizetoformrelease != 0) +
+ + {{ \Blacklight\utility\Utility::bytesToSizeString($category->minsizetoformrelease) }} +
+ @else + + @endif +
+ @if($category->maxsizetoformrelease != 0) +
+ + {{ \Blacklight\utility\Utility::bytesToSizeString($category->maxsizetoformrelease) }} +
+ @else + + @endif +
+ + {{ $category->status == 1 ? 'Active' : 'Inactive' }} + + + + {{ $category->disablepreview == 1 ? 'Disabled' : 'Enabled' }} + + +
+ + + + +
+
+
+ + @if(count($categorylist) == 0) +
+ No categories found. +
+ @endif +
+ + +
+ + + + +@push('scripts') + +@endpush + +@push('styles') + +@endpush +@endsection + diff --git a/resources/views/admin/category-regexes-edit.blade.php b/resources/views/admin/category-regexes-edit.blade.php new file mode 100644 index 000000000..d3536f3c8 --- /dev/null +++ b/resources/views/admin/category-regexes-edit.blade.php @@ -0,0 +1,171 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Category Regex Edit') + +@section('content') +
+
+
+
+

{{ $title }}

+
+
+ + Back to List + +
+
+
+ +
+ @if($error) + + @endif + +
+ @csrf + + +
+
+ +
+
+
+ + +
+ + Regex to match against a group or multiple groups. Delimiters are already added, and PCRE_CASELESS is added after for case insensitivity.
+ Example of matching a single group: alt\.binaries\.example
+ Example of matching multiple groups: alt\.binaries.* +
+
+
+ +
+
+ +
+
+
+ + +
+ + Regex to use when categorizing releases.
+ The regex delimiters are not added, you MUST add them. See this page.
+ To make the regex case insensitive, add i after the last delimiter. +
+
+
+ +
+
+ +
+
+
+ + +
+ + Description for this regex. You can include an example usenet subject this regex would match on. + +
+
+ +
+
+ +
+
+
+ + +
+ + The order to run this regex in. Must be a number, 0 or higher.
+ If multiple regex have the same ordinal, MySQL will randomly sort them. +
+
+
+ +
+
+ +
+
+
+ @foreach($status_ids as $k => $id) +
+ status ?? 1) == $id ? 'checked' : '' }}> + +
+ @endforeach +
+ + Only active regex are used during the collection matching process. + +
+
+ +
+
+ +
+
+
+ + +
+ + Select a category which releases matched to this regex will go into. + +
+
+
+
+ + +
+ +@push('scripts') + +@endpush +@endsection + diff --git a/resources/views/admin/category-regexes-list.blade.php b/resources/views/admin/category-regexes-list.blade.php new file mode 100644 index 000000000..dc72a7412 --- /dev/null +++ b/resources/views/admin/category-regexes-list.blade.php @@ -0,0 +1,222 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Category Regex List') + +@section('content') +
+
+
+
+

{{ $title }}

+
+
+ + Add New Regex + +
+
+
+ +
+
+
+
+ +
+
+

+ This page lists regular expressions used for categorizing releases.
+ You can recategorize all releases by running misc/update/update_releases 6 true +

+
+
+
+ +
+ +
+
+
+ @csrf +
+ + + +
+
+
+
+ + @if($regex && count($regex) > 0) + @if(method_exists($regex, 'links')) +
+ {{ $regex->onEachSide(5)->links() }} +
+ @endif +
+ + + + + + + + + + + + + + + @foreach($regex as $row) + + + + + + + + + + + @endforeach + +
IDGroupDescriptionRegexOrdinalStatusCategoryActions
{{ $row->id }} + {{ $row->group_regex }} + + {{ \Illuminate\Support\Str::limit($row->description, 50) }} + + {{ \Illuminate\Support\Str::limit(htmlspecialchars($row->regex), 50) }} + {{ $row->ordinal }} + @if($row->status == 1) + Active + @else + Disabled + @endif + + + {{ $row->categories_id }} + + +
+ + + + +
+
+
+ @if(method_exists($regex, 'links')) +
+ {{ $regex->onEachSide(5)->links() }} +
+ @endif + @else +
+ No regex patterns found. Try a different search term or add a new regex. +
+ @endif +
+ + +
+ + + + +@push('scripts') + +@endpush +@endsection + diff --git a/resources/views/admin/collection-regexes-edit.blade.php b/resources/views/admin/collection-regexes-edit.blade.php new file mode 100644 index 000000000..94fd28d21 --- /dev/null +++ b/resources/views/admin/collection-regexes-edit.blade.php @@ -0,0 +1,149 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Collection Regex Edit') + +@section('content') +
+
+
+
+

{{ $title }}

+
+
+ + Back to List + +
+
+
+ +
+ @if($error) + + @endif + +
+ @csrf + + +
+
+ +
+
+
+ + +
+ + Regex to match against a group or multiple groups. Delimiters are already added, and PCRE_CASELESS is added after for case insensitivity.
+ Example of matching a single group: alt\.binaries\.example
+ Example of matching multiple groups: alt\.binaries.* +
+
+
+ +
+
+ +
+
+
+ + +
+ + Regex to use when grouping binaries into collections.
+ The regex delimiters are not added, you MUST add them. See this page.
+ To make the regex case insensitive, add i after the last delimiter. +
+
+
+ +
+
+ +
+
+
+ + +
+ + Description for this regex. You can include an example usenet subject this regex would match on. + +
+
+ +
+
+ +
+
+
+ + +
+ + The order to run this regex in. Must be a number, 0 or higher.
+ If multiple regex have the same ordinal, MySQL will randomly sort them. +
+
+
+ +
+
+ +
+
+
+ @foreach($status_ids as $k => $id) +
+ status ?? 1) == $id ? 'checked' : '' }}> + +
+ @endforeach +
+ + Only active regex are used during the collection matching process. + +
+
+
+
+ + +
+ +@push('scripts') + +@endpush +@endsection + diff --git a/resources/views/admin/collection-regexes-list.blade.php b/resources/views/admin/collection-regexes-list.blade.php new file mode 100644 index 000000000..269555928 --- /dev/null +++ b/resources/views/admin/collection-regexes-list.blade.php @@ -0,0 +1,215 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Collection Regex List') + +@section('content') +
+
+
+
+

{{ $title }}

+
+
+ + Add New Regex + +
+
+
+ +
+
+
+
+ +
+
+

+ This page lists regular expressions used for grouping binaries into collections.
+ You can test your regex patterns using the test feature. +

+
+
+
+ +
+ +
+
+
+ @csrf +
+ + + +
+
+
+
+ + @if($regex && count($regex) > 0) + @if(method_exists($regex, 'links')) +
+ {{ $regex->onEachSide(5)->links() }} +
+ @endif +
+ + + + + + + + + + + + + + @foreach($regex as $row) + + + + + + + + + + @endforeach + +
IDGroupDescriptionRegexOrdinalStatusActions
{{ $row->id }} + {{ $row->group_regex }} + + {{ \Illuminate\Support\Str::limit($row->description, 50) }} + + {{ \Illuminate\Support\Str::limit(htmlspecialchars($row->regex), 50) }} + {{ $row->ordinal }} + @if($row->status == 1) + Active + @else + Disabled + @endif + +
+ + + + +
+
+
+ @if(method_exists($regex, 'links')) +
+ {{ $regex->onEachSide(5)->links() }} +
+ @endif + @else +
+ No regex patterns found. Try a different search term or add a new regex. +
+ @endif +
+ + +
+ + + + +@push('scripts') + +@endpush +@endsection + diff --git a/resources/views/admin/collection-regexes-test.blade.php b/resources/views/admin/collection-regexes-test.blade.php new file mode 100644 index 000000000..a544235f0 --- /dev/null +++ b/resources/views/admin/collection-regexes-test.blade.php @@ -0,0 +1,97 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Collection Regex Test') + +@section('content') +
+
+
+
+

{{ $title }}

+
+
+ + Back to List + +
+
+
+ +
+
+ Test your collection regex patterns against actual binary data from your database. +
+ +
+
+
+ + + Enter a newsgroup name to test against +
+
+ + + Number of binaries to test (max 1000) +
+
+ +
+ + + Enter the regex pattern to test. Include delimiters and flags. +
+ + +
+ + @if($data) +
+
Test Results:
+ + @if(count($data) > 0) +
+ + + + + + + + + + @foreach($data as $row) + + + + + + @endforeach + +
Binary IDSubjectMatch
{{ $row['binaryID'] ?? $row['id'] ?? 'N/A' }}{{ \Illuminate\Support\Str::limit($row['subject'] ?? '', 100) }} + @if(isset($row['match']) && $row['match']) + Match + @if(isset($row['name'])) +
Name: {{ $row['name'] }} + @endif + @else + No Match + @endif +
+
+ +
+ + Tested {{ count($data) }} binaries. Review the matches above. +
+ @else +
+ No binaries found for the specified group or no matches found. +
+ @endif + @endif +
+
+@endsection diff --git a/resources/views/admin/content-add.blade.php b/resources/views/admin/content-add.blade.php new file mode 100644 index 000000000..fbaf8b567 --- /dev/null +++ b/resources/views/admin/content-add.blade.php @@ -0,0 +1,169 @@ +@extends('layouts.admin') + +@section('content') +
+
+ +
+

+ {{ $title }} +

+
+ + +
+ @csrf + + @if(!empty($content['id'])) + + @endif + +
+ +
+ + +
+ + +
+ + +

Internal URL (e.g., /about) or external URL (e.g., https://example.com)

+
+ + +
+ + +

HTML is allowed

+
+ +
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +

Lower numbers appear first

+
+
+ + +
+ + +

SEO meta description

+
+ + +
+ + +

Comma-separated keywords for SEO

+
+ + +
+ + + Cancel + +
+
+
+
+
+@endsection + diff --git a/resources/views/admin/content-list.blade.php b/resources/views/admin/content-list.blade.php new file mode 100644 index 000000000..b8c9610b5 --- /dev/null +++ b/resources/views/admin/content-list.blade.php @@ -0,0 +1,120 @@ +@extends('layouts.admin') + +@section('content') +
+
+ +
+
+

+ {{ $title }} +

+ + Add New Content + +
+
+ + + @if(count($contentlist) > 0) +
+ + + + + + + + + + + + + + + @foreach($contentlist as $item) + + + + + + + + + + + @endforeach + +
IDTitleURLTypeRoleStatusOrdinalActions
{{ $item->id }} +
{{ $item->title }}
+
+ @if(!empty($item->url)) + + {{ Str::limit($item->url, 30) }} + + @else + N/A + @endif + + @if($item->contenttype == 1) + + Useful Link + + @elseif($item->contenttype == 2) + + Article + + @elseif($item->contenttype == 3) + + Homepage + + @else + N/A + @endif + + @if($item->role == 1) + Everyone + @elseif($item->role == 2) + Logged in Users + @elseif($item->role == 3) + Admins + @else + N/A + @endif + + @if($item->status == 1) + + Enabled + + @else + + Disabled + + @endif + {{ $item->ordinal ?? 0 }} + +
+
+ @else +
+ +

No content found

+

Create your first content to get started.

+
+ @endif +
+
+@endsection + diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 32f590d39..6abad0623 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -153,7 +153,7 @@ Categories - + Settings diff --git a/resources/views/admin/deleted-users.blade.php b/resources/views/admin/deleted-users.blade.php new file mode 100644 index 000000000..9e10377d2 --- /dev/null +++ b/resources/views/admin/deleted-users.blade.php @@ -0,0 +1,265 @@ +@extends('layouts.admin') + +@section('content') +
+
+ +
+
+

+ {{ $title }} +

+ + Back to Active Users + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + + Clear + +
+
+
+ + + @if(session('success')) +
+

+ {{ session('success') }} +

+
+ @endif + + @if(session('error')) +
+

+ {{ session('error') }} +

+
+ @endif + + + @if(count($deletedusers) > 0) +
+ @csrf +
+
+ + + +
+
+ +
+ + + + + + + + + + + + + + + @foreach($deletedusers as $user) + + + + + + + + + + + @endforeach + +
+ + + + Username + @if(str_starts_with($orderby ?? '', 'username')) + + @endif + + + + Email + @if(str_starts_with($orderby ?? '', 'email')) + + @endif + + RoleHost + + Created + @if(str_starts_with($orderby ?? '', 'createdat')) + + @endif + + + + Deleted + @if(str_starts_with($orderby ?? '', 'deletedat')) + + @endif + + Actions
+ + +
{{ $user->username }}
+
{{ $user->email }} + + {{ $user->rolename ?? 'N/A' }} + + {{ $user->host ?? 'N/A' }} + {{ $user->created_at ? $user->created_at->format('Y-m-d H:i') : 'N/A' }} + + {{ $user->deleted_at ? $user->deleted_at->format('Y-m-d H:i') : 'N/A' }} + + +
+
+
+ + +
+ {{ $deletedusers->links() }} +
+ @else +
+ +

No deleted users found

+

There are no soft-deleted users matching your filters.

+
+ @endif +
+
+ + +@endsection + diff --git a/resources/views/admin/release-naming-regexes-edit.blade.php b/resources/views/admin/release-naming-regexes-edit.blade.php new file mode 100644 index 000000000..2319413c4 --- /dev/null +++ b/resources/views/admin/release-naming-regexes-edit.blade.php @@ -0,0 +1,149 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Release Naming Regex Edit') + +@section('content') +
+
+
+
+

{{ $title }}

+
+
+ + Back to List + +
+
+
+ +
+ @if($error) + + @endif + +
+ @csrf + + +
+
+ +
+
+
+ + +
+ + Regex to match against a group or multiple groups. Delimiters are already added, and PCRE_CASELESS is added after for case insensitivity.
+ Example of matching a single group: alt\.binaries\.example
+ Example of matching multiple groups: alt\.binaries.* +
+
+
+ +
+
+ +
+
+
+ + +
+ + Regex to use when renaming releases.
+ The regex delimiters are not added, you MUST add them. See this page.
+ To make the regex case insensitive, add i after the last delimiter. +
+
+
+ +
+
+ +
+
+
+ + +
+ + Description for this regex. You can include an example release name this regex would match on. + +
+
+ +
+
+ +
+
+
+ + +
+ + The order to run this regex in. Must be a number, 0 or higher.
+ If multiple regex have the same ordinal, MySQL will randomly sort them. +
+
+
+ +
+
+ +
+
+
+ @foreach($status_ids as $k => $id) +
+ status ?? 1) == $id ? 'checked' : '' }}> + +
+ @endforeach +
+ + Only active regex are used during the release naming process. + +
+
+
+
+ + +
+ +@push('scripts') + +@endpush +@endsection + diff --git a/resources/views/admin/release-naming-regexes-list.blade.php b/resources/views/admin/release-naming-regexes-list.blade.php new file mode 100644 index 000000000..fdef5eb75 --- /dev/null +++ b/resources/views/admin/release-naming-regexes-list.blade.php @@ -0,0 +1,215 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Release Naming Regex List') + +@section('content') +
+
+
+
+

{{ $title }}

+
+
+ + Add New Regex + +
+
+
+ +
+
+
+
+ +
+
+

+ This page lists regular expressions used for renaming releases based on their names.
+ You can test your regex patterns to see how they will rename releases. +

+
+
+
+ +
+ +
+
+
+ @csrf +
+ + + +
+
+
+
+ + @if($regex && count($regex) > 0) + @if(method_exists($regex, 'links')) +
+ {{ $regex->onEachSide(5)->links() }} +
+ @endif +
+ + + + + + + + + + + + + + @foreach($regex as $row) + + + + + + + + + + @endforeach + +
IDGroupDescriptionRegexOrdinalStatusActions
{{ $row->id }} + {{ $row->group_regex }} + + {{ \Illuminate\Support\Str::limit($row->description, 50) }} + + {{ \Illuminate\Support\Str::limit(htmlspecialchars($row->regex), 50) }} + {{ $row->ordinal }} + @if($row->status == 1) + Active + @else + Disabled + @endif + +
+ + + + +
+
+
+ @if(method_exists($regex, 'links')) +
+ {{ $regex->onEachSide(5)->links() }} +
+ @endif + @else +
+ No regex patterns found. Try a different search term or add a new regex. +
+ @endif +
+ + +
+ + + + +@push('scripts') + +@endpush +@endsection + diff --git a/resources/views/admin/release-naming-regexes-test.blade.php b/resources/views/admin/release-naming-regexes-test.blade.php new file mode 100644 index 000000000..a9db0f81e --- /dev/null +++ b/resources/views/admin/release-naming-regexes-test.blade.php @@ -0,0 +1,107 @@ +@extends('layouts.admin') + +@section('title', $title ?? 'Release Naming Regex Test') + +@section('content') +
+
+
+
+

{{ $title }}

+
+
+ + Back to List + +
+
+
+ +
+
+ Test your release naming regex patterns against actual release data from your database. +
+ +
+
+
+ + + Enter a newsgroup name to test against +
+
+ + + Results to display +
+
+ + + Max releases to query +
+
+ +
+ + + Enter the regex pattern to test. Include delimiters and flags. +
+ + +
+ + @if($data) +
+
Test Results:
+ + @if(count($data) > 0) +
+ + + + + + + + + + + @foreach($data as $row) + + + + + + + @endforeach + +
Release IDOriginal NameNew NameMatch
{{ $row['releaseID'] ?? $row['id'] ?? 'N/A' }}{{ \Illuminate\Support\Str::limit($row['oldName'] ?? $row['name'] ?? '', 80) }} + @if(isset($row['newName']) && $row['newName']) + {{ \Illuminate\Support\Str::limit($row['newName'], 80) }} + @else + + @endif + + @if(isset($row['match']) && $row['match']) + Match + @else + No Match + @endif +
+
+ +
+ + Tested {{ count($data) }} releases. Review the matches above. +
+ @else +
+ No releases found for the specified group or no matches found. +
+ @endif + @endif +
+
+@endsection diff --git a/resources/views/admin/role-add.blade.php b/resources/views/admin/role-add.blade.php new file mode 100644 index 000000000..f3b1b5292 --- /dev/null +++ b/resources/views/admin/role-add.blade.php @@ -0,0 +1,217 @@ +@extends('layouts.admin') + +@section('content') +
+
+ +
+

+ {{ $title }} +

+
+ + +
+ @csrf + + +
+ +
+ + +
+ +
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ + +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + +
+ + + Cancel + +
+
+
+
+
+@endsection + diff --git a/resources/views/admin/role-edit.blade.php b/resources/views/admin/role-edit.blade.php new file mode 100644 index 000000000..a4f53aee4 --- /dev/null +++ b/resources/views/admin/role-edit.blade.php @@ -0,0 +1,257 @@ +@extends('layouts.admin') + +@section('content') +
+
+ +
+

+ {{ $title }} +

+
+ + + @if($role) +
+ @csrf + + + +
+ +
+ + +
+ +
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
+ + +
+ +
+
+ hasPermissionTo('preview') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ hasPermissionTo('hideads') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ hasPermissionTo('edit release') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ hasPermissionTo('view console') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ hasPermissionTo('view movies') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ hasPermissionTo('view audio') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ hasPermissionTo('view pc') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ hasPermissionTo('view tv') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ hasPermissionTo('view adult') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ hasPermissionTo('view books') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ hasPermissionTo('view other') ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+
+ + +
+ + + Cancel + +
+
+
+ @else +
+ +

Role not found

+

The requested role could not be found.

+ + Back to Role List + +
+ @endif +
+
+@endsection + diff --git a/resources/views/admin/role-list.blade.php b/resources/views/admin/role-list.blade.php new file mode 100644 index 000000000..2c9732620 --- /dev/null +++ b/resources/views/admin/role-list.blade.php @@ -0,0 +1,86 @@ +@extends('layouts.admin') + +@section('content') +
+
+ +
+
+

+ {{ $title }} +

+ + Add New Role + +
+
+ + + @if(count($userroles) > 0) +
+ + + + + + + + + + + + + + + @foreach($userroles as $role) + + + + + + + + + + + @endforeach + +
IDRole NameAPI RequestsDownload RequestsDefault InvitesRate LimitDefaultActions
{{ $role->id }} +
{{ $role->name }}
+
{{ $role->apirequests ?? 'N/A' }}{{ $role->downloadrequests ?? 'N/A' }}{{ $role->defaultinvites ?? 0 }}{{ $role->rate_limit ?? 60 }} + @if($role->isdefault) + + Yes + + @else + + No + + @endif + + +
+
+ @else +
+ +

No roles found

+

Create your first role to get started.

+
+ @endif +
+
+@endsection + diff --git a/resources/views/admin/site-edit-reference.tpl b/resources/views/admin/site-edit-reference.tpl new file mode 100644 index 000000000..cb24f0afe --- /dev/null +++ b/resources/views/admin/site-edit-reference.tpl @@ -0,0 +1,1333 @@ +
+
+
+

{$title}

+
+
+ +
+
+ {{csrf_field()}} + + + + {if isset ($error) && $error != ''} +
{$error}
+ {/if} + +
+
Main Site Settings, HTML Layout, Tags
+
+ +
+
+ +
+
+
+ + +
+ Displayed in the header on every public page. +
+
+ +
+
+ +
+
+
+ + +
+ Stem meta-tag appended to all page title tags. +
+
+ +
+
+ +
+
+
+ + +
+ Stem meta-description appended to all page meta description tags. +
+
+ +
+
+ +
+
+
+ + +
+ Stem meta-keywords appended to all page meta keyword tags. +
+
+ +
+
+ +
+
+
+ + +
+ Displayed in the footer section of every public page. +
+
+ +
+
+ +
+
+
+ + +
+ The relative path to the landing page shown when a user logs in, or clicks the home link. +
+
+ +
+
+ +
+
+
+ + +
+ Optional URL to prepend to external links. +
+
+ +
+
+ +
+
+
+ + +
+ Text displayed in the terms and conditions page. +
+
+ +
+
Usenet Settings
+
+ +
+
+ +
+
+
+ + +
+ + Levels deep to store the nzb Files. +
If you change this you must run the misc/testing/DB/nzb-reorg script! +
+
+
+ +
+
+ +
+
+
+ + +
+ The number of hours incomplete parts and binaries will be retained. +
+
+ +
+
+ +
+
+
+ + +
+ The number of days releases will be retained for use throughout site. Set to 0 to disable. +
+
+ +
+
+ +
+
+
+ + +
+ The number of hours releases categorized as Misc->Other will be retained. Set to 0 to disable. +
+
+ +
+
+ +
+
+
+ + +
+ The number of hours releases categorized as Misc->Hashed will be retained. Set to 0 to disable. +
+
+ +
+
+ +
+
+
+ + +
+ Default is 0 (off), which will remove parts in one go. If backfilling or importing and parts table is large, using chunks of 5000+ will speed up removal. Normal indexing is fastest with this setting at 0. +
+
+ +
+
+ +
+
+
+ + +
+ The minimum number of files to make a release. i.e. if set to two, then releases which only contain one file will not be created. +
+
+ +
+
+ +
+
+
+ + +
+ The minimum total size in bytes to make a release. If set to 0, then ignored. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum total size in bytes to make a release. If set to 0, then ignored. Only deletes during release creation. +
+
+ +
+
+ +
+
+
+ + +
+ The minimum completion percent to make a release. i.e. if set to 97, then releases under 97% completion will not be created. If set to 0, then ignored. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to update download counts when someone downloads a release. +
+
+ +
+
+ +
+
+
+ + +
+ The time in hours to check for crossposted releases - this will delete 1 of the releases if the 2 are posted by the same person in the same time period. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum number of messages to fetch at a time from the server. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum number of headers that update binaries sees as the total range. This ensures that a total of no more than this is attempted to be downloaded at one time per group. +
+
+ +
+
+ +
+
+
+ + +
+
+ + + Days +
+
+ + + Posts +
+ Scan back X (posts/days) for each new group? Can backfill to scan further. +
+
+ +
+
+ +
+
+
+ + +
+ The target date for safe backfill. Format: YYYY-MM-DD +
+
+ +
+
+ +
+
+
+ + +
+ Whether to disable a group automatically during backfill if the target date has been reached. +
+
+ +
+
Lookup Settings
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to lookup TvRage ids on the web. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to lookup book information from Amazon. +
+
+ +
+
+ +
+
+
+ + +
+ Categories of Books to lookup information for (only work if Lookup Books is set to yes). +
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to lookup film information from IMDB or TheMovieDB. +
+
+ +
+
+ +
+
+
+ + +
+ Preferred language for scraping external sources. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to lookup anime information from AniDB when processing binaries. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to lookup music information from Amazon. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to save a preview of an audio release (requires deep rar inspection enabled).
It is advisable to specify a path to the lame binary to reduce the size of audio previews.
+
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to lookup game information from Amazon. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to lookup XXX information when processing binaries. +
+
+
+
Language/Categorization Options
+
+ +
+
+ +
+
+
+ + +
+ Whether to send foreign movies/tv to foreign sections or not. If set to true they will go in foreign categories. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to send WEB-DL to the WEB-DL section or not. If set to true they will go in WEB-DL category, false will send them in HD TV. This will also make them inaccessible to Sickbeard and possibly Couchpotato. +
+
+ +
+
Password Settings
+
+ +
+
+ +
+
+
+ + +
+ Try to download the last rar or zip file? (This is good if most of the files are at the end.) Note: The first rar/zip is still downloaded. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to show passworded releases in browse, search, api and rss feeds. +
+
+
+
Additional Usenet Settings
+
+ +
+
+ +
+
+
+ + + GB +
+ The maximum size in gigabytes to postprocess a release. If set to 0, then ignored. +
+
+ +
+
+ +
+
+
+ + + MB +
+ The minimum size in megabytes to post process (additional) a release. If set to 0, then ignored. +
+
+ +
+
Advanced Settings - For advanced users
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of NZB files to create on stage 5 at a time in update_releases. If more are to be created it will loop stage 5 until none remain. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to repair parts or not, increases backfill/binaries updating time. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to put unreceived parts into missed_parts table when running binaries(safe) or backfill scripts. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of articles to attempt to repair at a time. If you notice that you are getting a lot of parts into the missed_parts table, it is possible that you USP is not keeping up with the requests. Try to reduce the threads to safe scripts or stop using safe scripts until improves. +
+
+ +
+
+ +
+
+
+ + +
+ Maximum amount of times to try part repair. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to retrieve a JPG file while additional post processing, these are usually on XXX releases. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to process a video thumbnail image. You must have ffmpeg for this. +
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to process a video sample, these videos are very short 1-3 seconds, 100KB on average, in ogg video format. You must have ffmpeg for this. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum number of segments to download to generate the sample video file or jpg sample image. (Default 2) +
+
+ +
+
+ +
+
+
+ + + seconds +
+ The maximum duration (in seconds) for ffmpeg to generate the sample for. (Default 5) +
+
+ +
+
+ +
+
+
+ + + levels +
+ If a rar/zip has rar/zip inside of it, how many times should we go in those inner rar/zip files. +
+
+ +
+
+ +
+
+
+ + +
+ You can add a regex here to set releases to potentially passworded when a file name inside a rar/zip matches this regex. You must ensure this regex is valid, a non valid regex will cause errors during processing! +
+
+
+
Movie Trailer Settings
+
+ +
+
+ +
+
+
+ + +
+ Fetch and display trailers from TraktTV (Requires API key) and/or TrailerAddict on the details page? +
+
+ +
+
+ +
+
+
+ + + px +
+ Maximum width in pixels for the trailer window. (Default: 480) +
+
+ +
+
+ +
+
+
+ + + px +
+ Maximum height in pixels for the trailer window. (Default: 345) +
+
+ +
+
Advanced - Postprocessing Settings
+
+ +
+
+ +
+
+
+ + + seconds +
+ How much time to wait for unrar/7zip/mediainfo/ffmpeg/avconv before killing it, set to 0 to disable. 60 is a good value. Requires the GNU Timeout path to be set. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of releases to process for passwords/previews/mediainfo per run. Every release gets processed here. This uses NNTP an connection, 1 per thread. This does not query Amazon. +
+
+ +
+
+ +
+
+
+ + +
+ If a part fails to download while post processing, this will retry up to the amount you set, then give up. +
+
+ +
+
+ +
+
+
+ + +
+ This overrides the above setting if set above 1. How many parts to check for a password before giving up. This slows down post processing massively, better to leave it 1. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of TV shows to process with TVRage per run. This does not use an NNTP connection or query Amazon. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of movies to process with IMDB per run. This does not use an NNTP connection or query Amazon. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of anime to process with anidb per run. This does not use an NNTP connection or query Amazon. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of music to process with amazon per run. This does not use an NNTP connection. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of games to process with amazon per run. This does not use an NNTP connection. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of books to process with amazon per run. This does not use an NNTP connection +
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of XXX to process per run. This does not use an NNTP connection or query Amazon. +
+
+ +
+
+ +
+
+
+ + +
+ The maximum number of releases to check per run (threaded script only). +
+
+ +
+
+ +
+
+
+ + + ms +
+ Sleep time in milliseconds to wait in between amazon requests. If you thread post-proc, multiply by the number of threads. ie Postprocessing Threads = 12, Amazon sleep time = 12000
https://affiliate-program.amazon.com/gp/advertising/api/detail/faq.html
+
+
+ +
+
NFO Processing Settings
+
+ +
+
+ +
+
+
+ + +
+ Whether to attempt to retrieve an nfo file from usenet.
+ NOTE: disabling nfo lookups will disable movie lookups. +
+
+
+ +
+
+ +
+
+
+ + +
+ The maximum amount of NFO files to process per run. This uses NNTP an connection, 1 per thread. This does not query Amazon. +
+
+ +
+
+ +
+
+
+ + + GB +
+ The maximum size in gigabytes of a release to process it for NFOs. If set to 0, then ignored. +
+
+ +
+
+ +
+
+
+ + + MB +
+ The minimum size in megabytes of a release to process it for NFOs. If set to 0, then ignored. +
+
+ +
+
+ +
+
+
+ + + times +
+ How many times to retry when a NFO fails to download. If set to 0, we will not retry. The max is 7. +
+
+
+
Connection Settings
+
+ +
+
+ +
+
+
+ + +
+ The maximum number of retry attempts to connect to nntp provider. On error, each retry takes approximately 5 seconds nntp returns reply. (Default 10) +
+
+ +
+
+ +
+
+
+ + +
+ The time in hours to wait, since last activity, before releases without parts counts in the subject are are created.
Setting this below 2 hours could create incomplete releases.
+
+
+ +
+
+ +
+
+
+ + +
+ How many hours to wait before converting a collection into a release that is considered "stuck".
Default value is 48 hours.
+
+
+ +
+
Developer Settings
+
+ +
+
+ +
+
+
+ + +
+ For developers. Whether to log all headers that have 'yEnc' and are dropped. Logged to not_yenc/groupname.dropped.txt. +
+
+ +
+
Advanced - Threaded Settings
+
+ +
+
+ +
+
+
+ + +
+ The number of threads for update_binaries. If you notice that you are getting a lot of parts into the missed_parts table, it is possible that you USP is not keeping up with the requests. Try to reduce the threads. At least until the cause can be determined. +
+
+ +
+
+ +
+
+
+ + +
+ The number of threads for backfill. +
+
+ +
+
+ +
+
+
+ + +
+ The number of threads for releases update scripts. +
+
+ +
+
+ +
+
+
+ + +
+ The number of threads for additional postprocessing. This includes deep rar inspection, preview and sample creation and nfo processing. +
+
+ +
+
+ +
+
+
+ + +
+ The number of threads for nfo postprocessing. The max is 16, if you set anything higher it will use 16. +
+
+ +
+
+ +
+
+
+ + +
+ The number of threads for non-amazon postprocessing. This includes movies, anime and tv lookups. +
+
+ +
+
+ +
+
+
+ + +
+ The number of threads for fixReleasesNames. This includes md5, nfos, par2 and filenames. +
+
+ +
+
User Settings
+
+ +
+
+ +
+
+
+ + +
+ The status of registrations to the site. +
+
+ +
+
+ +
+
+
+ + +
+ The number of days to preserve user download history, for use when checking limits being hit. Set to zero will remove all records of what users download, but retain history of when, so that role based limits can still be applied. +
+
+ +
+
+ +
+
+
+ + +
+ A comma separated list of IP addresses which will be excluded from user limits on number of requests and downloads per IP address. Include values for google reader and other shared services which may be being used. +
+
+ +
+ +
diff --git a/resources/views/admin/site-edit.blade.php b/resources/views/admin/site-edit.blade.php new file mode 100644 index 000000000..44d5a605b --- /dev/null +++ b/resources/views/admin/site-edit.blade.php @@ -0,0 +1,1142 @@ +@extends('layouts.admin') + +@section('content') +
+
+ +
+

+ {{ $title }} +

+
+ + + @if(session('success')) +
+

+ {{ session('success') }} +

+
+ @endif + + @if(!empty($error)) +
+

+ {{ $error }} +

+
+ @endif + + + + @csrf + + +
+ +
+

Main Site Settings, HTML Layout, Tags

+ +
+
+ + +

Displayed in the header on every public page.

+
+ +
+ + +

Stem meta-tag appended to all page title tags.

+
+ +
+ + +

Stem meta-description appended to all page meta description tags.

+
+ +
+ + +

Stem meta-keywords appended to all page meta keyword tags.

+
+ +
+ + +

Displayed in the footer section of every public page.

+
+ +
+ + +

The relative path to the landing page shown when a user logs in, or clicks the home link.

+
+ +
+ + +

Optional URL to prepend to external links.

+
+ +
+ + +

Text displayed in the terms and conditions page.

+
+
+
+ + +
+

Usenet Settings

+ +
+
+ + +

Levels deep to store the nzb Files. If you change this you must run the misc/testing/DB/nzb-reorg script!

+
+ +
+ + +

The number of hours incomplete parts and binaries will be retained.

+
+ +
+ + +

The number of days releases will be retained for use throughout site. Set to 0 to disable.

+
+ +
+ + +

The number of hours releases categorized as Misc->Other will be retained. Set to 0 to disable.

+
+ +
+ + +

The number of hours releases categorized as Misc->Hashed will be retained. Set to 0 to disable.

+
+ +
+ + +

Default is 0 (off), which will remove parts in one go. If backfilling or importing and parts table is large, using chunks of 5000+ will speed up removal. Normal indexing is fastest with this setting at 0.

+
+ +
+ + +

The minimum number of files to make a release. i.e. if set to two, then releases which only contain one file will not be created.

+
+ +
+ + +

The minimum total size in bytes to make a release. If set to 0, then ignored.

+
+ +
+ + +

The maximum total size in bytes to make a release. If set to 0, then ignored. Only deletes during release creation.

+
+ +
+ + +

The minimum completion percent to make a release. i.e. if set to 97, then releases under 97% completion will not be created. If set to 0, then ignored.

+
+ +
+ + +

Whether to update download counts when someone downloads a release.

+
+ +
+ + +

The time in hours to check for crossposted releases - this will delete 1 of the releases if the 2 are posted by the same person in the same time period.

+
+ +
+ + +

The maximum number of messages to fetch at a time from the server.

+
+ +
+ + +

The maximum number of headers that update binaries sees as the total range. This ensures that a total of no more than this is attempted to be downloaded at one time per group.

+
+ +
+ + +
+
+ + +
+
+ + +
+
+

Scan back X (posts/days) for each new group? Can backfill to scan further.

+
+ +
+ + +

The target date for safe backfill. Format: YYYY-MM-DD

+
+ +
+ + +

Whether to disable a group automatically during backfill if the target date has been reached.

+
+
+
+ + +
+

Lookup Settings

+ +
+
+ + +

Whether to attempt to lookup TvRage ids on the web.

+
+ +
+ + +

Whether to attempt to lookup book information from Amazon.

+
+ +
+ + +

Categories of Books to lookup information for (only work if Lookup Books is set to yes).

+
+ +
+ + +

Whether to attempt to lookup film information from IMDB or TheMovieDB.

+
+ +
+ + +

Preferred language for scraping external sources.

+
+ +
+ + +

Whether to attempt to lookup anime information from AniDB when processing binaries.

+
+ +
+ + +

Whether to attempt to lookup music information from Amazon.

+
+ +
+ + +

Whether to save a preview of an audio release (requires deep rar inspection enabled).
It is advisable to specify a path to the lame binary to reduce the size of audio previews.

+
+ +
+ + +

Whether to attempt to lookup game information from Amazon.

+
+ +
+ + +

Whether to attempt to lookup XXX information when processing binaries.

+
+
+
+ + +
+

Language/Categorization Options

+ +
+
+ + +

Whether to send foreign movies/tv to foreign sections or not. If set to true they will go in foreign categories.

+
+ +
+ + +

Whether to send WEB-DL to the WEB-DL section or not. If set to true they will go in WEB-DL category, false will send them in HD TV. This will also make them inaccessible to Sickbeard and possibly Couchpotato.

+
+
+
+ + +
+

User Settings

+ +
+
+ + +

The status of registrations to the site.

+
+ +
+ + +

The number of days to preserve user download history, for use when checking limits being hit. Set to zero will remove all records of what users download, but retain history of when, so that role based limits can still be applied.

+
+ +
+ + +

A comma separated list of IP addresses which will be excluded from user limits on number of requests and downloads per IP address. Include values for google reader and other shared services which may be being used.

+
+
+
+ + +
+

Path Settings

+
+
+ + +

Path where NZB files are stored

+
+
+ + +

Path where cover images are stored

+
+
+
+ + +
+

Password Settings

+ +
+
+ + +

Try to download the last rar or zip file? (This is good if most of the files are at the end.) Note: The first rar/zip is still downloaded.

+
+ +
+ + +

Whether to show passworded releases in browse, search, api and rss feeds.

+
+
+
+ + +
+

Additional Usenet Settings

+ +
+
+ +
+ + GB +
+

The maximum size in gigabytes to postprocess a release. If set to 0, then ignored.

+
+ +
+ +
+ + MB +
+

The minimum size in megabytes to post process (additional) a release. If set to 0, then ignored.

+
+
+
+ + +
+

Advanced Settings - For Advanced Users

+ +
+
+ + +

The maximum amount of NZB files to create on stage 5 at a time in update_releases. If more are to be created it will loop stage 5 until none remain.

+
+ +
+ + +

Whether to attempt to repair parts or not, increases backfill/binaries updating time.

+
+ +
+ + +

Whether to put unreceived parts into missed_parts table when running binaries(safe) or backfill scripts.

+
+ +
+ + +

The maximum amount of articles to attempt to repair at a time. If you notice that you are getting a lot of parts into the missed_parts table, it is possible that you USP is not keeping up with the requests. Try to reduce the threads to safe scripts or stop using safe scripts until improves.

+
+ +
+ + +

Maximum amount of times to try part repair.

+
+ +
+ + +

Whether to attempt to retrieve a JPG file while additional post processing, these are usually on XXX releases.

+
+ +
+ + +

Whether to attempt to process a video thumbnail image. You must have ffmpeg for this.

+
+ +
+ + +

Whether to attempt to process a video sample, these videos are very short 1-3 seconds, 100KB on average, in ogg video format. You must have ffmpeg for this.

+
+ +
+ + +

The maximum number of segments to download to generate the sample video file or jpg sample image. (Default 2)

+
+ +
+ +
+ + seconds +
+

The maximum duration (in seconds) for ffmpeg to generate the sample for. (Default 5)

+
+ +
+ +
+ + levels +
+

If a rar/zip has rar/zip inside of it, how many times should we go in those inner rar/zip files.

+
+ +
+ + +

You can add a regex here to set releases to potentially passworded when a file name inside a rar/zip matches this regex. You must ensure this regex is valid, a non valid regex will cause errors during processing!

+
+
+
+ + +
+

Movie Trailer Settings

+ +
+
+ + +

Fetch and display trailers from TraktTV (Requires API key) and/or TrailerAddict on the details page?

+
+ +
+ +
+ + px +
+

Maximum width in pixels for the trailer window. (Default: 480)

+
+ +
+ +
+ + px +
+

Maximum height in pixels for the trailer window. (Default: 345)

+
+
+
+ + +
+

Advanced - Postprocessing Settings

+ +
+
+ +
+ + seconds +
+

How much time to wait for unrar/7zip/mediainfo/ffmpeg/avconv before killing it, set to 0 to disable. 60 is a good value. Requires the GNU Timeout path to be set.

+
+ +
+ + +

The maximum amount of releases to process for passwords/previews/mediainfo per run. Every release gets processed here. This uses NNTP an connection, 1 per thread. This does not query Amazon.

+
+ +
+ + +

If a part fails to download while post processing, this will retry up to the amount you set, then give up.

+
+ +
+ + +

This overrides the above setting if set above 1. How many parts to check for a password before giving up. This slows down post processing massively, better to leave it 1.

+
+ +
+ + +

The maximum amount of TV shows to process with TVRage per run. This does not use an NNTP connection or query Amazon.

+
+ +
+ + +

The maximum amount of movies to process with IMDB per run. This does not use an NNTP connection or query Amazon.

+
+ +
+ + +

The maximum amount of anime to process with anidb per run. This does not use an NNTP connection or query Amazon.

+
+ +
+ + +

The maximum amount of music to process with amazon per run. This does not use an NNTP connection.

+
+ +
+ + +

The maximum amount of games to process with amazon per run. This does not use an NNTP connection.

+
+ +
+ + +

The maximum amount of books to process with amazon per run. This does not use an NNTP connection

+
+ +
+ + +

The maximum amount of XXX to process per run. This does not use an NNTP connection or query Amazon.

+
+ +
+ + +

The maximum number of releases to check per run (threaded script only).

+
+ +
+ +
+ + ms +
+

Sleep time in milliseconds to wait in between amazon requests. If you thread post-proc, multiply by the number of threads. ie Postprocessing Threads = 12, Amazon sleep time = 12000

+
+
+
+ + +
+

NFO Processing Settings

+ +
+
+ + +

Whether to attempt to retrieve an nfo file from usenet.
NOTE: disabling nfo lookups will disable movie lookups.

+
+ +
+ + +

The maximum amount of NFO files to process per run. This uses NNTP an connection, 1 per thread. This does not query Amazon.

+
+ +
+ +
+ + GB +
+

The maximum size in gigabytes of a release to process it for NFOs. If set to 0, then ignored.

+
+ +
+ +
+ + MB +
+

The minimum size in megabytes of a release to process it for NFOs. If set to 0, then ignored.

+
+ +
+ +
+ + times +
+

How many times to retry when a NFO fails to download. If set to 0, we will not retry. The max is 7.

+
+
+
+ + +
+

Connection Settings

+ +
+
+ + +

The maximum number of retry attempts to connect to nntp provider. On error, each retry takes approximately 5 seconds nntp returns reply. (Default 10)

+
+ +
+ + +

The time in hours to wait, since last activity, before releases without parts counts in the subject are are created.
Setting this below 2 hours could create incomplete releases.

+
+ +
+ + +

How many hours to wait before converting a collection into a release that is considered "stuck".
Default value is 48 hours.

+
+
+
+ + +
+

Developer Settings

+ +
+
+ + +

For developers. Whether to log all headers that have 'yEnc' and are dropped. Logged to not_yenc/groupname.dropped.txt.

+
+
+
+ + +
+

Advanced - Threaded Settings

+ +
+
+ + +

The number of threads for update_binaries. If you notice that you are getting a lot of parts into the missed_parts table, it is possible that you USP is not keeping up with the requests. Try to reduce the threads. At least until the cause can be determined.

+
+ +
+ + +

The number of threads for backfill.

+
+ +
+ + +

The number of threads for releases update scripts.

+
+ +
+ + +

The number of threads for additional postprocessing. This includes deep rar inspection, preview and sample creation and nfo processing.

+
+ +
+ + +

The number of threads for nfo postprocessing. The max is 16, if you set anything higher it will use 16.

+
+ +
+ + +

The number of threads for non-amazon postprocessing. This includes movies, anime and tv lookups.

+
+ +
+ + +

The number of threads for fixReleasesNames. This includes md5, nfos, par2 and filenames.

+
+
+
+ + +
+

+ + This is a simplified settings page. For complete site configuration, please use the full settings management interface or edit settings directly in the database. +

+
+ + +
+ + + Cancel + +
+
+ +
+
+@endsection + diff --git a/resources/views/admin/site-stats.blade.php b/resources/views/admin/site-stats.blade.php new file mode 100644 index 000000000..3b06dfa9c --- /dev/null +++ b/resources/views/admin/site-stats.blade.php @@ -0,0 +1,150 @@ +@extends('layouts.admin') + +@section('content') +
+
+ +
+

+ {{ $title }} +

+
+ +
+ + @if(!empty($topgrabs) && count($topgrabs) > 0) +
+

Top Grabbers

+
+ + + + + + + + + @foreach($topgrabs as $grab) + + + + + @endforeach + +
UsernameGrabs
{{ $grab->username }}{{ $grab->grabs }}
+
+
+ @endif + + + @if(!empty($topdownloads) && count($topdownloads) > 0) +
+

Top Downloads

+
+ + + + + + + + + @foreach($topdownloads as $download) + + + + + @endforeach + +
ReleaseDownloads
{{ $download->searchname }}{{ $download->grabs }}
+
+
+ @endif + + + @if(!empty($recent) && count($recent) > 0) +
+

Recently Added Releases

+
+ + + + + + + + + @foreach($recent as $item) + + + + + @endforeach + +
DateReleases
{{ $item->thedate }}{{ $item->num }}
+
+
+ @endif + + + @if(!empty($usersbymonth) && count($usersbymonth) > 0) +
+

User Signups by Month

+
+ + + + + + + + + @foreach($usersbymonth as $month) + + + + + @endforeach + +
MonthSignups
{{ $month->mth }}{{ $month->num }}
+
+
+ @endif + + + @if(!empty($usersbyrole) && count($usersbyrole) > 0) +
+

Users by Role

+
+ + + + + + + + + @foreach($usersbyrole as $role) + + + + + @endforeach + +
RoleCount
{{ $role->name }}{{ $role->num }}
+
+
+ @endif + + @if(empty($topgrabs) && empty($topdownloads) && empty($recent) && empty($usersbymonth) && empty($usersbyrole)) +
+ +

No statistics available

+

Statistics will appear here once data is collected.

+
+ @endif +
+
+
+@endsection + diff --git a/resources/views/admin/tmux-edit.blade.php b/resources/views/admin/tmux-edit.blade.php new file mode 100644 index 000000000..39db13bc7 --- /dev/null +++ b/resources/views/admin/tmux-edit.blade.php @@ -0,0 +1,344 @@ +@extends('layouts.admin') + +@push('styles') + +@endpush + +@section('content') +
+
+ +
+

+ {{ $title }} +

+
+ + + @if(session('success')) +
+

+ {{ session('success') }} +

+
+ @endif + + +
+ @csrf + + + +
+ +
+

Tmux - How It Works

+
+

Tmux is a screen multiplexer and at least version 1.6 is required. It is used here to allow multiple windows per session and multiple panes per window.

+

Each script is run in its own shell environment. It is not looped, but allowed to run once and then exit. This notifies tmux that the pane is dead and can then be respawned with another iteration of the script in a new shell environment.

+

This allows for scripts that crash to be restarted without user intervention.

+
+

NOTICE:

+

If "Save Tmux Settings" is the last thing you did on this page, refreshing will save the current form values again, not reload from database.

+
+
+
+ + +
+

Monitor Settings

+
+ + + @foreach($yesno_ids as $index => $val) + + @endforeach + + + + +
+ + seconds +
+
+ + + + +
+
+ + +
+

Sequential Settings

+
+ + + @foreach($sequential_ids as $index => $val) + + @endforeach + + + + +
+ + seconds +
+
+ +
+

Sequential mode is not recommended as it's not tested enough.

+
+
+
+ + +
+

Update Binaries Settings

+
+ + + @foreach($binaries_ids as $index => $val) + + @endforeach + + + + +
+ + seconds +
+
+ + +
+ + minutes +
+
+
+
+ + +
+

Backfill Settings

+
+
+ + + @foreach($backfill_ids as $index => $val) + + @endforeach + + + + + + @foreach($backfill_group_ids as $index => $val) + + @endforeach + + + + + + @foreach($backfill_days_ids as $index => $val) + + @endforeach + + +
+ + + + + + + + + + +
+ + seconds +
+
+ + + + @foreach($yesno_ids as $index => $val) + + @endforeach + + +
+
+ + +
+

Update Releases Settings

+
+ + + @foreach($releases_ids as $index => $val) + + @endforeach + + + + +
+ + seconds +
+
+
+
+ + +
+

Postprocessing Settings

+
+ + + @foreach($post_ids as $index => $val) + + @endforeach + + + + +
+ + seconds +
+
+ + +
+ + seconds +
+
+ + + + @foreach($yesno_ids as $index => $val) + + @endforeach + + + + +
+ + seconds +
+
+ + + + @foreach($yesno_ids as $index => $val) + + @endforeach + + + + +
+ + seconds +
+
+
+
+ + +
+

Fix Release Names

+
+ + + @foreach($yesno_ids as $index => $val) + + @endforeach + + + + +
+ + seconds +
+
+
+
+ + +
+

Remove Crap Releases

+
+ + + @foreach($yesno_ids as $index => $val) + + @endforeach + + + + +
+ + seconds +
+
+
+
+ + +
+ + Save Tmux Settings + +
+
+
+
+
+@endsection + diff --git a/resources/views/admin/user-edit.blade.php b/resources/views/admin/user-edit.blade.php new file mode 100644 index 000000000..3a6153983 --- /dev/null +++ b/resources/views/admin/user-edit.blade.php @@ -0,0 +1,207 @@ +@extends('layouts.admin') + +@section('content') +
+
+ +
+

+ {{ $title }} +

+
+ + + @if(!empty($error)) +
+

+ {{ $error }} +

+
+ @endif + + +
+ @csrf + + @if(!empty($user['id'])) + + @endif + +
+ +
+ + +
+ + +
+ + +
+ + +
+ + + @if(!empty($user['id'])) +

Leave blank to keep the current password

+ @endif +
+ + +
+ + +
+ + @if(!empty($user['id'])) + +
+ + +
+ @endif + + +
+ + +
+ + +
+ + +
+ + @if(!empty($user['id'])) + +
+ +
+
+ movieview ?? 0)) ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ musicview ?? 0)) ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ gameview ?? 0)) ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ consoleview ?? 0)) ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ bookview ?? 0)) ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+ xxxview ?? 0)) ? 'checked' : '' }} + class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"> + +
+
+
+ @endif + + +
+ + + Cancel + +
+
+
+
+
+@endsection + diff --git a/resources/views/admin/user-list.blade.php b/resources/views/admin/user-list.blade.php new file mode 100644 index 000000000..40c5b046c --- /dev/null +++ b/resources/views/admin/user-list.blade.php @@ -0,0 +1,200 @@ +@extends('layouts.admin') + +@section('content') +
+
+ +
+
+

+ {{ $title }} +

+ + Add New User + +
+
+ + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + + Clear + +
+
+
+ + + @if(request()->has('deleted') && request()->input('deleted') == 1) +
+

+ + User "{{ request()->input('username') }}" has been deleted successfully. +

+
+ @endif + + @if(session('success')) +
+

+ {{ session('success') }} +

+
+ @endif + + @if(session('error')) +
+

+ {{ session('error') }} +

+
+ @endif + + + @if(count($userlist) > 0) +
+ + + + + + + + + + + + + + + + @foreach($userlist as $user) + + + + + + + + + + + + @endforeach + +
IDUsernameEmailRoleHostCountryVerifiedCreatedActions
{{ $user->id }} +
{{ $user->username }}
+
{{ $user->email }} + + {{ $user->roles->first()->name ?? 'N/A' }} + + {{ $user->host ?? 'N/A' }} + @if(!empty($user->country_code)) + {{ $user->country_code }} + @else + N/A + @endif + + @if($user->verified) + + Yes + + @else + + No + + @endif + + {{ $user->created_at ? $user->created_at->format('Y-m-d') : 'N/A' }} + +
+ + + + @if(!$user->verified) + + + + + + + @endif + + + +
+
+
+ + +
+ {{ $userlist->links() }} +
+ @else +
+ +

No users found

+

Try adjusting your search filters or add a new user.

+
+ @endif +
+
+@endsection + diff --git a/resources/views/cart/index.blade.php b/resources/views/cart/index.blade.php index 9a88e37bc..1af98a17f 100644 --- a/resources/views/cart/index.blade.php +++ b/resources/views/cart/index.blade.php @@ -14,10 +14,6 @@
- -
@@ -56,7 +52,9 @@ - + Name Added @@ -142,7 +140,7 @@
@endsection -@push('scripts') +@push('styles') +@endpush +@push('scripts') -
- -
- - -
- - - - - - @auth -
- - - Profile - - @if(auth()->user()->hasRole('Admin')) - - - Admin Panel - - @endif - - - Sign Out - - -
- @endauth -
- -