diff --git a/commentaries/views.py b/commentaries/views.py index 40813c7365fb4990e45c627fa67869fa08fa9e00..6163a6628844aafd57ec707edbe9703de8668555 100644 --- a/commentaries/views.py +++ b/commentaries/views.py @@ -3,7 +3,6 @@ from django.utils import timezone from django.shortcuts import get_object_or_404, render from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User -#from django.core.mail import send_mail from django.core.mail import EmailMessage from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect @@ -31,7 +30,6 @@ def howto(request): def request_commentary(request): # commentary pages can only be requested by registered contributors: if request.user.is_authenticated(): - # If POST, process the form data if request.method == 'POST': form = RequestCommentaryForm(request.POST) if form.is_valid(): @@ -67,7 +65,6 @@ 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 - #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) @@ -104,7 +101,6 @@ def vet_commentary_request_ack(request, commentary_id): emailmessage.send(fail_silently=False) commentary.delete() -# context = {'option': form.cleaned_data['action_option'], 'reason': form.cleaned_data['refusal_reason'] } context = {'commentary_id': commentary_id } return render(request, 'commentaries/vet_commentary_request_ack.html', context) @@ -151,8 +147,6 @@ def browse(request, discipline, nrweeksback): form = CommentarySearchForm() commentary_browse_list = Commentary.objects.filter(vetted=True, discipline=discipline, latest_activity__gte=timezone.now() + datetime.timedelta(weeks=-int(nrweeksback))) context = {'form': form, 'discipline': discipline, 'nrweeksback': nrweeksback, 'commentary_browse_list': commentary_browse_list } - #return render(request, 'commentaries/browse.html', context) - #return HttpResponseRedirect(request, 'commentaries/commentaries.html', context) return render(request, 'commentaries/commentaries.html', context) diff --git a/journals/views.py b/journals/views.py index d7a9379f4733ac0581524d96003e8d14206865da..008a9398c54c5362fa353da68adadc79b9655c63 100644 --- a/journals/views.py +++ b/journals/views.py @@ -12,8 +12,6 @@ from django.db.models import Avg from .models import * from .forms import * -#from journals.forms import * -#from journals.models import * ############ # Journals diff --git a/ratings/views.py b/ratings/views.py index b157de83638a22081d85fa6b799b3de9f23d6a2e..a96abd7a8d4a74edfadcab9ca8cca89d68fc2e32 100644 --- a/ratings/views.py +++ b/ratings/views.py @@ -45,7 +45,6 @@ def vote_on_commentary(request, commentary_id): commentary.originality_rating = CommentaryRating.objects.filter(commentary=commentary, originality__lte=100).aggregate(avg_originality=Avg('originality'))['avg_originality'] commentary.significance_rating = CommentaryRating.objects.filter(commentary=commentary, significance__lte=100).aggregate(avg_significance=Avg('significance'))['avg_significance'] commentary.save() - #return HttpResponseRedirect(reverse('ratings:vote_on_commentary_ack')) context = {'commentary_id': commentary_id} return render(request, 'ratings/vote_on_commentary_ack.html', context) @@ -148,7 +147,6 @@ def vote_on_comment(request, comment_id): def vote_on_comment_ack(request): -# context = {'commentary_id': request.session['commentary_id']} context = {} return render(request, 'ratings/vote_on_comment_ack.html', context) @@ -335,7 +333,6 @@ def vote_on_report(request, report_id): return render(request, 'ratings/vote_on_report_ack.html') def vote_on_report_ack(request): -# context = {'commentary_id': request.session['commentary_id']} context = {} return render(request, 'ratings/vote_on_report_ack.html', context) @@ -348,7 +345,6 @@ def vote_on_submission(request, submission_id): if request.method == 'POST': form = SubmissionRatingForm(request.POST) if form.is_valid(): -# if rater.id != report.author.id: # Any previous rating from this contributor for this report is deleted: SubmissionRating.objects.filter(rater=rater, submission=submission).delete() newrating = SubmissionRating ( @@ -376,7 +372,6 @@ def vote_on_submission(request, submission_id): submission.originality_rating = SubmissionRating.objects.filter(submission=submission, originality__lte=100).aggregate(avg_originality=Avg('originality'))['avg_originality'] submission.significance_rating = SubmissionRating.objects.filter(submission=submission, significance__lte=100).aggregate(avg_significance=Avg('significance'))['avg_significance'] submission.save() - #return HttpResponseRedirect(reverse('ratings:vote_on_submission_ack')) context = {'submission_id': submission_id} return render(request, 'ratings/vote_on_submission_ack.html', context) diff --git a/scipost/static/scipost/info/SciPost_Description.pdf b/scipost/static/scipost/info/SciPost_Description.pdf index 4cb713cabf03ec9396f11fd0193ac7c2d99ced99..9a98da6e2c1c11884a209d88b231ffef7a8833db 100644 Binary files a/scipost/static/scipost/info/SciPost_Description.pdf and b/scipost/static/scipost/info/SciPost_Description.pdf differ diff --git a/scipost/views.py b/scipost/views.py index 040ce8fc4d18ce8c655e8622e50c2ff51d3b476b..864d604d7bd4e76a545201ffd82baddceba6c9ad 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -69,63 +69,6 @@ def peer_witnessed_refereeing(request): title_dict = dict(TITLE_CHOICES) reg_ref_dict = dict(REGISTRATION_REFUSAL_CHOICES) -def register_old(request): - if request.user.is_authenticated(): - return HttpResponseRedirect('personal_page') - # If POST, process the form data - if request.method == 'POST': - # create a form instance and populate it with the form data - form = RegistrationForm(request.POST) - # check whether it's valid - if form.is_valid(): - # check for mismatching passwords - if form.cleaned_data['password'] != form.cleaned_data['password_verif']: - return render(request, 'scipost/register.html', {'form': form, 'errormessage': 'Your passwords must match'}) - # check for already-existing username - if User.objects.filter(username=form.cleaned_data['username']).exists(): - return render(request, 'scipost/register.html', {'form': form, 'errormessage': 'This username is already in use'}) - # create the user - user = User.objects.create_user ( - first_name = form.cleaned_data['first_name'], - last_name = form.cleaned_data['last_name'], - email = form.cleaned_data['email'], - username = form.cleaned_data['username'], - password = form.cleaned_data['password'] - ) - # Set to inactive until activation via email link - user.is_active = False - user.save() - contributor = Contributor ( - user=user, - title = form.cleaned_data['title'], - orcid_id = form.cleaned_data['orcid_id'], - #nationality = form.cleaned_data['nationality'], - country_of_employment = form.cleaned_data['country_of_employment'], - address = form.cleaned_data['address'], - affiliation = form.cleaned_data['affiliation'], - personalwebpage = form.cleaned_data['personalwebpage'], - ) - contributor.save() - # Generate email activation key and link - salt = "" - for i in range(5): - salt = salt + random.choice(string.ascii_letters) - salt = salt.encode('utf8') - usernamesalt = contributor.user.username - usernamesalt = usernamesalt.encode('utf8') - contributor.activation_key = hashlib.sha1(salt+usernamesalt).hexdigest() - contributor.key_expires = datetime.datetime.strftime(datetime.datetime.now() + datetime.timedelta(days=2), "%Y-%m-%d %H:%M:%S") - contributor.save() - email_text = 'Dear ' + title_dict[contributor.title] + ' ' + contributor.user.last_name + ', \n\nYour request for registration to the SciPost publication portal has been received. You now need to validate your email by visiting this link within the next 48 hours: \n\n' + 'https://scipost.org/activation/' + contributor.activation_key + '\n\nYour registration will thereafter be vetted. Many thanks for your interest. \n\nThe SciPost Team.' - emailmessage = EmailMessage('SciPost registration request received', email_text, 'registration@scipost.org', [contributor.user.email, 'registration@scipost.org'], reply_to=['registration@scipost.org']) - emailmessage.send(fail_silently=False) - return HttpResponseRedirect('thanks_for_registering') - # if GET or other method, create a blank form - else: - form = RegistrationForm() - - errormessage = '' - return render(request, 'scipost/register.html', {'form': form, 'errormessage': errormessage}) def register(request): if request.user.is_authenticated(): diff --git a/static/scipost/SciPost.css b/static/scipost/SciPost.css index 07e346186466259d11ff1275c10f80ba63dc3e78..f329eb2b969fccedc2343d4118ab395668a4b83c 100644 --- a/static/scipost/SciPost.css +++ b/static/scipost/SciPost.css @@ -187,7 +187,10 @@ hr.hr12 { margin: 10px; padding: 10px; } - +.flex-whitebox0 { + margin: 0px; + padding: 0px; +} body { /* font-family: Merriweather, sans-serif; */ @@ -323,6 +326,7 @@ section { } section a { color: #103050; + color: #6884C2; text-decoration: none; target: _parent; } diff --git a/static/scipost/info/SciPost_Description.pdf b/static/scipost/info/SciPost_Description.pdf index 4cb713cabf03ec9396f11fd0193ac7c2d99ced99..9a98da6e2c1c11884a209d88b231ffef7a8833db 100644 Binary files a/static/scipost/info/SciPost_Description.pdf and b/static/scipost/info/SciPost_Description.pdf differ diff --git a/submissions/views.py b/submissions/views.py index 4fa74952dadd31820b2007c8934332e54cdb2d58..bb0a0d274f9d571b3738494307324af56f041f7f 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -30,7 +30,6 @@ def sub_and_ref_procedure(request): def submit_manuscript(request): - # If POST, process the form data if request.method == 'POST': form = SubmissionForm(request.POST) if form.is_valid(): @@ -61,15 +60,9 @@ 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 - #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): @@ -213,8 +206,6 @@ def submit_report(request, submission_id): def submit_report_ack(request): -# submission_id = request.session['submission_id'] -# context = {'submission': Submission.objects.get(pk=submission_id) } context = {} return render(request, 'submissions/submit_report_ack.html', context) @@ -222,15 +213,9 @@ 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 - #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): diff --git a/theses/views.py b/theses/views.py index d397422c183882b0f4afa6756ffe393ba0f380ea..5cdbb70f591d6b96401117a88d492b97f681b211 100644 --- a/theses/views.py +++ b/theses/views.py @@ -3,7 +3,6 @@ from django.utils import timezone from django.shortcuts import get_object_or_404, render from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User -#from django.core.mail import send_mail from django.core.mail import EmailMessage from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseRedirect