-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
11d110d
commit ebadbe8
Showing
6 changed files
with
105 additions
and
54 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
peachjam/migrations/0182_peachjamsettings_allow_save_searches.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated by Django 4.2.15 on 2024-11-22 07:51 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("peachjam", "0181_taxonomy_path_name"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="peachjamsettings", | ||
name="allow_save_searches", | ||
field=models.BooleanField( | ||
default=False, | ||
help_text="Allow searches to be saved.", | ||
verbose_name="allow save searches", | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 12 additions & 7 deletions
19
peachjam_search/templates/peachjam_search/saved_search_button.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
{% load i18n %} | ||
{% if request.user.is_authenticated %} | ||
<form id="saved-search-button" | ||
hx-post="{% url 'search:saved_search_create' %}"> | ||
<input type="hidden" name="q" value="{{ saved_search.q }}"/> | ||
<input type="hidden" name="filters" value="{{ saved_search.filters }}"/> | ||
<div id="saved-search-button"> | ||
{% if request.user.is_authenticated %} | ||
<form hx-target="#saved-search-button" | ||
id="saved-search-create" | ||
hx-post="{% url 'search:saved_search_create' %}"> | ||
<input type="hidden" name="q" value="{{ saved_search.q }}"/> | ||
<input type="hidden" name="filters" value="{{ saved_search.filters }}"/> | ||
</form> | ||
{% endif %} | ||
<button class="btn btn-outline-primary" | ||
data-bs-toggle="modal" | ||
type="submit" | ||
form="saved-search-create" | ||
data-bs-target="#saved-search-modal"> | ||
<i class="bi bi-bell"></i> | ||
{% trans 'Get alerts for this search' %} | ||
</button> | ||
{% if request.user.is_authenticated %}</form>{% endif %} | ||
{% include 'peachjam_search/_saved_search_modal.html' %} | ||
</div> | ||
{% include 'peachjam_search/_saved_search_modal.html' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters