SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 24060a0f authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Add links with doi_label

parent a9fb1ad3
No related branches found
No related tags found
No related merge requests found
......@@ -17,13 +17,15 @@ class JournalUtils(object):
+ title_dict[cls.publication.accepted_submission.submitted_by.title]
+ ' ' +
cls.publication.accepted_submission.submitted_by.user.last_name +
', \n\nWe have happy to inform you that your Submission to SciPost,\n\n' +
', \n\nWe are happy to inform you that your Submission to SciPost,\n\n' +
cls.publication.accepted_submission.title +
' by ' + cls.publication.accepted_submission.author_list +
'\n\nhas been published online with reference '
+ cls.publication.citation() + '.'
'\n\nThe publication page is located at the permanent link '
'https://scipost.org/' + cls.publication.doi_string + '.'
'\n\nTo facilitate dissemination of your paper, we greatly encourage '
'you to update the arXiv Journal-ref with this information.'
'\n\nWe warmly congratulate you on this achievement and thank you '
'for entrusting us with the task of publishing your research. '
'\n\nSincerely,' +
......
......@@ -292,3 +292,17 @@ def publication_pdf(request, doi_string):
response['Content-Disposition'] = ('filename='
+ publication.doi_label.replace('.', '_') + '.pdf')
return response
def publication_detail_form_doi_label(request, doi_label):
publication = get_object_or_404 (Publication, doi_label=doi_label)
context = {'publication': publication,}
return render(request, 'journals/publication_detail.html', context)
def publication_pdf_from_doi_label(request, doi_label):
publication = get_object_or_404 (Publication, doi_label=doi_label)
pdf = File(publication.pdf_file)
response = HttpResponse(pdf, content_type='application/pdf')
response['Content-Disposition'] = ('filename='
+ publication.doi_label.replace('.', '_') + '.pdf')
return response
......@@ -90,6 +90,12 @@ urlpatterns = [
url(r'^(?P<doi_string>10.21468/[a-zA-Z]+.[0-9]+.[0-9]+.[0-9]{3,})/pdf$',
journals_views.publication_pdf,
name='publication_pdf'),
url(r'^(?P<doi_label>[a-zA-Z]+.[0-9]+.[0-9]+.[0-9]{3,})$',
journals_views.publication_detail_form_doi_label,
name='publication_detail_from_doi_label'),
url(r'^(?P<doi_label>[a-zA-Z]+.[0-9]+.[0-9]+.[0-9]{3,})/pdf$',
journals_views.publication_pdf_from_doi_label,
name='publication_pdf_from_doi_label'),
#########
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment