Skip to content

Commit

Permalink
Merge pull request #2106 from laws-africa/quick-search
Browse files Browse the repository at this point in the history
quick search must use nature not doc_type
  • Loading branch information
longhotsummer authored Oct 16, 2024
2 parents a51b2a4 + 92abc2f commit 1dab8dd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions peachjam/templates/peachjam/_quick_search.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
{% if registry %}<input type="hidden" name="registry" value="{{ registry }}"/>{% endif %}
{% if MULTIPLE_JURISDICTIONS and country %}<input type="hidden" name="jurisdiction" value="{{ country }}"/>{% endif %}
{% if locality %}<input type="hidden" name="locality" value="{{ locality }}"/>{% endif %}
{% if doc_type %}<input type="hidden" name="doc_type" value="{{ doc_type }}"/>{% endif %}
</form>
<a href="{% url 'search:search' %}?show-advanced-tab=1&doc_type={{ doc_type }}">{% trans "Advanced search" %}</a>
<a href="{% url 'search:search' %}?show-advanced-tab=1&nature={{ nature }}">{% trans "Advanced search" %}</a>
2 changes: 1 addition & 1 deletion peachjam/views/courts.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def page_title(self):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)

context["doc_type"] = "Judgment"
context["nature"] = "Judgment"
context["page_title"] = self.page_title()
context["doc_table_show_jurisdiction"] = False
context["doc_table_title_label"] = _("Citation")
Expand Down
4 changes: 2 additions & 2 deletions peachjam/views/gazette.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def get_context_data(self, **kwargs):
context["doc_count"] = queryset.count()
context["doc_count_noun"] = _("gazette")
context["doc_count_noun_plural"] = _("gazettes")
context["doc_type"] = "Gazette"
context["nature"] = "Gazette"
self.add_entity_profile(context)

return context
Expand Down Expand Up @@ -170,7 +170,7 @@ def get_context_data(self, **kwargs):
)

context["documents"] = self.group_documents(context["documents"])
context["doc_type"] = "Gazette"
context["nature"] = "Gazette"
context["doc_table_show_jurisdiction"] = False
context["doc_table_show_frbr_uri_number"] = True
context["doc_table_show_sub_publication"] = True
Expand Down
2 changes: 1 addition & 1 deletion peachjam/views/judgment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_context_data(self, **kwargs):
.exclude(published=False)
.order_by("-date")[:30]
)
context["doc_type"] = "Judgment"
context["nature"] = "Judgment"
context["doc_count"] = Judgment.objects.filter(published=True).count()
context["doc_count_noun"] = _("judgment")
context["doc_count_noun_plural"] = _("judgments")
Expand Down
2 changes: 1 addition & 1 deletion peachjam/views/legislation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class LegislationListView(FilteredDocumentListView):
template_name = "peachjam/legislation_list.html"
navbar_link = "legislation"
queryset = Legislation.objects.prefetch_related("work", "labels")
extra_context = {"doc_type": "Legislation", "help_link": "legislation/"}
extra_context = {"nature": "Act", "help_link": "legislation/"}
form_defaults = {"sort": "title"}


Expand Down

0 comments on commit 1dab8dd

Please sign in to comment.