From 5773e7af5490722d35103335fa96ab95e884be09 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Wed, 30 Mar 2016 20:26:49 +0200
Subject: [PATCH] Bugs with incorrectly-filled form responses fixed, email
 texts improved

---
 journals/templates/journals/journals.html     |  2 +-
 scipost/forms.py                              |  2 +-
 scipost/templates/scipost/index.html          |  4 +--
 scipost/utils.py                              | 33 ++++++++++---------
 scipost/views.py                              |  8 ++---
 .../submissions/submit_manuscript.html        |  4 ++-
 6 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/journals/templates/journals/journals.html b/journals/templates/journals/journals.html
index c1c5c1979..2d37e41b9 100644
--- a/journals/templates/journals/journals.html
+++ b/journals/templates/journals/journals.html
@@ -12,7 +12,7 @@
     <h1>SciPost Physics Journals</h1>
   </div>
   <br/>
-  <p id="journalsannounce">OPEN FOR SUBMISSION STARTING 30 MAY 2016</p>
+  <p id="journalsannounce">OPEN FOR SUBMISSION STARTING JUNE 2016</p>
   <br/>
   <div class="row">
     <div class="col-5">
diff --git a/scipost/forms.py b/scipost/forms.py
index b1e560beb..9b254c241 100644
--- a/scipost/forms.py
+++ b/scipost/forms.py
@@ -34,7 +34,7 @@ class RegistrationForm(forms.Form):
     username = forms.CharField(label='* Username', max_length=100)
     password = forms.CharField(label='* Password', widget=forms.PasswordInput())
     password_verif = forms.CharField(label='* Verify pwd', widget=forms.PasswordInput())
-    captcha = CaptchaField(label='* Answer this (if you are not a robot):')
+    captcha = CaptchaField(label='* Answer this simple maths question:')
 
 
 class RegistrationInvitationForm(forms.ModelForm):
diff --git a/scipost/templates/scipost/index.html b/scipost/templates/scipost/index.html
index 0a1b2874c..987e192f3 100644
--- a/scipost/templates/scipost/index.html
+++ b/scipost/templates/scipost/index.html
@@ -18,7 +18,7 @@
     </div>
     <div class="flex-greybox320">
       <h1><a href="{% url 'journals:journals' %}">Journals</a></h1>
-      <p id="journalsannouncesmall">OPEN FOR SUBMISSION FROM 30 MAY 2016</p>
+      <p id="journalsannouncesmall">OPEN FOR SUBMISSION FROM JUNE 2016</p>
       <p>SciPost publishes a portfolio of high-quality two-way open access scientific journals.</p>
       <p>All SciPost Journals implement the stringent <a href="{% url 'scipost:peer_witnessed_refereeing' %}">peer-witnessed refereeing</a> principle.</p>
       <p>All Journals are fully managed by professional scientists.</p>
@@ -29,7 +29,7 @@
   <div class="flex-container">
     <div class="flex-greybox320">
       <h1><a href="{% url 'submissions:submissions' %}">Submissions</a></h1>
-      <p id="journalsannouncesmall">OPEN FOR SUBMISSION FROM 30 MAY 2016</p>
+      <p id="journalsannouncesmall">OPEN FOR SUBMISSION FROM JUNE 2016</p>
       <p>Papers under consideration for publication in SciPost Journals</p>
       <br/>
       <h3>Search SciPost Submissions:</h3>
diff --git a/scipost/utils.py b/scipost/utils.py
index 5c14f5896..e3f1af499 100644
--- a/scipost/utils.py
+++ b/scipost/utils.py
@@ -122,27 +122,28 @@ class Utils(object):
         else:
             email_text += cls.invitation.first_name
         email_text +=  ',\n\n'
-        if cls.invitation.personal_message is not None:
+        if len(cls.invitation.personal_message) > 3:
             email_text += cls.invitation.personal_message + '\n\n'
