You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Users should be able to save some of their commonly repeated searches and be able to perform the same search with a single click. This feature will be most useful if it is quick and easliy accessible. While searching, users can be prompted to save a search in a non-intrusive manner, and still while searching, users can be prompted to bring up a saved search. Users should be able to view and remove previously saved searches.
Proposal
UX
Search page
When a user performs a search we show a "Subscribe" button in a box above the search results prompting them to subscribe to alerts for this search when new content is added.
If the user clicks on the button:
if the user is logged in, it creates a new search alert and the box updates to reflect that the alert is saved, and has a link to "manage your search alerts" which takes them to the search alerts page.
if the user is not logged in, it opens a "sign in or subscribe" modal (much like for saving documents) that then sends the user back to this page once they are signed in.
Search alerts page
Users should be able to access their search alerts through a "Search Alerts" listing page.
The page will display saved searches in a list view, sorted by date, showing:
Search term.
Date saved.
Any note added by the user.
Users can:
Re-run any saved search with a single click.
Delete any saved search they no longer need.
Implementation
Add a new SavedSearch model with the following fields:
q = models.CharField(max_length=4098) # The primary search term(s).
filters = models.CharField(max_length=4098) # string or parameters for any filters/criteria.
note = models.TextField(null=True, blank=True) # additional notes that user wants to add.
n_search_results = models.IntegerField(default=0) # Number of results returned when initially saved.
user = models.ForeignKey(User, on_delete=models.CASCADE) # Link to the user who saved the search.
date = models.DateField(auto_now_add=True) # Automatically set the date when a search is saved.
Search results page
On the search results page add a small prompt (e.g. alert box) to ask if they’d like to save the search.
If they click "Save," open a dialog allowing them to confirm and optionally add a note.
Saved searches page
Create a dedicated page with a simple list view for saved searches, displaying:
Date saved.
Search term.
Number of results (optional).
Note (if any).
Each entry should have:
A "Run" button to execute the saved search.
A "Delete" button for removal.
Use HTMX for a smooth deletion experience without reloading the page.
Save Search API Endpoint
Add a drf API endpoint to handle saving searches with relevant data (POST request):
It should accept the search term, filter_parameters, note, user, and number of results.
The text was updated successfully, but these errors were encountered:
When a search is run, the Vue search app puts the search alert box into the page and uses HTMX (ajax?) to load the content of the box. This allows the server to check if a search alert for this search already exists.
GET /search/saved-searches/check?q=... renders the search alert box, customised if the user is logged in and if they have already saved this search
If the user is not logged in, that html has a normal bootstrap modal with the login prompt, no special HTMX or JS needed.
If the user is logged in, and they have not saved this search, the button is part of a form which POSTs to a new endpoint that is submitted with HTMX and the box is updated with the text for a newly created saved search alert.
POST /search/saved-searches
If the user is logged in and they have saved this search before, the box has an Unsubscribe experience that deletes the saved search.
POST /search/saved-searches/<pk>/delete
Search alerts page
The search alert listing page also doubles as a detail page. It is part of the user profile page.
A search alert can be deleted by posting to the same deletion endpoint as above.
Clicking on a search alert opens the search page with all the details filled in.
Users should be able to save some of their commonly repeated searches and be able to perform the same search with a single click. This feature will be most useful if it is quick and easliy accessible. While searching, users can be prompted to save a search in a non-intrusive manner, and still while searching, users can be prompted to bring up a saved search. Users should be able to view and remove previously saved searches.
Proposal
UX
Search page
When a user performs a search we show a "Subscribe" button in a box above the search results prompting them to subscribe to alerts for this search when new content is added.
If the user clicks on the button:
Search alerts page
Users should be able to access their search alerts through a "Search Alerts" listing page.
The page will display saved searches in a list view, sorted by date, showing:
Users can:
Implementation
Add a new
SavedSearch
model with the following fields:Search results page
Saved searches page
Create a dedicated page with a simple list view for saved searches, displaying:
Each entry should have:
Use HTMX for a smooth deletion experience without reloading the page.
Save Search API Endpoint
Add a drf API endpoint to handle saving searches with relevant data (POST request):
It should accept the search term, filter_parameters, note, user, and number of results.
The text was updated successfully, but these errors were encountered: