diff --git a/resources/views/admin/release-naming-regexes-edit.blade.php b/resources/views/admin/release-naming-regexes-edit.blade.php index 2319413c4..f80c05d23 100644 --- a/resources/views/admin/release-naming-regexes-edit.blade.php +++ b/resources/views/admin/release-naming-regexes-edit.blade.php @@ -1,130 +1,158 @@ @extends('layouts.admin') -@section('title', $title ?? 'Release Naming Regex Edit') - @section('content') -
-
-
-
-

{{ $title }}

-
-
- - Back to List +
+ -
- @if($error) - - @endif - -
+ + @csrf -
-
- -
-
-
- - + + @if($error) +
+
+ +

{{ $error }}

- - 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.* -
+ @endif + + +
+ +
+
+ +
+ +
+

+ 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. -
+
+

+ 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. - +
+

+ 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. -
+
+

+ 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. - + +
+ +
+ @foreach($status_ids as $k => $id) +
+ status ?? 1) == $id ? 'checked' : '' }}> + +
+ @endforeach
+

+ Only active regex are used during the release naming process. +

-
- @@ -135,11 +163,15 @@ document.addEventListener('DOMContentLoaded', function() { const form = document.getElementById('regexForm'); if (form) { form.addEventListener('submit', function(event) { - if (!form.checkValidity()) { + const groupRegex = document.getElementById('group_regex'); + const regex = document.getElementById('regex'); + const ordinal = document.getElementById('ordinal'); + + if (!groupRegex.value.trim() || !regex.value.trim() || !ordinal.value) { event.preventDefault(); - event.stopPropagation(); + alert('Please fill in all required fields.'); + return false; } - form.classList.add('was-validated'); }); } }); diff --git a/resources/views/admin/release-naming-regexes-list.blade.php b/resources/views/admin/release-naming-regexes-list.blade.php index fdef5eb75..ab7a4f458 100644 --- a/resources/views/admin/release-naming-regexes-list.blade.php +++ b/resources/views/admin/release-naming-regexes-list.blade.php @@ -1,98 +1,126 @@ @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. + You can test your regex patterns using the test feature.

-
+ +
-
-
-
- @csrf -
- - - + +
+ + @csrf + +
+
+
+ +
+
- -
+ +
+
+ @if($regex && count($regex) > 0) + @if(method_exists($regex, 'links')) -
+
{{ $regex->onEachSide(5)->links() }}
@endif -
- - + +
+
+ - - - - - - - + + + + + + + - + @foreach($regex as $row) - - - + + - - - - + -
IDGroupDescriptionRegexOrdinalStatusActionsIDGroupDescriptionRegexOrdinalStatusActions
{{ $row->id }} - {{ $row->group_regex }} +
{{ $row->id }} + {{ $row->group_regex }} - {{ \Illuminate\Support\Str::limit($row->description, 50) }} + + + {{ $row->description }} + - {{ \Illuminate\Support\Str::limit(htmlspecialchars($row->regex), 50) }} + +
+ + {{ htmlspecialchars($row->regex) }} + +
{{ $row->ordinal }} + {{ $row->ordinal }} @if($row->status == 1) - Active + + Active + @else - Disabled + + Disabled + @endif -
- +
+
+ -
@@ -102,22 +130,28 @@
+ + @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. +
+ +

No regex patterns found

+

Try a different search term or add a new regex.

+ + Add New Regex +
@endif -
-