-        email_text += ('You will have noticed that the world of scientific publishing is currently undergoing many changes, but you will perhaps agree that it is not completely clear that the best interests of science and scientists are being served. In recent times, and after much thinking of how best to address this issue, I have decided to forge ahead and implement a new online publication portal by and for scientists.\n\nThe initiative, called SciPost, can in a sense be viewed as an extra layer on arXiv.org. To summarize, SciPost will be a complete scientific publication platform, run by and for professional scientists, providing:\n\n' +
-                       '- a means to comment on all existing literature\n\n' +
-                       "- a repository of links to theses (Habilitation, PhD, Master's)\n\n" +
-                       '- most importantly, a collection of community-run two-way open access (no subscription fees, no author fees) journals with extremely stringent (peer-witnessed) refereeing. The main innovations are thus a redesigned, more accountable refereeing process (addressing some of the weaknesses identified in current habits), together with a new concept for the editorial process, based on our Editorial College, designed to minimize the burden of the editorial workflow while ensuring the highest achievable quality.\n\n')
+        email_text += ('You will have noticed that the world of scientific publishing is currently undergoing many changes, but you may agree that it is not completely clear that the best interests of science and scientists are being served. After much thinking and discussion about how best to address this issue, I recently decided to forge ahead and implement a new online publication portal by and for scientists.\n\nThe initiative, called SciPost, aims to build on the best traditions within our community (as exemplified by the arXiv.org preprint server) by offering a complete scientific publication platform, run by and for professional scientists, providing:\n\n' +
+                       '- a means to comment on all existing literature;\n\n' +
+                       "- a repository of links to theses (Habilitation, PhD, Master's);\n\n" +
+                       '- and, most importantly, a collection of community-run two-way open access (no subscription fees, no author fees) journals with extremely stringent (peer-witnessed) refereeing.\n\n' +
+                       'For the Journals, the main innovations are thus a redesigned, more accountable refereeing process (addressing some of the weaknesses identified in current systems and habits), together with a new concept for the editorial process, based on our Editorial College (exclusively composed of established, professionally practising scientists), designed to ensure the highest achievable scientific quality while minimizing the burden of the editorial workflow.\n\n')
         if cls.invitation.invitation_type == 'F':
