From 3db7d3d78d5d5eea2a2b6835d92ec95a09ee931e Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 15 Apr 2025 12:43:43 +0200 Subject: [PATCH] Update collection regex pages --- .../themes/admin/collection_regexes-edit.tpl | 233 ++++++++++++------ .../themes/admin/collection_regexes-list.tpl | 221 +++++++++++++---- .../themes/admin/collection_regexes-test.tpl | 195 +++++++++++---- 3 files changed, 479 insertions(+), 170 deletions(-) diff --git a/resources/views/themes/admin/collection_regexes-edit.tpl b/resources/views/themes/admin/collection_regexes-edit.tpl index fcd0eaf49..b26183426 100644 --- a/resources/views/themes/admin/collection_regexes-edit.tpl +++ b/resources/views/themes/admin/collection_regexes-edit.tpl @@ -1,80 +1,155 @@ -

{$title}

-{if isset($error) && $error != ''} -
{$error}
-{/if} -
- Go back -
- {{csrf_field()}} - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- Regex to match against a group or multiple groups.
- Delimiters are already added, and PCRE_CASELESS is added after for case insensitivity. - An example of matching a single group: alt\.binaries\.example
- An example of matching multiple groups: alt\.binaries.* -
-
- -
- The regex to use when matching (grouping) 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.
- You MUST include at least one regex capture group.
- You MUST name your regex capture groups (the ones you want to be included).
- A string will be created from your matched capture groups.
- The string will form part of a "collection hash".
- The collection hash is used to group many parts together, to form the finalized release.
- The usenet group and name of the poster are added automatically when hashing.
- Capture groups are sorted alphabetically (by capture group name) when concatenating the - string.
-
-
- -
- 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. -
-
- {html_radios id="status" name='status' values=$status_ids output=$status_names selected=$regex.status separator='
'} -
Only active regex are used during the collection matching process.
-
- -
-
+
+
+ +
+ +
+ {if isset($error) && $error != ''} +
{$error}
+ {/if} + +
+ {{csrf_field()}} + + +
+
+ +
+
+
+ + +
+ + Regex to match against a group or multiple groups.
+ Delimiters are already added, and PCRE_CASELESS is added after for case insensitivity.
+ An example of matching a single group: alt\.binaries\.example
+ An example of matching multiple groups: alt\.binaries.* +
+
+
+ +
+
+ +
+
+
+ + +
+ + The regex to use when matching (grouping) 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.
+ You MUST include at least one regex capture group.
+ You MUST name your regex capture groups (the ones you want to be included).
+ A string will be created from your matched capture groups.
+ The string will form part of a "collection hash".
+ The collection hash is used to group many parts together, to form the finalized release.
+ The usenet group and name of the poster are added automatically when hashing.
+ Capture groups are sorted alphabetically (by capture group name) when concatenating the string. +
+
+
+ +
+
+ +
+
+
+ + +
+ + 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. +
+
+
+ +
+
+ +
+
+
+ {html_radios id="status" name='status' values=$status_ids output=$status_names selected=$regex.status separator='
'} +
+ Only active regex are used during the collection matching process. +
+
+
+
+ +
+ + diff --git a/resources/views/themes/admin/collection_regexes-list.tpl b/resources/views/themes/admin/collection_regexes-list.tpl index 59c67bdf3..78247e3b4 100644 --- a/resources/views/themes/admin/collection_regexes-list.tpl +++ b/resources/views/themes/admin/collection_regexes-list.tpl @@ -1,50 +1,173 @@ -

{$title}

-
-

This page lists regex used for grouping usenet collections.

-
+
+
+
+

{$title}

+ + Add New Regex + +
+
-
- {{csrf_field()}} - - -    - -
- {if $regex} -
{$regex->onEachSide(5)->links()}
- - - - - - - - - - - - {foreach from=$regex item=row} - - - - - - - - {if $row.status==1} - - {else} - - {/if} - - - {/foreach} -
idgroupeditdescriptiondeleteordinalstatusregex
{$row.id}{$row.group_regex}Edit{$row.description|truncate:50:"...":true}Delete - {$row.ordinal}ActiveDisabled{$row.regex|escape:html|truncate:50:"...":true} -
-
{$regex->onEachSide(5)->links()}
- {/if} -
+
+

This page lists regex used for grouping usenet collections.

+
+ +
+ {{csrf_field()}} +
+
+
+ + + +
+
+
+
+ + {if $regex} +
+ + + + + + + + + + + + + + {foreach from=$regex item=row} + + + + + + + + + + {/foreach} + +
IDGroupDescriptionOrdinalStatusRegexActions
{$row.id}{$row.group_regex}{$row.description|truncate:50:"...":true}{$row.ordinal} + {if $row.status==1} + Active + {else} + Disabled + {/if} + {$row.regex|escape:html|truncate:50:"...":true} + +
+
+ +
+ {$regex->onEachSide(5)->links()} +
+ {else} +
+ No regex rules found matching your criteria. +
+ {/if} +
+ + +
+ + + + diff --git a/resources/views/themes/admin/collection_regexes-test.tpl b/resources/views/themes/admin/collection_regexes-test.tpl index a5aac3dab..746afb05c 100644 --- a/resources/views/themes/admin/collection_regexes-test.tpl +++ b/resources/views/themes/admin/collection_regexes-test.tpl @@ -1,45 +1,156 @@ -

{$title}

-
-

This page is used for testing regex for grouping usenet collections.
Enter the group name to test and a - regex. Limit is how many collections to show max on the page, 0 for no limit(slow).

+
+
+ +
-
- {{csrf_field()}} - -
- -
- -
- -
- {if isset($data)} +
+

This page is used for testing regex for grouping usenet collections. Enter the group name to test and a regex. Limit is how many collections to show max on the page, 0 for no limit (slow).

- {foreach from=$data key=hash item=collection} - - - - -
{$hash}
Current Files: {count($collection)}
- - - - - - - - - {foreach from=$collection item=row} - - - - - - - - {/foreach} -
namecurrent partstotal partsposterold hash
{$row.file_name}{$row.file_current_parts}{$row.file_total_parts}{$row.collection_poster}{$row.old_collection_hash}
- {/foreach} - {/if} +
+ {{csrf_field()}} -
+
+
+ +
+
+
+ + +
+ The newsgroup to test against (e.g., alt.binaries.example) +
+
+ +
+
+ +
+
+
+ + +
+ The regex pattern to test (include delimiters and modifiers) +
+
+ +
+
+ +
+
+
+ + +
+ Maximum number of collections to display (use 0 for no limit, but this may be slow) +
+
+ +
+ + +
+ + {if isset($data)} +
+ {foreach from=$data key=hash item=collection} +
+
+
+
Collection Hash: {$hash}
+ {count($collection)} Files +
+
+
+
+ + + + + + + + + + + + {foreach from=$collection item=row} + + + + + + + + {/foreach} + +
NameCurrent PartsTotal PartsPosterOld Hash
{$row.file_name}{$row.file_current_parts}{$row.file_total_parts}{$row.collection_poster}{$row.old_collection_hash}
+
+
+
+ {/foreach} +
+ {/if} + +