Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin: Add support for comment search by URL #1000

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

pkvach
Copy link
Contributor

@pkvach pkvach commented Mar 17, 2024

Checklist

  • All new and existing tests are passing
  • I have added an entry to CHANGES.rst because this is a user-facing change or an important bugfix
  • I have written proper commit message(s)

What changes does this Pull Request introduce?

Added support for searching comments by URL in the admin interface. This includes changes to the backend to handle comment URL queries and extract comment IDs, and frontend changes to add a search input to the admin page.

  • Updated admin CSS to include styles for the new search input and button.

  • Modified the fetchall method in comments.py to accept an optional comment_id parameter for fetching a specific comment by ID.

  • Updated the admin HTML template to include a search form that allows inputting a comment URL for search.

  • Updated the admin method in views/comments.py to handle the comment_url query parameter, parse the URL to extract the comment ID, and fetch the corresponding comment.

Why is this necessary?

Closes #642

Demo:

image

image

isso/views/comments.py Outdated Show resolved Hide resolved
@jelmer jelmer enabled auto-merge (squash) April 18, 2024 16:43
@jelmer jelmer merged commit 29236ff into isso-comments:master Apr 18, 2024
16 checks passed
@pkvach pkvach deleted the feat/admin-comment-search branch April 19, 2024 04:43
@ix5
Copy link
Member

ix5 commented Apr 19, 2024

If I see this correctly, the search only succeeds if you supply both the thread URL as well as a per-thread comment id.

What about admins who would want to look up only http://localhost:8080/demo/, e.g. the thread URL, to moderate all comments for a particular blogpost? Since this was merged already, could you add that in a follow-up PR?

@pkvach
Copy link
Contributor Author

pkvach commented Apr 19, 2024

Yes, this PR implements the requested search for specific comments.
I agree that we could make it even better by allowing comments to be searchable by thread URL.

@ix5
Copy link
Member

ix5 commented Apr 23, 2024

Yes, this PR implements the requested search for specific comments. I agree that we could make it even better by allowing comments to be searchable by thread URL.

Could you create a follow-up PR? I would argue that admins most often would search for threads, not comments.

@pkvach
Copy link
Contributor Author

pkvach commented Apr 24, 2024

I agree, searching by thread would likely be more common for admins.
I'll create a follow-up PR to implement this. Thank you.

@pkvach
Copy link
Contributor Author

pkvach commented Apr 27, 2024

Added a new PR to search for comments by thread URL: #1020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Request: implement search in the admin panel
3 participants