diff --git a/commentaries/templates/commentaries/vet_commentary_requests.html b/commentaries/templates/commentaries/vet_commentary_requests.html index 22998d4d98ec3b183d54f24b89b7582df7e2b2af..94011f45fe6aa18eebcef8fe7c919ec99571488b 100644 --- a/commentaries/templates/commentaries/vet_commentary_requests.html +++ b/commentaries/templates/commentaries/vet_commentary_requests.html @@ -5,8 +5,8 @@ {% block bodysup %} <section> - <h1>SciPost Commentary Page requests to vet:</h1> - {% for commentary_to_vet in commentary_requests_to_vet %} + <h1>SciPost Commentary Page request to vet:</h1> + <br> <hr> <div class="row"> @@ -29,7 +29,7 @@ <input type="submit" value="Submit" /> </div> </div> - {% endfor %} + </section> {% endblock bodysup %} diff --git a/commentaries/views.py b/commentaries/views.py index ebac4381489d09bbb29809ede8ba539060761ead..f6bd5b813c9c43def3826880e31e8640045c34ef 100644 --- a/commentaries/views.py +++ b/commentaries/views.py @@ -60,9 +60,9 @@ def request_commentary_ack(request): def vet_commentary_requests(request): contributor = Contributor.objects.get(user=request.user) - commentary_requests_to_vet = Commentary.objects.filter(vetted=False) + commentary_to_vet = Commentary.objects.filter(vetted=False).first() # only handle one at a time form = VetCommentaryForm() - context = {'contributor': contributor, 'commentary_requests_to_vet': commentary_requests_to_vet, 'form': form } + context = {'contributor': contributor, 'commentary_to_vet': commentary_to_vet, 'form': form } return render(request, 'commentaries/vet_commentary_requests.html', context) diff --git a/comments/templates/comments/vet_author_replies.html b/comments/templates/comments/vet_author_replies.html index 33b05b3b59fe57abffb50d140cb6bc7bfc73fefa..84478f80953e6476adcfaa2a3e2c0877d50a33ce 100644 --- a/comments/templates/comments/vet_author_replies.html +++ b/comments/templates/comments/vet_author_replies.html @@ -5,8 +5,8 @@ {% block bodysup %} <section> - <h1>SciPost Author Replies to vet:</h1> - {% for reply_to_vet in replies_to_vet %} + <h1>SciPost Author Reply to vet:</h1> + <br> <hr> @@ -58,7 +58,7 @@ </form> </div> </div> - {% endfor %} + </section> {% endblock bodysup %} diff --git a/comments/templates/comments/vet_submitted_comments.html b/comments/templates/comments/vet_submitted_comments.html index a257c63656eb5bb24457ef42cc2dff2b5f06a8e3..4a185057f651e3dca27e690075e9b809b6d984a8 100644 --- a/comments/templates/comments/vet_submitted_comments.html +++ b/comments/templates/comments/vet_submitted_comments.html @@ -5,8 +5,8 @@ {% block bodysup %} <section> - <h1>SciPost Comments to vet:</h1> - {% for comment_to_vet in submitted_comments_to_vet %} + <h1>SciPost Comment to vet:</h1> + <br> <hr> {% if comment_to_vet.commentary %} @@ -51,7 +51,7 @@ </form> </div> </div> - {% endfor %} + </section> {% endblock bodysup %} diff --git a/comments/views.py b/comments/views.py index 140d08fdf68a713220061902735e2d30eed3407b..7580c52cb03f54059a5566f47288a36d05e444ba 100644 --- a/comments/views.py +++ b/comments/views.py @@ -22,9 +22,9 @@ def comment_submission_ack(request): def vet_submitted_comments(request): contributor = Contributor.objects.get(user=request.user) - submitted_comments_to_vet = Comment.objects.filter(status=0) + comment_to_vet = Comment.objects.filter(status=0).first() # only handle one at a time form = VetCommentForm() - context = {'contributor': contributor, 'submitted_comments_to_vet': submitted_comments_to_vet, 'form': form } + context = {'contributor': contributor, 'submitted_comment_to_vet': comment_to_vet, 'form': form } return(render(request, 'comments/vet_submitted_comments.html', context)) @@ -145,9 +145,9 @@ def author_reply_to_report(request, report_id): def vet_author_replies(request): contributor = Contributor.objects.get(user=request.user) - replies_to_vet = AuthorReply.objects.filter(status=0) + reply_to_vet = AuthorReply.objects.filter(status=0).first # only handle one at a time form = VetAuthorReplyForm() - context = {'contributor': contributor, 'replies_to_vet': replies_to_vet, 'form': form } + context = {'contributor': contributor, 'reply_to_vet': reply_to_vet, 'form': form } return(render(request, 'comments/vet_author_replies.html', context)) diff --git a/scipost/forms.py b/scipost/forms.py index 45e3264568a8bfdb84715ee097bcd5681f77006f..cabc5e68785c50c9e357e7ac7038996071279acf 100644 --- a/scipost/forms.py +++ b/scipost/forms.py @@ -17,20 +17,20 @@ REGISTRATION_REFUSAL_CHOICES = ( ) class RegistrationForm(forms.Form): - title = forms.ChoiceField(choices=TITLE_CHOICES) - first_name = forms.CharField(label='First name', max_length=100) - last_name = forms.CharField(label='Last name', max_length=100) - email = forms.EmailField(label='email') - orcid_id = forms.CharField(label="ORCID id", max_length=20) - nationality = LazyTypedChoiceField(choices=countries, initial='CA', widget=CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">')) - country_of_employment = LazyTypedChoiceField(choices=countries, initial='NL', widget=CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">')) - affiliation = forms.CharField(label='Affiliation', max_length=300) - #address = forms.CharField(label='Address', max_length=1000) - personalwebpage = forms.URLField(label='Personal web page') - 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() + title = forms.ChoiceField(choices=TITLE_CHOICES, label='* Title') + first_name = forms.CharField(label='* First name', max_length=100) + last_name = forms.CharField(label='* Last name', max_length=100) + email = forms.EmailField(label='* email address') + orcid_id = forms.CharField(label=" ORCID id", max_length=20, widget=forms.TextInput({'placeholder': 'Recommended. Get one at orcid.org'}), required=False) + nationality = LazyTypedChoiceField(choices=countries, label='* Nationality', initial='CA', widget=CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">')) + country_of_employment = LazyTypedChoiceField(choices=countries, label='* Country of employment', initial='NL', widget=CountrySelectWidget(layout='{widget}<img class="country-select-flag" id="{flag_id}" style="margin: 6px 4px 0" src="{country.flag}">')) + affiliation = forms.CharField(label='* Affiliation', max_length=300) + address = forms.CharField(label='Address', max_length=1000, widget=forms.TextInput({'placeholder': 'For eventual snail mail correspondence'}), required=False) + personalwebpage = forms.URLField(label='Personal web page', widget=forms.TextInput({'placeholder': 'full URL, e.g. http://www.[yourpage].com'}), required=False) + 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='* Captcha') #class RegistrationFormUser(forms.ModelForm): # class Meta: diff --git a/scipost/models.py b/scipost/models.py index 90ef55f923c5dacd3b64bf50e3f18bdf0bf3fe5d..7e7f1cb4425b7e257695ba6777ea76738b5d48ec 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -52,7 +52,7 @@ class Contributor(models.Model): nationality = CountryField() country_of_employment = CountryField() affiliation = models.CharField(max_length=300, verbose_name='affiliation') - #address = models.CharField(max_length=1000, verbose_name="address") + address = models.CharField(max_length=1000, verbose_name="address", default='') personalwebpage = models.URLField(verbose_name='personal web page') #vetted_by = models.OneToOneField(Contributor, related_name='vetted_by') TO ACTIVATE diff --git a/scipost/templates/scipost/register.html b/scipost/templates/scipost/register.html index 1c178e1e4e826b1bba4eec0427b3af6e6d4c776a..a12b79da19db23b21dd79b3cd74431a7ac4ab364 100644 --- a/scipost/templates/scipost/register.html +++ b/scipost/templates/scipost/register.html @@ -8,11 +8,13 @@ <h1>Register to SciPost</h1> <div class="row"> <div class="col-4"> - <p>Please note that all fields are required.</p> - <p>Don't have an ORCID id yet?</p> - <p>Get one at <a href="http://orcid.org">orcid.org</a>.</p> + <h3>Notes:</h3> + <p>Required fields are marked with a *.</p> + <p>An ORCID id is not formally required but helps preventing identification ambiguities. + You can easily get one at <a href="http://orcid.org">orcid.org</a>.</p> </div> - <div class="col-8"> + <div class="col-1"></div> + <div class="col-7"> <form action="{% url 'scipost:register' %}" method="post"> {% csrf_token %} <table> diff --git a/scipost/templates/scipost/vet_registration_requests.html b/scipost/templates/scipost/vet_registration_requests.html index 0c4d25f770c3cb55a7ed670a16222458f769e7da..47993f32451de36b4e6833984715207b9450950d 100644 --- a/scipost/templates/scipost/vet_registration_requests.html +++ b/scipost/templates/scipost/vet_registration_requests.html @@ -5,32 +5,32 @@ {% block bodysup %} <section> - <h1>SciPost Registration requests to vet:</h1> - <p>These Contributors are currently on rank 0 (submitting, commenting and voting disabled).</p> + <h1>SciPost Registration request to vet:</h1> + <p>This Contributor is currently on rank 0 (submitting, commenting and voting disabled).</p> <p>Use this form to promote to rank 1.</p> - {% for registration_to_vet in registration_requests_to_vet %} + <br> <hr> <div class="row"> <div class="col-8"> <table> - <tr><td>Title:</td><td>{{ registration_to_vet.title }}</td></tr> - <tr><td>First name:</td><td>{{ registration_to_vet.user.first_name }}</td></tr> - <tr><td>Last name:</td><td>{{ registration_to_vet.user.last_name }}</td></tr> - <tr><td>email:</td><td>{{ registration_to_vet.user.email }}</td></tr> - <tr><td>user name:</td><td>{{ registration_to_vet.user.username }}</td></tr> - <tr><td>orcid_id:</td><td>{{ registration_to_vet.orcid_id }}</td></tr> + <tr><td>Title:</td><td>{{ contributor_to_vet.title }}</td></tr> + <tr><td>First name:</td><td>{{ contributor_to_vet.user.first_name }}</td></tr> + <tr><td>Last name:</td><td>{{ contributor_to_vet.user.last_name }}</td></tr> + <tr><td>email:</td><td>{{ contributor_to_vet.user.email }}</td></tr> + <tr><td>user name:</td><td>{{ contributor_to_vet.user.username }}</td></tr> + <tr><td>orcid_id:</td><td>{{ contributor_to_vet.orcid_id }}</td></tr> </table> </div> <div class="col-4"> - <form action="{% url 'scipost:vet_registration_request_ack' contributor_id=registration_to_vet.id %}" method="post"> + <form action="{% url 'scipost:vet_registration_request_ack' contributor_id=contributor_to_vet.id %}" method="post"> {% csrf_token %} {{ form.as_p }} <input type="submit" value="Submit" /> </form> </div> </div> - {% endfor %} + </section> {% endblock bodysup %} diff --git a/scipost/views.py b/scipost/views.py index ac3c2f884c50d3fa044cdfda025ceb7414d8caeb..ef7aa89211d94a2b13b2df48a3e84142b2ad38eb 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -101,9 +101,9 @@ def thanks_for_registering(request): def vet_registration_requests(request): contributor = Contributor.objects.get(user=request.user) - registration_requests_to_vet = Contributor.objects.filter(rank=0) + contributor_to_vet = Contributor.objects.filter(rank=0).first() # limit to one at a time form = VetRegistrationForm() - context = {'contributor': contributor, 'registration_requests_to_vet': registration_requests_to_vet, 'form': form } + context = {'contributor': contributor, 'contributor_to_vet': contributor_to_vet, 'form': form } return render(request, 'scipost/vet_registration_requests.html', context) diff --git a/submissions/templates/submissions/process_new_submissions.html b/submissions/templates/submissions/process_new_submissions.html index ae62957eabcd542cded58cd1b2c1043458a95020..0f6f52af4c041d8fd1c4eb6ca92611278740912d 100644 --- a/submissions/templates/submissions/process_new_submissions.html +++ b/submissions/templates/submissions/process_new_submissions.html @@ -5,30 +5,30 @@ {% block bodysup %} <section> - <h1>SciPost Submissions to Process</h1> - {% for submission in submissions_to_process %} + <h1>SciPost Submission to Process</h1> + <br> <hr> <div class="row"> <div class="col-8"> <table> - <tr><td>Title: </td><td>{{ submission.title }}</td></tr> - <tr><td>Author(s): </td><td>{{ submission.author_list }}</td></tr> - <tr><td>arxiv Link: </td><td><a href="{{ submission.arxiv_link }}">{{ submission.arxiv_link }}</a></td></tr> - <tr><td>Date submitted: </td><td>{{ submission.submission_date }}</td></tr> + <tr><td>Title: </td><td>{{ submission_to_process.title }}</td></tr> + <tr><td>Author(s): </td><td>{{ submission_to_process.author_list }}</td></tr> + <tr><td>arxiv Link: </td><td><a href="{{ submission_to_process.arxiv_link }}">{{ submission_to_process.arxiv_link }}</a></td></tr> + <tr><td>Date submitted: </td><td>{{ submission_to_process.submission_date }}</td></tr> </table> <br /> <h4>Abstract:</h4> - <p>{{ submission.abstract }}</p> + <p>{{ submission_to_process.abstract }}</p> </div> <div class="col-4"> - <form action="{% url 'submissions:process_new_submission_ack' submission_id=submission.id %}" method="post"> + <form action="{% url 'submissions:process_new_submission_ack' submission_id=submission_to_process.id %}" method="post"> {% csrf_token %} {{ form.as_ul }} <input type="submit" value="Submit" /> </div> </div> - {% endfor %} + </section> {% endblock bodysup %} diff --git a/submissions/templates/submissions/vet_submitted_reports.html b/submissions/templates/submissions/vet_submitted_reports.html index e0238fb44dbb40ff503c67f040c6d62764283597..509784d79751c4ae0bdc8580f656ee56eddd392d 100644 --- a/submissions/templates/submissions/vet_submitted_reports.html +++ b/submissions/templates/submissions/vet_submitted_reports.html @@ -4,10 +4,9 @@ {% block bodysup %} -{% if submitted_reports_to_vet %} <section> - <h1>SciPost Reports to vet:</h1> - {% for report_to_vet in submitted_reports_to_vet %} + <h1>SciPost Report to vet:</h1> + <br> <hr> <h3>Submission associated to Report:</h3> @@ -42,8 +41,7 @@ </form> </div> </div> - {% endfor %} + </section> -{% endif %} {% endblock bodysup %} diff --git a/submissions/views.py b/submissions/views.py index a087cefd716b215f5bb148a5f9ccf89f5f762708..10db541c0e2e51ebf7d5ce498fe3349358955918 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -59,9 +59,9 @@ def submit_manuscript_ack(request): def process_new_submissions(request): - submissions_to_process = Submission.objects.filter(status='0') + submission_to_process = Submission.objects.filter(status='0').first() # only handle one at at time form = ProcessSubmissionForm() - context = {'submissions_to_process': submissions_to_process, 'form': form } + context = {'submission_to_process': submission_to_process, 'form': form } return render(request, 'submissions/process_new_submissions.html', context) @@ -190,9 +190,9 @@ def submit_report_ack(request): def vet_submitted_reports(request): contributor = Contributor.objects.get(user=request.user) - submitted_reports_to_vet = Report.objects.filter(status=0) + report_to_vet = Report.objects.filter(status=0).first() # only handle one at a time form = VetReportForm() - context = {'contributor': contributor, 'submitted_reports_to_vet': submitted_reports_to_vet, 'form': form } + context = {'contributor': contributor, 'report_to_vet': report_to_vet, 'form': form } return(render(request, 'submissions/vet_submitted_reports.html', context))