diff --git a/commentaries/templates/commentaries/no_commentary_req_to_vet.html b/commentaries/templates/commentaries/no_commentary_req_to_vet.html new file mode 100644 index 0000000000000000000000000000000000000000..0c1be3813fa4db30d397a9d4c488adac605c3513 --- /dev/null +++ b/commentaries/templates/commentaries/no_commentary_req_to_vet.html @@ -0,0 +1,11 @@ +{% extends 'scipost/base.html' %} + +{% block pagetitle %}: vet Commentary requests{% endblock pagetitle %} + +{% block bodysup %} + +<section> + <h1>There are no SciPost Commentary Page requests for you to vet.</h1> +</section> + +{% endblock bodysup %} diff --git a/commentaries/templates/commentaries/vet_commentary_request_ack.html b/commentaries/templates/commentaries/vet_commentary_request_ack.html index c0524af4afb48c01ef800d7a1dfe3673ce8a2712..ad329294f40d3bb2c85357d261d8ae6eb50a35cb 100644 --- a/commentaries/templates/commentaries/vet_commentary_request_ack.html +++ b/commentaries/templates/commentaries/vet_commentary_request_ack.html @@ -6,7 +6,6 @@ <section> <h1>SciPost Commentary request vetted.</h1> - <p>{{ commentary_id }} </p> <p><a href="{% url 'commentaries:vet_commentary_requests' %}">Back to Commentary requests page</a></p> </section> diff --git a/commentaries/urls.py b/commentaries/urls.py index 09c76d22ace1195557f920527d103e65b5b84914..235cfde58a15a6e7997fe12c3f5fede011dd6031 100644 --- a/commentaries/urls.py +++ b/commentaries/urls.py @@ -9,5 +9,6 @@ urlpatterns = [ url(r'^request_commentary$', views.request_commentary, name='request_commentary'), url(r'^request_commentary_ack$', views.request_commentary_ack, name='request_commentary_ack'), url(r'^vet_commentary_requests$', views.vet_commentary_requests, name='vet_commentary_requests'), + url(r'^no_commentary_req_to_vet$', views.no_commentary_req_to_vet, name='no_commentary_req_to_vet'), url(r'^vet_commentary_request_ack/(?P<commentary_id>[0-9]+)$', views.vet_commentary_request_ack, name='vet_commentary_request_ack'), ] diff --git a/commentaries/views.py b/commentaries/views.py index f6bd5b813c9c43def3826880e31e8640045c34ef..47ed8b8101750ce34044ed0b47833f0be6cde7a9 100644 --- a/commentaries/views.py +++ b/commentaries/views.py @@ -61,9 +61,14 @@ def request_commentary_ack(request): def vet_commentary_requests(request): contributor = Contributor.objects.get(user=request.user) commentary_to_vet = Commentary.objects.filter(vetted=False).first() # only handle one at a time - form = VetCommentaryForm() - context = {'contributor': contributor, 'commentary_to_vet': commentary_to_vet, 'form': form } - return render(request, 'commentaries/vet_commentary_requests.html', context) + if commentary_to_vet is not None: + form = VetCommentaryForm() + context = {'contributor': contributor, 'commentary_to_vet': commentary_to_vet, 'form': form } + return render(request, 'commentaries/vet_commentary_requests.html', context) + return render (request, 'commentaries/no_commentary_req_to_vet.html') + +def no_commentary_req_to_vet(request): + return render (request, 'commentaries/no_commentary_req_to_vet.html') def vet_commentary_request_ack(request, commentary_id): diff --git a/comments/templates/comments/no_author_reply_to_vet.html b/comments/templates/comments/no_author_reply_to_vet.html new file mode 100644 index 0000000000000000000000000000000000000000..ee101ad2eb9597fdc238a4f340010aa3df761f50 --- /dev/null +++ b/comments/templates/comments/no_author_reply_to_vet.html @@ -0,0 +1,11 @@ +{% extends 'scipost/base.html' %} + +{% block pagetitle %}: vet author replies{% endblock pagetitle %} + +{% block bodysup %} + +<section> + <h1>There are no SciPost Author Replies for you to vet.</h1> +</section> + +{% endblock bodysup %} diff --git a/comments/templates/comments/no_comment_to_vet.html b/comments/templates/comments/no_comment_to_vet.html new file mode 100644 index 0000000000000000000000000000000000000000..08841b51f48e68290f0c920fbd3b23e5421c1f12 --- /dev/null +++ b/comments/templates/comments/no_comment_to_vet.html @@ -0,0 +1,11 @@ +{% extends 'scipost/base.html' %} + +{% block pagetitle %}: vet comments{% endblock pagetitle %} + +{% block bodysup %} + +<section> + <h1>There are no SciPost Comments for you to vet.</h1> +</section> + +{% endblock bodysup %} diff --git a/comments/urls.py b/comments/urls.py index 64a607231d4ac6125d02a2410957923cc2d483b8..caede0fd16d2ef13dd35fbc6a1317b6076ad3b46 100644 --- a/comments/urls.py +++ b/comments/urls.py @@ -7,9 +7,11 @@ urlpatterns = [ url(r'^comment_submission_ack$', views.comment_submission_ack, name='comment_submission_ack'), url(r'^reply_to_comment/(?P<comment_id>[0-9]+)$', views.reply_to_comment, name='reply_to_comment'), url(r'^vet_submitted_comments$', views.vet_submitted_comments, name='vet_submitted_comments'), + url(r'^no_comment_to_vet$', views.no_comment_to_vet, name='no_comment_to_vet'), url(r'^vet_submitted_comment_ack/(?P<comment_id>[0-9]+)$', views.vet_submitted_comment_ack, name='vet_submitted_comment_ack'), url(r'^author_reply_to_comment/(?P<comment_id>[0-9]+)$', views.author_reply_to_comment, name='author_reply_to_comment'), url(r'^author_reply_to_report/(?P<report_id>[0-9]+)$', views.author_reply_to_report, name='author_reply_to_report'), url(r'^vet_author_replies$', views.vet_author_replies, name='vet_author_replies'), + url(r'^no_author_reply_to_vet$', views.no_author_reply_to_vet, name='no_author_reply_to_vet'), url(r'^vet_author_reply_ack/(?P<reply_id>[0-9]+)$', views.vet_author_reply_ack, name='vet_author_reply_ack'), ] diff --git a/comments/views.py b/comments/views.py index 7580c52cb03f54059a5566f47288a36d05e444ba..cba73c4a0f4cfcafccf83b06f87a5370357bc54f 100644 --- a/comments/views.py +++ b/comments/views.py @@ -23,9 +23,14 @@ def comment_submission_ack(request): def vet_submitted_comments(request): contributor = Contributor.objects.get(user=request.user) comment_to_vet = Comment.objects.filter(status=0).first() # only handle one at a time - form = VetCommentForm() - context = {'contributor': contributor, 'submitted_comment_to_vet': comment_to_vet, 'form': form } - return(render(request, 'comments/vet_submitted_comments.html', context)) + if comment_to_vet is not None: + form = VetCommentForm() + context = {'contributor': contributor, 'submitted_comment_to_vet': comment_to_vet, 'form': form } + return(render(request, 'comments/vet_submitted_comments.html', context)) + return render (request, 'comments/no_comment_to_vet.html') + +def no_comment_to_vet(request): + return render (request, 'comments/no_comment_to_vet.html') def vet_submitted_comment_ack(request, comment_id): @@ -145,10 +150,15 @@ def author_reply_to_report(request, report_id): def vet_author_replies(request): contributor = Contributor.objects.get(user=request.user) - reply_to_vet = AuthorReply.objects.filter(status=0).first # only handle one at a time - form = VetAuthorReplyForm() - context = {'contributor': contributor, 'reply_to_vet': reply_to_vet, 'form': form } - return(render(request, 'comments/vet_author_replies.html', context)) + reply_to_vet = AuthorReply.objects.filter(status=0).first() # only handle one at a time + if reply_to_vet is not None: + form = VetAuthorReplyForm() + context = {'contributor': contributor, 'reply_to_vet': reply_to_vet, 'form': form } + return(render(request, 'comments/vet_author_replies.html', context)) + return render (request, 'comments/no_author_reply_to_vet.html') + +def no_author_reply_to_vet(request): + return render (request, 'comments/no_author_reply_to_vet.html') def vet_author_reply_ack(request, reply_id): diff --git a/scipost/templates/scipost/no_registration_req_to_vet.html b/scipost/templates/scipost/no_registration_req_to_vet.html new file mode 100644 index 0000000000000000000000000000000000000000..762411b45c1d445d5d61ae2c243a20d57f258268 --- /dev/null +++ b/scipost/templates/scipost/no_registration_req_to_vet.html @@ -0,0 +1,11 @@ +{% extends 'scipost/base.html' %} + +{% block pagetitle %}: registrations to vet{% endblock pagetitle %} + +{% block bodysup %} + +<section> + <h1>There are currently no SciPost Registration requests for you to vet.</h1> +</section> + +{% endblock bodysup %} diff --git a/scipost/templates/scipost/vet_registration_requests.html b/scipost/templates/scipost/vet_registration_requests.html index 47993f32451de36b4e6833984715207b9450950d..63ba7e19616c8ae4fcd67018a2d39b97e884c1f6 100644 --- a/scipost/templates/scipost/vet_registration_requests.html +++ b/scipost/templates/scipost/vet_registration_requests.html @@ -5,6 +5,7 @@ {% block bodysup %} <section> + <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> diff --git a/scipost/urls.py b/scipost/urls.py index 2459ab3e092183bc95de121ff3633c73b939c556..2c0e852029264b437012ec3236f50bbe64d47426 100644 --- a/scipost/urls.py +++ b/scipost/urls.py @@ -15,14 +15,15 @@ urlpatterns = [ ## Registration url(r'^register$', views.register, name='register'), url(r'^thanks_for_registering$', views.thanks_for_registering, name='thanks for registering'), - url(r'^vet_registration_requests$', views.vet_registration_requests, name='vet_registration_requests'), - url(r'^vet_registration_request_ack/(?P<contributor_id>[0-9]+)$', views.vet_registration_request_ack, name='vet_registration_request_ack'), url(r'^activation/(?P<key>.+)$', views.activation, name='activation'), url(r'^activation_ack$', views.activation_ack, name='activation_ack'), url(r'^request_new_activation_link/(?P<oldkey>.+)$', views.request_new_activation_link, name='request_new_activation_link'), #url(r'^request_new_activation_link$', views.request_new_activation_link, name='request_new_activation_link'), url(r'^request_new_activation_link_ack$', views.request_new_activation_link_ack, name='request_new_activation_link_ack'), url(r'^already_activated$', views.already_activated, name='already_activated'), + url(r'^vet_registration_requests$', views.vet_registration_requests, name='vet_registration_requests'), + url(r'^vet_registration_request_ack/(?P<contributor_id>[0-9]+)$', views.vet_registration_request_ack, name='vet_registration_request_ack'), + url(r'^no_registration_req_to_vet$', views.no_registration_req_to_vet, name='no_registration_req_to_vet'), ## Authentication url(r'^login$', views.login_view, name='login'), url(r'^logout$', views.logout_view, name='logout'), diff --git a/scipost/views.py b/scipost/views.py index ccd75ee4b6c39db39fbbb1e11099268da3a1a955..0945650af97e5bf2ca826b54480650ac3593d70f 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -174,11 +174,16 @@ def already_activated(request): def vet_registration_requests(request): contributor = Contributor.objects.get(user=request.user) contributor_to_vet = Contributor.objects.filter(user__is_active=True, rank=0).first() # limit to one at a time - form = VetRegistrationForm() - context = {'contributor': contributor, 'contributor_to_vet': contributor_to_vet, 'form': form } - return render(request, 'scipost/vet_registration_requests.html', context) + if contributor_to_vet is not None: + form = VetRegistrationForm() + context = {'contributor': contributor, 'contributor_to_vet': contributor_to_vet, 'form': form } + return render(request, 'scipost/vet_registration_requests.html', context) + return render (request, 'scipost/no_registration_req_to_vet.html') +def no_registration_req_to_vet(request): + return render(request, 'scipost/no_registration_req_to_vet.html') + def vet_registration_request_ack(request, contributor_id): # process the form if request.method == 'POST': diff --git a/submissions/templates/submissions/no_new_submission_to_process.html b/submissions/templates/submissions/no_new_submission_to_process.html new file mode 100644 index 0000000000000000000000000000000000000000..6b09da037b5a142573bf6b808c0faa2fe398d1b6 --- /dev/null +++ b/submissions/templates/submissions/no_new_submission_to_process.html @@ -0,0 +1,11 @@ +{% extends 'scipost/base.html' %} + +{% block pagetitle %}: process submissions{% endblock pagetitle %} + +{% block bodysup %} + +<section> + <h1>There are no SciPost Submissions for you to vet.</h1> +</section> + +{% endblock bodysup %} diff --git a/submissions/templates/submissions/no_report_to_vet.html b/submissions/templates/submissions/no_report_to_vet.html new file mode 100644 index 0000000000000000000000000000000000000000..def2c3278ea14cc4c28c36bd2f964472301bca9d --- /dev/null +++ b/submissions/templates/submissions/no_report_to_vet.html @@ -0,0 +1,11 @@ +{% extends 'scipost/base.html' %} + +{% block pagetitle %}: vet reports{% endblock pagetitle %} + +{% block bodysup %} + +<section> + <h1>There are no SciPost Reports for you to vet.</h1> +</section> + +{% endblock bodysup %} diff --git a/submissions/urls.py b/submissions/urls.py index c8f0e06ce12d4c6e331ad5a39e716a02cc58aa26..cae34b058692c6240b1a6dcbd6922c8271e5da5f 100644 --- a/submissions/urls.py +++ b/submissions/urls.py @@ -10,10 +10,12 @@ urlpatterns = [ url(r'^submit_manuscript$', views.submit_manuscript, name='submit_manuscript'), url(r'^submit_manuscript_ack$', views.submit_manuscript_ack, name='submit_manuscript_ack'), url(r'^process_new_submissions$', views.process_new_submissions, name='process_new_submissions'), + url(r'^no_new_submission_to_process$', views.no_new_submission_to_process, name='no_new_submission_to_process'), url(r'^process_new_submission_ack/(?P<submission_id>[0-9]+)$', views.process_new_submission_ack, name='process_new_submission_ack'), # Reports url(r'^submit_report/(?P<submission_id>[0-9]+)$', views.submit_report, name='submit_report'), url(r'^submit_report_ack$', views.submit_report_ack, name='submit_report_ack'), url(r'^vet_submitted_reports$', views.vet_submitted_reports, name='vet_submitted_reports'), + url(r'^no_report_to_vet$', views.no_report_to_vet, name='no_report_to_vet'), url(r'^vet_submitted_report_ack/(?P<report_id>[0-9]+)$', views.vet_submitted_report_ack, name='vet_submitted_report_ack'), ] diff --git a/submissions/views.py b/submissions/views.py index 10db541c0e2e51ebf7d5ce498fe3349358955918..b917ecef1e9ec05ef98afdf18bfd4ffddc5ba224 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -60,9 +60,15 @@ def submit_manuscript_ack(request): def process_new_submissions(request): submission_to_process = Submission.objects.filter(status='0').first() # only handle one at at time - form = ProcessSubmissionForm() - context = {'submission_to_process': submission_to_process, 'form': form } - return render(request, 'submissions/process_new_submissions.html', context) + if submission_to_process is not None: + form = ProcessSubmissionForm() + context = {'submission_to_process': submission_to_process, 'form': form } + return render(request, 'submissions/process_new_submissions.html', context) + return render(request, 'submissions/no_new_submission_to_process.html') + + +def no_new_submission_to_process(request): + return render(request, 'submissions/no_new_submission_to_process.html') def process_new_submission_ack(request, submission_id): @@ -191,9 +197,15 @@ def submit_report_ack(request): def vet_submitted_reports(request): contributor = Contributor.objects.get(user=request.user) report_to_vet = Report.objects.filter(status=0).first() # only handle one at a time - form = VetReportForm() - context = {'contributor': contributor, 'report_to_vet': report_to_vet, 'form': form } - return(render(request, 'submissions/vet_submitted_reports.html', context)) + if report_to_vet is not None: + form = VetReportForm() + context = {'contributor': contributor, 'report_to_vet': report_to_vet, 'form': form } + return(render(request, 'submissions/vet_submitted_reports.html', context)) + return render(request, 'submissions/no_report_to_vet.html') + + +def no_report_to_vet(request): + return render(request, 'submissions/no_report_to_vet.html') def vet_submitted_report_ack(request, report_id):