diff --git a/journals/views.py b/journals/views.py index 5f2571efa2306730e77c545d9ab488b4ad304951..6f490b5a35f72c9c2503271fc236ff9544fdf605 100644 --- a/journals/views.py +++ b/journals/views.py @@ -1090,3 +1090,32 @@ def publication_detail_pdf(request, doi_label): response['Content-Disposition'] = ('filename=' + publication.doi_label.replace('.', '_') + '.pdf') return response + + +###################### +# Feed DOIs to arXiv # +###################### + +""" +This method provides arXiv with the doi and journal ref of the 100 most recent +publications in the journal specified by doi_label. +""" +def arxiv_doi_feed(request, doi_label): + journal = get_object_or_404(Journal, doi_label=doi_label) + feedxml = ('<preprint xmlns="http://arxiv.org/doi_feed" ' + 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ' + 'identifier="SciPost.org ' + doi_label + ' arXiv.org DOI feed" ' + 'version="DOI SnappyFeed v1.0" ' + 'xsi:schemaLocation="http://arxiv.org/doi_feed ' + 'http://arxiv.org/schemas/doi_feed.xsd">') + now = timezone.now() + feedxml += '<date year="%s" month="%s" day="%s" />' % (now.strftime('%Y'), + now.strftime('%m'), now.strftime('%d')) + publications = Publication.objects.filter( + in_issue__in_volume__in_journal=journal).order_by('-publication_date')[:100] + for publication in publications: + feedxml += ('\n<article preprint_id="%s" doi="%s" journal_ref="%s" />' % ( + publication.accepted_submission.arxiv_identifier_wo_vn_nr, publication.doi_string, + publication.citation())) + feedxml += '\n</preprint>' + return HttpResponse(feedxml, content_type='text/xml') diff --git a/production/templates/production/production.html b/production/templates/production/production.html index 8198157beb4b015e49f7dfe0da807d4fda991e46..27d00bf8f8979bc4c7cde59ec6284c84f8ecedf2 100644 --- a/production/templates/production/production.html +++ b/production/templates/production/production.html @@ -62,6 +62,7 @@ Officer: {% if stream.officer %}{{ stream.officer.user.first_name }} {{ stream.officer.user.last_name }}{% else %}<em>Unassigned</em>{% endif %} "></i> {% if stream.supervisor.user == request.user %} + <br> <i class="fa fa-info-circle" data-toggle="tooltip" data-html="true" title="" data-original-title="You are assigned as supervisor"></i> {% endif %} </div> diff --git a/scipost/urls.py b/scipost/urls.py index 862b316352d7ac06ad36185dedd0392de56b7671..6cfe265c321b2ae7ab0e63aba3345cbd5f817d77 100644 --- a/scipost/urls.py +++ b/scipost/urls.py @@ -207,6 +207,7 @@ urlpatterns = [ # Journal landing page url(r'^10.21468/%s' % JOURNAL_REGEX, journals_views.landing_page, name='landing_page'), url(r'^%s' % JOURNAL_REGEX, journals_views.landing_page, name='landing_page'), + url(r'^arxiv_doi_feed/%s' % JOURNAL_REGEX, journals_views.arxiv_doi_feed, name='arxiv_doi_feed'), ################ # Howto guides # diff --git a/templates/email/email_assigned_invitation_officer.html b/templates/email/email_assigned_invitation_officer.html index fca940e1e54fb4f0c260efb3cb2a73a5cad633db..18c4ceed38ec39faea4cbdeb41adcae9ea1a1d73 100644 --- a/templates/email/email_assigned_invitation_officer.html +++ b/templates/email/email_assigned_invitation_officer.html @@ -1,5 +1,5 @@ <p> - Dear {{ stream.invitations_officer.user.last }}, + Dear {{ stream.invitations_officer.user.last_name }}, </p> <p> You are now assigned as Invitations Officer to the stream diff --git a/templates/email/email_assigned_invitation_officer.txt b/templates/email/email_assigned_invitation_officer.txt index 4764909efb9e3666b4733e81f7f8ccd0e200ebf4..23103d8d37c01657006538e0fbe586f843bb87da 100644 --- a/templates/email/email_assigned_invitation_officer.txt +++ b/templates/email/email_assigned_invitation_officer.txt @@ -1,4 +1,4 @@ -Dear {{ stream.invitations_officer.user.last }}, +Dear {{ stream.invitations_officer.user.last_name }}, \n \n You are now assigned as Invitations Officer to the stream diff --git a/templates/email/email_assigned_production_officer.html b/templates/email/email_assigned_production_officer.html index ce4a42f49bf3eab52f5d684a3eddf9fb1e9f7acb..b6a474c49b15f6a73e33510e6dddf4481abfc841 100644 --- a/templates/email/email_assigned_production_officer.html +++ b/templates/email/email_assigned_production_officer.html @@ -1,5 +1,5 @@ <p> - Dear {{ stream.invitations_officer.user.last }}, + Dear {{ stream.invitations_officer.user.last_name }}, </p> <p> You are now assigned as Production Officer to the stream diff --git a/templates/email/email_assigned_production_officer.txt b/templates/email/email_assigned_production_officer.txt index f8229b5a70a2026c7ce702bcf90c4317294530be..60c80841b0abbf7cf207abab747e57e7d982ca80 100644 --- a/templates/email/email_assigned_production_officer.txt +++ b/templates/email/email_assigned_production_officer.txt @@ -1,4 +1,4 @@ -Dear {{ stream.invitations_officer.user.last }}, +Dear {{ stream.invitations_officer.user.last_name }}, \n \n You are now assigned as Production Officer to the stream diff --git a/templates/email/email_assigned_supervisor.html b/templates/email/email_assigned_supervisor.html index 8932d22cda75dfbf5d05a08d78e816b8ffb9b9ed..c2df2ad3212a9004f4bdcceb7043bcf9e9663181 100644 --- a/templates/email/email_assigned_supervisor.html +++ b/templates/email/email_assigned_supervisor.html @@ -1,5 +1,5 @@ <p> - Dear {{ stream.invitations_officer.user.last }}, + Dear {{ stream.invitations_officer.user.last_name }}, </p> <p> You are now assigned as Production Supervisor to the stream diff --git a/templates/email/email_assigned_supervisor.txt b/templates/email/email_assigned_supervisor.txt index f161973a9d6bc1efff7eeb298a817f95d398c849..9a4c201acb1be95a6fb7050f117ec804de4b202f 100644 --- a/templates/email/email_assigned_supervisor.txt +++ b/templates/email/email_assigned_supervisor.txt @@ -1,4 +1,4 @@ -Dear {{ stream.invitations_officer.user.last }}, +Dear {{ stream.invitations_officer.user.last_name }}, \n \n You are now assigned as Production Supervisor to the stream