-            email_text += ('The portal has been intensively developed over the last few months. It is legally based on a not-for-profit Foundation and will perpetually operate as a non-commercial entity at the service of the academic sector. We are now entering the next phase in the implementation, which is to build up the community of professional academics who will help operate it.\n\n' +
-                           'To go straight to the point, on behalf of the Foundation, I hereby have the honour to invite you to become an Editorial Fellow and thus join the Editorial College of SciPost Physics.\n\n' +
-                           'Please note that only well-known and respected senior academics are being contacted. Academic reputation is the most important criterion guiding our considerations of who should belong to the Editorial College.\n\n' +
-                           "To help you in considering this, it's perhaps best if you take the time to take a look at the website itself. At the moment, registration is by invitation only, and the site is temporarily stripped of content for non-registered users. You can personally register by visiting the following single-use link within the next 2 weeks: \n\n" + 
+            email_text += ('The SciPost.org portal has been intensively developed over the last few months. It is legally based on a not-for-profit foundation and will operate in perpetuity as a non-commercial entity at the exclusive service of the academic sector. We are now entering the next phase in the implementation, which is to build up the community of professional academics who will help operate it.\n\n' +
+                           'To go straight to the point, on behalf of the foundation, I hereby have the honour to invite you to become an Editorial Fellow and thus join the Editorial College of SciPost Physics.\n\n' +
+                           'Please note that only well-known and respected senior academics are being contacted. Academic reputation and involvement in the community are the most important criteria guiding our considerations of who should belong to the Editorial College.\n\n' +
+                           "To help you in considering this, it would be best if you were to take the time to look at the website itself. At the moment, registration is by invitation only, and the site is temporarily stripped of content for non-registered users. You can personally register (to become a Contributor, without necessarily committing to membership of the Editorial College, this to be discussed separately) by visiting the following single-use link within the next 2 weeks: \n\n" + 
                            'https://scipost.org/invitation/' + cls.invitation.invitation_key + '\n\n' +
-                           'I will then activate your account, allowing you to directly see all the contents. Many details about the initiative can be found at scipost.org/about and at scipost.org/FAQ.\n\n' +
-                           "Since this initiative has no chance of success without the involvement of the people it's meant to serve, we'd be very grateful if you gave due consideration to this offer. To make things clear, we would expect you to commit only 2-4 hours per month to help perform Editorial duties. The number of Editorial Fellows will be adapted in order to keep things this way. You could try it out for 6 months or a year and of course quit anytime if you felt that things weren't to your taste. If you do develop sympathy for the initiative, we'd be even more grateful if you considered submitting a publication to one of the journals within the near future, in order to help establish their reputation.\n\n" +
-                           "I'll be happy to provide you with more detail if you require. In view of our development plans, could I possibly ask you to react (by replying to this email) within the next two or three weeks if possible? I'll be looking forward to your reaction, your comments and suggestions, be they positive or negative. If you need more time to consider, that's also fine, please let me know.\n\n")
+                           'I will then activate your account, allowing you to directly see all the content. Many details about the initiative can then be found at scipost.org/about and at scipost.org/FAQ.\n\n' +
+                           "Since the success of this initiative is dependent on the involvement of the very people it is meant to serve, we'd be very grateful if you were to give due consideration to this proposal. We would expect you to commit just 2-4 hours per month to help perform Editorial duties; we will adjust the number of Editorial Fellows to ensure this is the case. You could try it out for 6 months or a year, and of course you could quit any time you wished. We'd be even more grateful if you considered submitting a publication to one of the journals (which will open for submission in a few weeks) in the near future, in order to help establish their reputation.\n\n" +
+                           "I'd be happy to provide you with more information, should you require it. In view of our development plans, I would be grateful if you could react (by replying to this email) within the next two or three weeks, if possible. I'll be looking forward to your reaction, your comments and suggestions, be they positive or negative. If you need more time to consider, that's also fine; just let me know.\n\n")
         elif cls.invitation.invitation_type == 'C':
-            email_text += ('The portal has been intensively developed over the last few months. It is legally based on a not-for-profit Foundation and will perpetually operate as a non-commercial entity at the service of the academic sector. We are now entering the next phase in the implementation, which is to build up the community of professional academics who will hopefully make use of the portal in their daily activities.\n\n' +
-                           "It's perhaps best if you take the time to take a look at the website itself. At the moment, registration is by invitation only, and the site is temporarily stripped of content for non-registered users. You can personally register by visiting the following single-use link within the next 2 weeks: \n\n" +
+            email_text += ('The SciPost.org portal has been intensively developed over the last few months. It is legally based on a not-for-profit foundation and will operate in perpetuity as a non-commercial entity at the exclusive service of the academic sector. We are now entering the next phase in the implementation, which is to build up the community of professional academics who will hopefully make use of the portal in their daily activities.\n\n' +
+                           "It's perhaps best if you take the time to look at the website itself. At the moment, registration is by invitation only, and the site is temporarily stripped of content for non-registered users. You can personally register by visiting the following single-use link within the next 2 weeks: \n\n" +
                            'https://scipost.org/invitation/' + cls.invitation.invitation_key + '\n\n' +
-                           'I will then activate your account, allowing you to directly see all the contents. Many details about the initiative can be found at scipost.org/about and at scipost.org/FAQ.\n\n' +
-                           "If you do develop sympathy for the initiative, besides participating in the online platform, we'd be very grateful if you considered submitting a publication to one of the journals within the near future, in order to help establish their reputation. I'll also be looking forward to your reaction, your comments and suggestions, be they positive or negative.\n\n")
+                           'I will then activate your account, allowing you to directly see all the content. Many details about the initiative can then be found at scipost.org/about and at scipost.org/FAQ.\n\n' +
+                           "If you do develop sympathy for the initiative, besides participating in the online platform, we'd be very grateful if you considered submitting a publication to one of the journals (which will open for submission in a few weeks) within the near future, in order to help establish their reputation. I'll also be looking forward to your reaction, your comments and suggestions, be they positive or negative.\n\n")
 
         email_text += ("On behalf of the SciPost Foundation,\n\n" +
                        "Prof. dr Jean-Sébastien Caux\n---------------------------------------------\nInstitute for Theoretial Physics\nUniversity of Amsterdam\nScience Park 904\n1098 XH Amsterdam\nThe Netherlands\n---------------------------------------------\ntel.: +31 (0)20 5255775\nfax: +31 (0)20 5255778\n---------------------------------------------")
