From 4d88bdb2c22573a26beba7384cd9af2212989f92 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Fri, 22 Apr 2016 17:13:00 +0200 Subject: [PATCH] Open Commentary request form filling via DOI to all --- commentaries/forms.py | 2 +- .../commentaries/request_commentary.html | 21 +++++++++---------- commentaries/views.py | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/commentaries/forms.py b/commentaries/forms.py index 67efd9517..25fa917eb 100644 --- a/commentaries/forms.py +++ b/commentaries/forms.py @@ -17,7 +17,7 @@ COMMENTARY_REFUSAL_CHOICES = ( ) class DOIToQueryForm(forms.Form): - doi = forms.CharField(widget=forms.TextInput({'placeholder': 'ex.: 10.1103/PhysRevLett.000.000000'})) + doi = forms.CharField(widget=forms.TextInput({'label': 'DOI', 'placeholder': 'ex.: 10.21468/00.000.000000'})) class RequestCommentaryForm(forms.ModelForm): diff --git a/commentaries/templates/commentaries/request_commentary.html b/commentaries/templates/commentaries/request_commentary.html index a14e82934..0e8606095 100644 --- a/commentaries/templates/commentaries/request_commentary.html +++ b/commentaries/templates/commentaries/request_commentary.html @@ -72,6 +72,16 @@ {% endif %} <br/> {% endif %} + + <h3><em>For published papers, you can prefill the form (except for domain, specialization and abstract) using the DOI:</em></h3> + <p><em>(give the DOI as 10.[4 to 9 digits]/[string], without prefix, as per the placeholder)</em></p> + <form action="{% url 'commentaries:prefill_using_DOI' %}" method="post"> + {% csrf_token %} + {{ doiform }} + <input type="submit" value="Query DOI"/> + </form> + + <br/> <form action="{% url 'commentaries:request_commentary' %}" method="post"> {% csrf_token %} <table> @@ -80,17 +90,6 @@ <input type="submit" value="Submit"/> </form> - {% if request.user|is_in_group:'Testers' %} - <div class="forTesters"> - <h1>For Testers:</h1> - <h3>Prefill form using the DOI:</h3> - <form action="{% url 'commentaries:prefill_using_DOI' %}" method="post"> - {% csrf_token %} - {{ doiform }} - <input type="submit" value="Query DOI"/> - </form> - </div> - {% endif %} </section> {% endblock bodysup %} diff --git a/commentaries/views.py b/commentaries/views.py index 0726b515a..7b7e67dbd 100644 --- a/commentaries/views.py +++ b/commentaries/views.py @@ -95,7 +95,7 @@ def prefill_using_DOI(request): errormessage = '' existing_commentary = None if not doipattern.match(doiform.cleaned_data['doi']): - errormessage = 'The form of the DOI you entered is improperly formatted.' + errormessage = 'The DOI you entered is improperly formatted.' elif Commentary.objects.filter(pub_DOI=doiform.cleaned_data['doi']).exists(): errormessage = 'There already exists a Commentary Page on this publication, see' existing_commentary = get_object_or_404(Commentary, pub_DOI=doiform.cleaned_data['doi']) -- GitLab