Skip to content

Commit

Permalink
Merge pull request #1864 from Sefaria/2023-impact-report-link-change
Browse files Browse the repository at this point in the history
Add reference to 2023 annual report & change URL path to be dynamic
  • Loading branch information
relyks authored Apr 4, 2024
2 parents 561299c + 184bf21 commit b3770c4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion reader/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4329,13 +4329,18 @@ def serve_static_by_lang(request, page):
return render_template(request,'static/{}/{}.html'.format(request.LANGUAGE_CODE, page), None, {})


# TODO: This really should be handled by a CMS :)
def annual_report(request, report_year):
pdfs = {
'2020': STATIC_URL + 'files/Sefaria 2020 Annual Report.pdf',
'2021': 'https://indd.adobe.com/embed/98a016a2-c4d1-4f06-97fa-ed8876de88cf?startpage=1&allowFullscreen=true',
'2022': STATIC_URL + 'files/Sefaria_AnnualImpactReport_R14.pdf',
'2023': 'https://issuu.com/sefariaimpact/docs/sefaria_2023_impact_report?fr=sMmRkNTcyMzMyNTk',
}
if report_year not in pdfs:
# Assume the most recent year as default when one is not provided
if not report_year:
report_year = max(pdfs.keys()) # Earlier versions of Python do not preserve insertion order in dictionaries :(
elif report_year not in pdfs:
raise Http404
# Renders a simple template, does not extend base.html
return render(request, template_name='static/annualreport.html', context={'reportYear': report_year, 'pdfURL': pdfs[report_year]})
Expand Down
2 changes: 1 addition & 1 deletion sites/sefaria/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@
url(r'^ideasforteaching/?$',lambda x: HttpResponseRedirect(STATIC_URL + 'files/Sefaria_Teacher_Generated_Ideas_for_Your_Classroom.pdf')),
url(r'^strategicplan/?$',lambda x: HttpResponseRedirect(STATIC_URL + 'files/Sefaria_Strategic_Plan.pdf')),
url(r'^annualreport2021?$', lambda x: HttpResponseRedirect('/annualreport/2021')), # Added for backwards compatability for old links that might still point to this
url(r'^annualreport/(?P<report_year>\d+)$', reader_views.annual_report),
url(r'^annualreport(/(?P<report_year>\d+)/?|/?)$', reader_views.annual_report),
]
2 changes: 1 addition & 1 deletion static/js/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Footer extends Component {
<Link href="/team" en="Team" he="צוות" />
<Link href="/testimonials" en="Testimonials" he="חוות דעת" />
<Link href="/metrics" en="Metrics" he="מדדים" />
<Link href="/annualreport/2022" en="Annual Report" he='דו"ח שנתי' />
<Link href="/annualreport" en="Annual Report" he='דו"ח שנתי' />
<Link href="/terms" en="Terms of Use" he="תנאי שימוש" />
<Link href="/privacy-policy" en="Privacy Policy" he="מדיניות פרטיות" />
</Section>
Expand Down
2 changes: 1 addition & 1 deletion static/js/StaticPages.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,7 @@ const DonatePage = () => (
rounded={true}
tall={false}
newTab={true}
href="/static/files/Sefaria_AnnualImpactReport_R14.pdf"
href="/annualreport"
he_href=""
he=""
en="Read Here"
Expand Down

0 comments on commit b3770c4

Please sign in to comment.