Feature: Add pagination and search to templates page#2850
Feature: Add pagination and search to templates page#2850konard wants to merge 3 commits intoknadh:masterfrom
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: knadh#2847
Implements pagination, search, and sorting functionality for the templates list page, addressing issue knadh#2847. Changes: - Add query-templates SQL query with pagination, search and sorting - Add QueryTemplates function to core/templates.go - Update GetTemplates API handler to support pagination parameters - Add Templates type and Total field to template model - Update frontend Templates.vue with pagination and search UI - Update API call to support pagination parameters - Add i18n translation for search placeholder The implementation follows the existing patterns used in campaigns and lists pages for consistency. Fixes knadh#2847 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This reverts commit bc7962c.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit them. Uncommitted files: Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
| return c.JSON(http.StatusOK, okResp{models.PageResults{Results: []models.Template{}}}) | ||
| } | ||
|
|
||
| out := models.PageResults{ |
There was a problem hiding this comment.
This breaks backwards-compatibility by changing the current API response structure.
|
Hi! Hope you don't mind me adding to the repo again, trying to build something for automated QA testing on individual PRs. Here's a summary of my testing for this PR. What I did here: create dev container, build a test plan, run test agent against the actual app, and the results below look good from the PR description. Listmonk Templates Test ReportSummary
Overall Result: PASSED
Detailed ResultsROUTE Tests (UI/UX)
LOGIC Tests (API)
EDGE Tests (Edge Cases)
Test ArtifactsScreenshotsLocated in screenshots/ folder:
VideosLocated in videos/ folder:
Assets here: https://drive.google.com/drive/u/0/folders/1I6LgNCU-WzZ2wkIAO85VxSSMQiZWkt-S Notes
|

Summary
This PR adds pagination and search functionality to the templates list page, addressing issue #2847.
Features implemented:
Changes
Backend
queries/templates.sql: Added new
query-templatesSQL query with:COUNT(*) OVER()for total countOFFSETandLIMITfor paginationILIKEsearch on name fieldORDER BYsubstitutionmodels/templates.go: Added
Templatesslice type andTotalfield to Template struct for pagination supportmodels/queries.go: Added
QueryTemplatesquery reference as string typeinternal/core/core.go: Added
templateQuerySortFieldsfor allowed sort columnsinternal/core/templates.go: Added
QueryTemplates()function for paginated template retrievalcmd/templates.go: Updated
GetTemplateshandler to support pagination parameters (page,query,order_by,order)Frontend
frontend/src/api/index.js: Updated
getTemplatesto accept paramsfrontend/src/views/Templates.vue:
b-tablepagination propstemplates.totali18n/en.json: Added
templates.queryPlaceholdertranslationTesting
Screenshots
The UI follows the same pattern as the existing Campaigns and Lists pages for consistency.
Fixes #2847
🤖 Generated with Claude Code