Skip to content

Commit

Permalink
bug fixes for displaying authorities on recap doc page
Browse files Browse the repository at this point in the history
  • Loading branch information
ss108 committed Oct 28, 2023
1 parent 51ff3c1 commit 88f3a53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions cl/opinion_page/templates/includes/authorities_section.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{% load humanize %}
{% load extras %}
{% load humanize %}
{% load static %}
{% load text_filters %}

{# Show cases this case cites #}
{% if context.total_authorities_count > 0 %}
<div id="authorities" class="sidebar-section">
Expand Down
4 changes: 2 additions & 2 deletions cl/opinion_page/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def from_opinion_cluster(
)

@classmethod
def from_recap_document_cits(cls, total_cit_count: int, cit_records: List[OpinionsCitedByRECAPDocument], request_queyy_string: str):
top_authorities = [ViewAuthority.from_recap_cit_record(r) for r in cit_records]
def from_recap_document_cits(cls, total_cit_count: int, cit_records: List[OpinionsCitedByRECAPDocument], request_query_string: str):
top_authorities = [ViewAuthority.from_recap_cit_record(r, query_string=request_query_string) for r in cit_records]
#TODO
view_all_url_base = ""
return cls(top_authorities=top_authorities, total_authorities_count = total_cit_count, view_all_url=view_all_url_base)
Expand Down
4 changes: 2 additions & 2 deletions cl/opinion_page/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ def view_recap_document(
# Override the og:url if we're serving a request to an OG crawler bot
og_file_path_override = f"/{rd.filepath_local}" if is_og_bot else None

total_citation_count, citation_records = get_recap_citations(rd.pk, k=5)
authorities_context: AuthoritiesContext = AuthoritiesContext.from_recap_document_cits(total_cit_count=total_citation_count, cit_records=citation_records, request_queyy_string=request.META["QUERY_STRING"])
total_citation_count, citation_records = get_recap_citations(rd.pk, top_k=5)
authorities_context: AuthoritiesContext = AuthoritiesContext.from_recap_document_cits(total_cit_count=total_citation_count, cit_records=citation_records, request_query_string=request.META["QUERY_STRING"])

return TemplateResponse(
request,
Expand Down

0 comments on commit 88f3a53

Please sign in to comment.