diff --git a/scipost/views.py b/scipost/views.py
index 2b121b169..61416c721 100644
--- a/scipost/views.py
+++ b/scipost/views.py
@@ -99,7 +99,7 @@ def register(request):
                               {'form': form, 'errormessage': 'This email address is already in use'})
             Utils.create_and_save_contributor()
             Utils.send_registration_email()
-            return HttpResponseRedirect('thanks_for_registering')
+            return HttpResponseRedirect(reverse('scipost:thanks_for_registering'))
     else:
         form = RegistrationForm()
     # Remove invited from next two lines to open registrations without invitation
@@ -126,7 +126,7 @@ def invitation(request, key):
                               {'form': form, 'invited': True, 'key': key, 'errormessage': 'This email address is already in use'})
             Utils.create_and_save_contributor()
             Utils.send_registration_email()
-            return HttpResponseRedirect(reverse('thanks_for_registering'))
+            return HttpResponseRedirect(reverse('scipost:thanks_for_registering'))
         else:
             errormessage = 'form is invalidly filled'
             return render(request, 'scipost/register.html',
@@ -224,7 +224,7 @@ def vet_registration_request_ack(request, contributor_id):
                 contributor.user.groups.add(group)
                 email_text = ('Dear ' + title_dict[contributor.title] + ' ' + contributor.user.last_name + 
                               ', \n\nYour registration to the SciPost publication portal has been accepted. ' +
-                              'You can now login and contribute. \n\nThe SciPost Team.')
+                              'You can now login at https://scipost.org and contribute. \n\nThe SciPost Team.')
                 emailmessage = EmailMessage('SciPost registration accepted', email_text, 'registration@scipost.org', 
                                             [contributor.user.email, 'registration@scipost.org'], 
                                             reply_to=['registration@scipost.org'])
@@ -288,7 +288,7 @@ def login_view(request):
                 contributor = Contributor.objects.get(user=request.user)
                 context = {'contributor': contributor }
                 #return render(request, 'scipost/personal_page.html', context)
-                return HttpResponseRedirect('/personal_page')
+                return HttpResponseRedirect('personal_page')
             else:
                 return render(request, 'scipost/disabled_account.html')
         else:
diff --git a/submissions/templates/submissions/submit_manuscript.html b/submissions/templates/submissions/submit_manuscript.html
index d0ad76b91..616243c1a 100644
--- a/submissions/templates/submissions/submit_manuscript.html
+++ b/submissions/templates/submissions/submit_manuscript.html
@@ -9,7 +9,7 @@
 <section>
   <h1>Submit a manuscript to SciPost</h1>
 
-  <p id="journalsannounce">OPEN FOR SUBMISSION STARTING 30 MAY 2016</p>
+  <p id="journalsannounce">OPEN FOR SUBMISSION STARTING JUNE 2016</p>
 
   <form action="{% url 'submissions:submit_manuscript' %}" method="post">
     {% csrf_token %}
@@ -18,7 +18,9 @@
 	{{ form.as_table }}
       </ul>
     </table>
+    <!-- Deactivated until launch!
     <input type="submit" value="Submit"/>
+    -->
   </form>
 </section>
 {% endif %} <!-- Temporary strip -->
-- 
GitLab