diff --git a/scipost/forms.py b/scipost/forms.py index 7fcb4b411ef65025bfce0d1d2861a934f045b562..c7db107ca8c9edb9f542ca58b63cd9723cc67bc5 100644 --- a/scipost/forms.py +++ b/scipost/forms.py @@ -15,6 +15,7 @@ REGISTRATION_REFUSAL_CHOICES = ( (-2, 'another account already exists for this person'), (-3, 'barred from SciPost (abusive behaviour)'), ) +reg_ref_dict = dict(REGISTRATION_REFUSAL_CHOICES) class RegistrationForm(forms.Form): title = forms.ChoiceField(choices=TITLE_CHOICES, label='* Title') diff --git a/scipost/templates/scipost/index.html b/scipost/templates/scipost/index.html index d36f6ec90ea543ebf81f6966bc3b795fec8629bf..a669cdd5b810ca78054dd2f396292e9b496d620a 100644 --- a/scipost/templates/scipost/index.html +++ b/scipost/templates/scipost/index.html @@ -25,6 +25,19 @@ <h3><a href="{% url 'scipost:peer_witnessed_refereeing' %}">About peer-witnessed refereeing</a></h3> <h3><a href="{% url 'submissions:sub_and_ref_procedure' %}">Submission and refereeing procedure</a></h3> </div> + <div class="flex-greybox320"> + <h1><a href="{% url 'submissions:submissions' %}">Submissions</a></h1> + <p>Papers under consideration for publication in SciPost Journals</p> + <br/> + <h3>Search SciPost Submissions:</h3> + <form action="{% url 'submissions:submissions' %}" method="post"> + {% csrf_token %} + <table> + {{ submission_search_form.as_table }} + </table> + <input type="submit" name="Submit" /> + </form> + </div> <div class="flex-greybox320"> <h1><a href="{% url 'commentaries:commentaries' %}">Commentaries</a></h1> <p>SciPost Commentaries allow Contributors to comment and build on all existing literature.</p> diff --git a/scipost/urls.py b/scipost/urls.py index 9e7d788b361d602d8d4da0f3503902b66208c6d0..1ff41c0d1745ab98426f1a8466dfb65cdfff4da1 100644 --- a/scipost/urls.py +++ b/scipost/urls.py @@ -1,38 +1,40 @@ from django.conf.urls import include, patterns, url +from django.views.generic import TemplateView from . import views urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^base$', views.base, name='base'), - # Info - url(r'^about$', views.about, name='about'), - url(r'^FAQ$', views.FAQ, name='FAQ'), - url(r'^description$', views.description, name='description'), - url(r'^peer_witnessed_refereeing$', views.peer_witnessed_refereeing, name='peer_witnessed_refereeing'), + + ## Info + url(r'^about$', TemplateView.as_view(template_name='scipost/about.html'), name='about'), + url(r'^FAQ$', TemplateView.as_view(template_name='scipost/FAQ.html'), name='FAQ'), + #url(r'^description$', views.description, name='description'), + url(r'^peer_witnessed_refereeing$', TemplateView.as_view(template_name='scipost/peer_witnessed_refereeing.html'), name='peer_witnessed_refereeing'), + ################ # Contributors: ################ + ## Registration url(r'^register$', views.register, name='register'), - url(r'^thanks_for_registering$', views.thanks_for_registering, name='thanks for registering'), + url(r'^thanks_for_registering$', TemplateView.as_view(template_name='scipost/thanks_for_registering.html'), name='thanks for registering'), url(r'^activation/(?P<key>.+)$', views.activation, name='activation'), - url(r'^activation_ack$', views.activation_ack, name='activation_ack'), + url(r'^activation_ack$', TemplateView.as_view(template_name='scipost/activation_ack.html'), 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'^request_new_activation_link_ack$', TemplateView.as_view(template_name='scipost/request_new_activation_link_ack.html'), name='request_new_activation_link_ack'), + url(r'^already_activated$', TemplateView.as_view(template_name='scipost/already_activated.html'), 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'), url(r'^personal_page$', views.personal_page, name='personal_page'), url(r'^change_password$', views.change_password, name='change_password'), - #url(r'^change_password_ack$', views.change_password_ack, name='change_password_ack'), url(r'^reset_password_confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', views.reset_password_confirm, name='reset_password_confirm'), url(r'^reset_password/$', views.reset_password, name='reset_password'), url(r'^update_personal_data$', views.update_personal_data, name='update_personal_data'), - url(r'^update_personal_data_ack$', views.update_personal_data_ack, name='update_personal_data_ack'), + url(r'^update_personal_data_ack$', TemplateView.as_view(template_name='scipost/update_personal_data_ack.html'), name='update_personal_data_ack'), ] diff --git a/scipost/views.py b/scipost/views.py index 864d604d7bd4e76a545201ffd82baddceba6c9ad..cb0fd53d6292b8d73a725c6a3e8962d29e6b8f04 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -26,6 +26,7 @@ from commentaries.models import Commentary from commentaries.forms import CommentarySearchForm from comments.models import Comment, AuthorReply from submissions.models import Submission, Report +from submissions.forms import SubmissionSearchForm from theses.models import ThesisLink from theses.forms import ThesisLinkSearchForm @@ -35,9 +36,10 @@ from theses.forms import ThesisLinkSearchForm ############# def index(request): + submission_search_form = SubmissionSearchForm(request.POST) commentary_search_form = CommentarySearchForm(request.POST) thesislink_search_form = ThesisLinkSearchForm(request.POST) - context = {'commentary_search_form': commentary_search_form, 'thesislink_search_form': thesislink_search_form} + context = {'submission_search_form': submission_search_form, 'commentary_search_form': commentary_search_form, 'thesislink_search_form': thesislink_search_form} return render(request, 'scipost/index.html', context) ############### @@ -47,29 +49,16 @@ def index(request): def base(request): return render(request, 'scipost/base.html') -def about(request): - return render(request, 'scipost/about.html') - -def FAQ(request): - return render(request, 'scipost/FAQ.html') - def description(request): response = HttpResponse(content_type='application/pdf') response['Content-Disposition'] = 'filename="SciPost_Description.pdf"' return response -def peer_witnessed_refereeing(request): - return render(request, 'scipost/peer_witnessed_refereeing.html') - ################ # Contributors: ################ -title_dict = dict(TITLE_CHOICES) -reg_ref_dict = dict(REGISTRATION_REFUSAL_CHOICES) - - def register(request): if request.user.is_authenticated(): return HttpResponseRedirect('personal_page') @@ -92,9 +81,6 @@ def register(request): return render(request, 'scipost/register.html', {'form': form, 'errormessage': errormessage}) -def thanks_for_registering(request): - return render(request, 'scipost/thanks_for_registering.html') - def activation(request, key): activation_expired = False @@ -117,9 +103,6 @@ def activation(request, key): return render(request, 'scipost/index.html') -def activation_ack(request): - return render(request, 'scipost/activation_ack.html') - def request_new_activation_link(request, oldkey): contributor = get_object_or_404(Contributor, activation_key=oldkey) @@ -140,13 +123,6 @@ def request_new_activation_link(request, oldkey): return render (request, 'scipost/request_new_activation_link_ack.html') -def request_new_activation_link_ack(request): - return render (request, 'scipost/request_new_activation_link_ack.html') - - -def already_activated(request): - return render (request, 'scipost/already_activated.html') - def vet_registration_requests(request): contributor = Contributor.objects.get(user=request.user) @@ -301,6 +277,3 @@ def update_personal_data(request): return render(request, 'scipost/login.html', {'form': form}) -def update_personal_data_ack(request): - return render (request, 'scipost/update_personal_data_ack.html') - diff --git a/submissions/templates/submissions/submissions.html b/submissions/templates/submissions/submissions.html index 4f5618edff8b7491b6955adad7cf1e5b50f73489..ada3844a4a2994cadd2a716497b98d986b32c707 100644 --- a/submissions/templates/submissions/submissions.html +++ b/submissions/templates/submissions/submissions.html @@ -8,7 +8,7 @@ {% if user.is_authenticated %} <section> - <p id="journalsannounce">OPEN FOR SUBMISSION STARTING 30 APRIL 2016</p> + <p id="journalsannounce">OPEN FOR SUBMISSION STARTING 5 MAY 2016</p> <br/> <div class="flex-container"> <div class="flex-greybox320">