diff --git a/journals/api.py b/journals/api.py index 88a91a4c5d8191d98226d5d8dfba6136f5f4bbd4..d90bee3c499835038763a80b9193102736d86736 100644 --- a/journals/api.py +++ b/journals/api.py @@ -8,7 +8,5 @@ class PublicationList(ListAPIView): """ List all publications that are published. """ - # def get_queryset(self, request, format=None): queryset = Publication.objects.published() serializer_class = PublicationSerializer - # return Response(serializer.data) diff --git a/journals/templates/journals/_publication_single_short_summary.html b/journals/templates/journals/_publication_single_short_summary.html index cce9e6bb3e29bb9791b05f10e01810bd247b2800..7ca8c2165167f03f4664ae6631e2b138643922cc 100644 --- a/journals/templates/journals/_publication_single_short_summary.html +++ b/journals/templates/journals/_publication_single_short_summary.html @@ -1,3 +1,3 @@ <h3 class="pb-0"><a href="{{publication.get_absolute_url}}">{{ publication.title }}</a></h3> +<div class="text-muted mb-1"><span class="d-inline-block">published {{ publication.publication_date }}</span> <span class="d-inline-block">as {{ publication.doi_string }}</span></div> <div>by {{ publication.author_list|truncatechars:30 }}</div> -<div class="text-muted">published {{ publication.publication_date }}</div> diff --git a/news/templates/news/news_card_content.html b/news/templates/news/news_card_content.html index c308bb5f3e63d65cc2ea00f99fe18a66aa49f4aa..c034d9e95700453c0e1f6b47e330bf0541ba2b1a 100644 --- a/news/templates/news/news_card_content.html +++ b/news/templates/news/news_card_content.html @@ -1,11 +1,11 @@ -<div class="card-header p-2 border-0"> +<div class="card-block px-0 pt-1 news-item"> <h3 class="card-title mb-0">{{news.headline}}</h3> -</div> -<div class="card-block px-2 pt-1"> - <h4 class="text-muted font-weight-bold">{{news.date|date:'Y-n-j'}}</h4> - <div>{{news.blurb|linebreaks}}</div> + <div class="px-1 mt-1"> + <h4 class="text-muted font-weight-bold">{{news.date|date:'Y-n-j'}}</h4> + <div>{{news.blurb|linebreaks}}</div> - {% if news.followup_link %} - <a href="{{news.followup_link}}">{{news.followup_link_text}}</a> - {% endif %} + {% if news.followup_link %} + <a href="{{news.followup_link}}">{{news.followup_link_text}}</a> + {% endif %} + </div> </div> diff --git a/scipost/static/scipost/about.js b/scipost/static/scipost/about.js index 748aaa14a672c770beaba534a7f9d1306956bd8c..fb7e771813f7dec0608ee8e38ac504302061530b 100644 --- a/scipost/static/scipost/about.js +++ b/scipost/static/scipost/about.js @@ -5,6 +5,9 @@ $(function() { var el = $($(this).attr('data-target')); el.toggle(); + // Switch texts of link + $('[href="' + $(this).attr('href') + '"]').toggle(); + // Reset active search after closing the box if(!el.is(':visible')) { $('.all-specializations .specialization') @@ -33,7 +36,7 @@ $(function() { .on('search-specialization', function() { // Reset: searching multiple specializations is not supported $('.search-contributors.active-search').removeClass('active-search'); - $('.contributor-col.active').removeClass('active'); + $('.contributor.active').removeClass('active'); $('.specialization.active-search').not(this).removeClass('active-search'); var el = $(this); @@ -44,7 +47,7 @@ $(function() { // Add class to specialized Contributors var code = el.attr('data-specialization'); $('.single[data-specialization="' + code + '"]') - .parents('.contributor-col') + .parents('.contributor') .addClass('active'); } }); diff --git a/scipost/static/scipost/assets/css/_about.scss b/scipost/static/scipost/assets/css/_about.scss index c7c0b58d2f159bb6de4ea6e180f7aaf6a8598f86..0ed307a0191279d4e1ddaecb3551976a3cac4d0a 100644 --- a/scipost/static/scipost/assets/css/_about.scss +++ b/scipost/static/scipost/assets/css/_about.scss @@ -1,18 +1,18 @@ -.search-contributors.active-search .contributor-col { +.search-contributors.active-search .contributor { display: none; &.active { - display: block; + display: inline-block; } } .contributor { - margin: 0.25rem 0; - padding: 0.05rem 0.75rem; - border-radius: 0.15rem; -webkit-transition: all 0.05s ease-in-out; -o-transition: all 0.05s ease-in-out; transition: all 0.05s ease-in-out; + padding-left: 0.5rem; + padding-right: 0.5rem; + border: 0; &.hover-active { background-color: rgba(104, 132, 194, 0.3); diff --git a/scipost/static/scipost/assets/css/_cards.scss b/scipost/static/scipost/assets/css/_cards.scss index ad4e4c7d5a163a758cd4f4afaa2a735d06c68841..a276ee0cce180697b019963054b6cbea7eb81002 100644 --- a/scipost/static/scipost/assets/css/_cards.scss +++ b/scipost/static/scipost/assets/css/_cards.scss @@ -30,10 +30,12 @@ line-height: 1.5; } -.card.card-news { - .card-header { +.card-news { + .news-item .card-title { background-color: $scipost-darkblue; color: $scipost-light; + padding: 0.5rem; + border-radius: 1.4px; } } diff --git a/scipost/templates/scipost/about.html b/scipost/templates/scipost/about.html index 571472fe490597b51b43111d6cade59d99c3c4fc..0e033b30f9eb394b6e905252cf07512e6f8bc852 100644 --- a/scipost/templates/scipost/about.html +++ b/scipost/templates/scipost/about.html @@ -159,11 +159,12 @@ {% if codes %} <div class="row"> <div class="col-12"> - <a href="#editorial_college_{{ college|lower }}" class="d-block mb-1" data-toggle="toggle-show" data-target="#specializations-{{college|lower}}">Show Fellows by specialization</a> - <div id="specializations-{{college|lower}}" class="all-specializations" style="border: 1px solid; display: none;"> + <a href="#editorial_college_{{ college|lower }}" data-toggle="toggle-show" data-target="#specializations-{{college|lower}}">Show Fellows by specialization</a> + <a href="#editorial_college_{{ college|lower }}" style="display: none;" data-toggle="toggle-show" data-target="#specializations-{{college|lower}}">Show full list of Fellows</a> + <div id="specializations-{{college|lower}}" class="all-specializations mt-2" style="border: 1px solid; display: none;"> <div class="row"> <div class="col-12"> - <p class="text-muted">Hover to highlight, click to select</p> + <p class="text-muted">Hover to highlight or click to select</p> </div> <div class="col-md-6"> {% with total_count=codes|length %} @@ -183,20 +184,14 @@ {% endif %} <div class="row search-contributors" data-contributors="{{ college|lower }}"> - <div class="col-md-4"> - {% with total_count=college.current_fellows|length %} + <div class="col-12"> + <div class="card-columns"> {% for fellowship in college.current_fellows %} - <div class="col-12 contributor-col"> - <div class="contributor"> - {% include 'scipost/_contributor_short.html' with contributor=fellowship.contributor %} - </div> + <div class="card contributor"> + {% include 'scipost/_contributor_short.html' with contributor=fellowship.contributor %} </div> - {% if forloop.counter|is_modulo_one_third:total_count %} - </div> - <div class="col-md-4"> - {% endif %} {% endfor %} - {% endwith %} + </div> </div> </div> diff --git a/scipost/templates/scipost/index.html b/scipost/templates/scipost/index.html index 1c43a0a99ad538b5a1eadced63d2c39974155a03..696aff8f4f84a389bb1032b836ccb30793721c4c 100644 --- a/scipost/templates/scipost/index.html +++ b/scipost/templates/scipost/index.html @@ -5,129 +5,162 @@ {% block content %} <div class="row"> - {% if latest_newsitems %} - <div class="col-md-6 {% if user.is_authenticated %}col-lg-4{% else %}col-lg-3{% endif %}"> - <div class="card card-grey"> - <div class="card-block"> - <h1 class="card-title mb-0"><a href="{% url 'news:news' %}">News</a><a style="float: right;" href="{% url 'scipost:feeds' %}"><img src="{% static 'scipost/images/feed-icon-14x14.png' %}" alt="Feed logo" width="14"></a></h1> - <h4 class="card-subtitle mb-0 pb-0 text-muted">Latest news and announcements.</h4> - </div> - {% for item in latest_newsitems %} - <div class="card card-news bg-transparent m-2"> - {% include 'news/news_card_content.html' with news=item %} + <div class="col-12"> + <div class="card-deck mb-2"> + <!-- News --> + <div class="card card-grey card-news"> + <div class="card-block"> + <h1 class="card-title mb-0"><a href="{% url 'news:news' %}">News</a><a style="float: right;" href="{% url 'scipost:feeds' %}"><img src="{% static 'scipost/images/feed-icon-14x14.png' %}" alt="Feed logo" width="14"></a></h1> + <h4 class="card-subtitle mb-0 pb-0 text-muted">Latest news and announcements.</h4> + <ul class="list-group list-group-flush"> + {% for item in latest_newsitems %} + <li class="list-group-item"> + {% include 'news/news_card_content.html' with news=item %} + </li> + {% empty %} + <li class="list-group-item"> + No current newsitems found. + </li> + {% endfor %} + <ul> </div> - {% endfor %} - </div> - </div> - {% endif %} - - <div class="col-md-6 {% if user.is_authenticated %}col-lg-4{% else %}col-lg-3{% endif %}"> - <div class="card card-grey"> - <div class="card-block"> - <h1 class="card-title mb-0"><a href="{% url 'scipost:about' %}">About SciPost</a></h1> - <h4 class="card-subtitle mb-2 text-muted">SciPost is a complete scientific publication portal managed by active professional scientists.</h4> - <p>It is purely online-based and offers openly, globally and perpetually accessible science.</p> - <h3><a href="{% url 'scipost:about' %}#advisory_board">Advisory Board</a></h3> - <h3><a href="{% url 'scipost:call' %}">A call for openness</a></h3> - <h3><a href="{% url 'scipost:quick_tour' %}">Quick Tour</a></h3> - <h3><a href="{% url 'scipost:FAQ' %}">Frequently asked questions</a></h3> - <h3><a href="{% url 'scipost:about' %}">Read more</a></h3> - <h4><em>In the press:</em></h4> - <ul> - <li><a href="{% static 'scipost/press/SciPost_in_FOM_expres_mei_2016.pdf' %}">FOM expres 5/2016</a> (<a href="{% static 'scipost/press/SciPost_in_FOM_expres_mei_2016_eng.pdf' %}">English vn</a>)</li> - <li><a href="http://www.uva.nl/en/news-events/news/uva-news/content/news/2016/10/open-access-platform-scipost-launches-inaugural-edition-of-first-journal.html">Inaugural issue 10/2016</a></li> - </ul> - </div> - </div> - </div> + </div><!-- End news --> - {% if not user.is_authenticated %} - <div class="col-md-6 col-lg-3"> - <div class="card card-grey"> - <div class="card-block"> - <h1 class="card-title mb-0"><a href="{% url 'scipost:register' %}">Register</a></h1> - <p>Professional scientists (PhD students and above) can become Contributors to SciPost by filling the - <a href="{% url 'scipost:register' %}">registration form</a>.</p> - <h4>Registered contributors can among others:</h4> - <ul> - <li>Submit manuscripts to SciPost Journals</li> - <li>Post reports and comments</li> - <li>Express opinions on contributions</li> - <li>Subscribe to feeds</li> - <li>Use productivity tools</li> - </ul> - </div> - </div> - </div> - {% endif %} - - <div class="col-md-6 {% if user.is_authenticated %}col-lg-4{% else %}col-lg-3{% endif %}"> - <div class="card card-grey"> - <div class="card-block"> - <h1 class="card-title"><a href="{% url 'journals:journals' %}">Latest Publications</a></h1> - <h2 class="banner"> - <a href="{% url 'scipost:landing_page' 'SciPostPhys' %}">SciPost Physics</a> - </h2> - {% if issue and publications %} - <h4 class="card-text text-center mt-2">A selection from the {% if issue.is_current %}current{% else %}last{% endif %} issue:</h4> - {% if issue %} - <div class="text-muted text-center mt-2">Vol. {{ issue.in_volume.number }} issue {{ issue.number }} {{issue.period_as_string}}</div> - {% endif %} - </div> - <div class="card-block"> + + + {% if not user.is_authenticated %} + <!-- Register --> + <div class="card card-grey"> + <div class="card-block"> + <h1 class="card-title mb-0"><a href="{% url 'scipost:register' %}">Register</a></h1> + <p>Professional scientists (PhD students and above) can become Contributors to SciPost by filling the + <a href="{% url 'scipost:register' %}">registration form</a>.</p> + <h4>Registered contributors can among others:</h4> + <ul> + <li>Submit manuscripts to SciPost Journals</li> + <li>Post reports and comments</li> + <li>Express opinions on contributions</li> + <li>Subscribe to feeds</li> + <li>Use productivity tools</li> + </ul> + </div> + </div><!-- End register --> + {% else %} + <!-- About --> + <div class="card card-grey"> + <div class="card-block"> + <h1 class="card-title mb-0"><a href="{% url 'scipost:about' %}">About SciPost</a></h1> + <h4 class="card-subtitle mb-2 text-muted">SciPost is a complete scientific publication portal managed by active professional scientists.</h4> + <p>It is purely online-based and offers openly, globally and perpetually accessible science.</p> + <h3><a href="{% url 'scipost:about' %}#advisory_board">Advisory Board</a></h3> + <h3><a href="{% url 'scipost:call' %}">A call for openness</a></h3> + <h3><a href="{% url 'scipost:quick_tour' %}">Quick Tour</a></h3> + <h3><a href="{% url 'scipost:FAQ' %}">Frequently asked questions</a></h3> + <h3><a href="{% url 'scipost:about' %}">Read more</a></h3> + <h4><em>In the press:</em></h4> + <ul> + <li><a href="{% static 'scipost/press/SciPost_in_FOM_expres_mei_2016.pdf' %}">FOM expres 5/2016</a> (<a href="{% static 'scipost/press/SciPost_in_FOM_expres_mei_2016_eng.pdf' %}">English vn</a>)</li> + <li><a href="http://www.uva.nl/en/news-events/news/uva-news/content/news/2016/10/open-access-platform-scipost-launches-inaugural-edition-of-first-journal.html">Inaugural issue 10/2016</a></li> + </ul> + </div> + </div><!-- End about --> + {% endif %} + + <!-- Latest submissions --> + <div class="card card-grey"> + <div class="card-block"> + <h1 class="card-title mb-0"><a href="{% url 'journals:journals' %}">Latest Submissions</a></h1> + <h4 class="card-subtitle text-muted">A selection of the last submissions</h4> + <ul class="list-group list-group-flush"> + {% for submission in submissions %} + <li class="list-group-item"> + {% include 'submissions/_submission_card_content_sparse.html' with submission=submission %} + </li> + {% endfor %} + </ul> + </div> + </div><!-- End latest submissions --> + + <!-- Latest publications --> + <div class="card card-grey"> + <div class="card-block"> + <h1 class="card-title mb-0"><a href="{% url 'journals:journals' %}">Latest Publications</a></h1> + <h4 class="card-subtitle text-muted">A selection of the last publications</h4> <ul class="list-group list-group-flush"> {% for publication in publications %} <li class="list-group-item"> - <div class="card-block"> + <div class="card-block px-0"> {% include 'journals/_publication_single_short_summary.html' with publication=publication %} </div> </li> {% endfor %} </ul> - {% endif %} <p class="text-center mt-3" style="color: red;"><em>If you support and believe in our mission, <br/>be a pioneer and submit a manuscript!</em></p> - </div> - </div> - </div> - </div> + </div> + </div><!-- End latest publications --> + </div><!-- End deck --> - <div class="row"> - <div class="col-md-6 {% if user.is_authenticated %}col-lg-4{% else %}col-lg-3{% endif %}"> - <div class="card card-grey"> - <div class="card-block"> - <h1 class="card-title"><a href="{% url 'journals:journals' %}">Journals</a></h1> - <h4 class="card-subtitle m text-muted">SciPost publishes a portfolio of high-quality two-way open access scientific journals.</h4> - <p>All SciPost Journals implement the stringent <a href="/FAQ#pwr">peer-witnessed refereeing</a> principle.</p> - <p>All Journals are fully managed by professional scientists.</p> - <h3><a href="{% url 'scipost:about' %}#editorial_college_physics">Editorial College (Physics)</a></h3> - <h3><a href="{% url 'submissions:sub_and_ref_procedure' %}">Submission and refereeing procedure</a></h3> - - <br/> - - <p>View and comment on (login required) recent <a href="{% url 'submissions:submissions' %}">Submissions</a></p> - </div> - </div> - </div> - <div class="col-md-6 {% if user.is_authenticated %}col-lg-4{% else %}col-lg-3{% endif %}"> - <div class="card card-grey"> - <div class="card-block"> - <h1 class="card-title"><a href="{% url 'commentaries:commentaries' %}">Commentaries</a></h1> - <p>SciPost Commentaries allow Contributors to comment and build on all existing literature.</p> - <br/> - <h3><a href="{% url 'commentaries:howto' %}">SciPost Commentaries how-to</a></h3> - <h3><a href="{% url 'commentaries:request_commentary' %}">Request a new Commentary Page</a></h3> - </div> - </div> - </div> - <div class="col-md-6 {% if user.is_authenticated %}col-lg-4{% else %}col-lg-3{% endif %}"> - <div class="card card-grey"> - <div class="card-block"> - <h1 class="card-title"><a href="{% url 'theses:theses' %}">Theses</a></h1> - <p>SciPost Theses allow Contributors to find Master's, Ph.D. and Habilitation theses relevant to their work.</p> - <br/> - <h3><a href="{% url 'theses:request_thesislink' %}">Request a new Thesis Link</a></h3> - </div> - </div> + <div class="card-deck"> + + <!-- Journals --> + <div class="card card-grey"> + <div class="card-block"> + <h1 class="card-title"><a href="{% url 'journals:journals' %}">Journals</a></h1> + <h4 class="card-subtitle m text-muted">SciPost publishes a portfolio of high-quality two-way open access scientific journals.</h4> + <p>All SciPost Journals implement the stringent <a href="/FAQ#pwr">peer-witnessed refereeing</a> principle.</p> + <p>All Journals are fully managed by professional scientists.</p> + <h3><a href="{% url 'scipost:about' %}#editorial_college_physics">Editorial College (Physics)</a></h3> + <h3><a href="{% url 'submissions:sub_and_ref_procedure' %}">Submission and refereeing procedure</a></h3> + + <br/> + + <p>View and comment on (login required) recent <a href="{% url 'submissions:submissions' %}">Submissions</a></p> + </div> + </div><!-- End journals --> + + + <div class="card card-grey"> + <div class="card-block"> + <h1 class="card-title"><a href="{% url 'commentaries:commentaries' %}">Commentaries</a></h1> + <p>SciPost Commentaries allow Contributors to comment and build on all existing literature.</p> + <br/> + <h3><a href="{% url 'commentaries:howto' %}">SciPost Commentaries how-to</a></h3> + <h3><a href="{% url 'commentaries:request_commentary' %}">Request a new Commentary Page</a></h3> + </div> + </div><!-- End commentaries --> + + <!-- Theses --> + <div class="card card-grey"> + <div class="card-block"> + <h1 class="card-title"><a href="{% url 'theses:theses' %}">Theses</a></h1> + <p>SciPost Theses allow Contributors to find Master's, Ph.D. and Habilitation theses relevant to their work.</p> + <br/> + <h3><a href="{% url 'theses:request_thesislink' %}">Request a new Thesis Link</a></h3> + </div> + </div><!-- End theses --> + + {% if not user.is_authenticated %} + <!-- About --> + <div class="card card-grey"> + <div class="card-block"> + <h1 class="card-title mb-0"><a href="{% url 'scipost:about' %}">About SciPost</a></h1> + <h4 class="card-subtitle mb-2 text-muted">SciPost is a complete scientific publication portal managed by active professional scientists.</h4> + <p>It is purely online-based and offers openly, globally and perpetually accessible science.</p> + <h3><a href="{% url 'scipost:about' %}#advisory_board">Advisory Board</a></h3> + <h3><a href="{% url 'scipost:call' %}">A call for openness</a></h3> + <h3><a href="{% url 'scipost:quick_tour' %}">Quick Tour</a></h3> + <h3><a href="{% url 'scipost:FAQ' %}">Frequently asked questions</a></h3> + <h3><a href="{% url 'scipost:about' %}">Read more</a></h3> + <h4><em>In the press:</em></h4> + <ul> + <li><a href="{% static 'scipost/press/SciPost_in_FOM_expres_mei_2016.pdf' %}">FOM expres 5/2016</a> (<a href="{% static 'scipost/press/SciPost_in_FOM_expres_mei_2016_eng.pdf' %}">English vn</a>)</li> + <li><a href="http://www.uva.nl/en/news-events/news/uva-news/content/news/2016/10/open-access-platform-scipost-launches-inaugural-edition-of-first-journal.html">Inaugural issue 10/2016</a></li> + </ul> + </div> + </div><!-- End about --> + {% endif %} + + </div><!-- End deck --> </div> </div> diff --git a/scipost/templates/scipost/login.html b/scipost/templates/scipost/login.html index f52e1cc6a656030c50b797c16ff4ea3297aff19b..b7a3a64d5351fc4188fe78886cdfa02bab68a4ec 100644 --- a/scipost/templates/scipost/login.html +++ b/scipost/templates/scipost/login.html @@ -2,12 +2,13 @@ {% block pagetitle %}: login{% endblock pagetitle %} -{% block bodysup %} + {% load bootstrap %} -<div class="container"> - <div class="row my-4"> +{% block content %} + +<div class="row my-4"> <div class="col-md-6"> <h1 class="mb-md-2">Log in to SciPost</h1> <form action="{% url 'scipost:login' %}" method="post"> @@ -32,7 +33,6 @@ <a href="{% url 'scipost:register' %}">registration form</a>.</p> </div> - </div> </div> -{% endblock bodysup %} +{% endblock %} diff --git a/scipost/templates/scipost/logout.html b/scipost/templates/scipost/logout.html deleted file mode 100644 index 6a8fd267f1622e40001310a7c4c1b9e9937c2083..0000000000000000000000000000000000000000 --- a/scipost/templates/scipost/logout.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends 'scipost/base.html' %} - -{% block pagetitle %}: logged out{% endblock pagetitle %} - -{% block bodysup %} - -<section> - <h1>Your are now logged out of SciPost.</h1> - <p>Keep contributing!</p> -</section> - -{% endblock bodysup %} diff --git a/scipost/views.py b/scipost/views.py index 0e2fd0e176ed61e8a2ec1e840eb3e44724b726f1..7105455cd2df61bbf7e4afb0fd84033c9e0c7fc2 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -6,6 +6,7 @@ import string from django.utils import timezone from django.shortcuts import get_object_or_404, render +from django.contrib import messages from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import Group @@ -41,9 +42,8 @@ from .utils import Utils, EMAIL_FOOTER, SCIPOST_SUMMARY_FOOTER, SCIPOST_SUMMARY_ from commentaries.models import Commentary from comments.models import Comment -from journals.models import Publication, Issue +from journals.models import Publication from news.models import NewsItem -from submissions.constants import SUBMISSION_STATUS_PUBLICLY_UNLISTED from submissions.models import Submission, EditorialAssignment, RefereeInvitation,\ Report, EICRecommendation from theses.models import ThesisLink @@ -203,10 +203,8 @@ def index(request): """ Main page """ context = {} context['latest_newsitems'] = NewsItem.objects.all().order_by('-date')[:2] - context['issue'] = Issue.objects.get_last_filled_issue(in_volume__in_journal__name='SciPostPhys') - if context['issue']: - context['publications'] = context['issue'].publication_set.filter(doi_string__isnull=False - ).order_by('-publication_date')[:4] + context['submissions'] = Submission.objects.public().order_by('-submission_date')[:4] + context['publications'] = Publication.objects.published().order_by('-publication_date')[:4] return render(request, 'scipost/index.html', context) @@ -895,7 +893,8 @@ def login_view(request): def logout_view(request): logout(request) - return render(request, 'scipost/logout.html') + messages.success(request, '<h3>Keep contributing!</h3>You are now logged out of SciPost.') + return redirect(reverse('scipost:index')) def mark_unavailable_period(request): diff --git a/submissions/constants.py b/submissions/constants.py index 477c4e18352facc9e707b89fae3d999efbcf900e..470826b1915ea93b8e4450eeac044c29eebe7206 100644 --- a/submissions/constants.py +++ b/submissions/constants.py @@ -31,18 +31,6 @@ SUBMISSION_STATUS_OUT_OF_POOL = [ 'rejected_visible', ] -# Submissions which should not appear in search lists -SUBMISSION_STATUS_PUBLICLY_UNLISTED = [ - 'unassigned', - 'assignment_failed', - 'resubmitted', - 'resubmitted_rejected', - 'resubmitted_rejected_visible', - 'rejected', - 'published', - 'withdrawn', -] - # Submissions which should not be viewable (except by admins, Fellows and authors) SUBMISSION_STATUS_PUBLICLY_INVISIBLE = [ 'unassigned', @@ -52,6 +40,13 @@ SUBMISSION_STATUS_PUBLICLY_INVISIBLE = [ 'withdrawn', ] +# Submissions which should not appear in search lists +SUBMISSION_STATUS_PUBLICLY_UNLISTED = SUBMISSION_STATUS_PUBLICLY_INVISIBLE + [ + 'resubmitted', + 'resubmitted_rejected_visible', + 'published' +] + # Submissions for which voting on a related recommendation is deprecated: SUBMISSION_STATUS_VOTING_DEPRECATED = [ 'rejected', diff --git a/submissions/managers.py b/submissions/managers.py index c8654d6d84800a6ee9b16c5cdba84bd81361e4ca..007246ed5ca0a0e6fe23ab857c14839bdba93f76 100644 --- a/submissions/managers.py +++ b/submissions/managers.py @@ -1,7 +1,8 @@ from django.db import models from django.db.models import Q -from .constants import SUBMISSION_STATUS_OUT_OF_POOL, SUBMISSION_STATUS_PUBLICLY_UNLISTED +from .constants import SUBMISSION_STATUS_OUT_OF_POOL, SUBMISSION_STATUS_PUBLICLY_UNLISTED,\ + SUBMISSION_STATUS_PUBLICLY_INVISIBLE class SubmissionManager(models.Manager): @@ -14,7 +15,14 @@ class SubmissionManager(models.Manager): .order_by('-submission_date') def public(self): - return self.filter(is_current=True).exclude(status__in=SUBMISSION_STATUS_PUBLICLY_UNLISTED) + return self.exclude(status__in=SUBMISSION_STATUS_PUBLICLY_UNLISTED) + + def public_overcomplete(self): + """ + This query contains an overcomplete set of public submissions, i.e. also containing + submissions with status "published" or "resubmitted". + """ + return self.exclude(status__in=SUBMISSION_STATUS_PUBLICLY_INVISIBLE) class EditorialAssignmentManager(models.Manager): diff --git a/submissions/templates/submissions/_submission_card_base.html b/submissions/templates/submissions/_submission_card_base.html index 355d2f2e137b96c0c708c7b9b25def988627f611..c1c516251ddf66dce7924472050f3d45c4dc1582 100644 --- a/submissions/templates/submissions/_submission_card_base.html +++ b/submissions/templates/submissions/_submission_card_base.html @@ -1,5 +1,5 @@ -<div class="card-block"> - <h3 class="card-title"> +<div class="card-block {% block cardblock_class_block %}{% endblock %}"> + <h3 class="card-title {% block title_class_block %}{% endblock %}"> <a href="{% url 'submissions:submission' submission.arxiv_identifier_w_vn_nr %}">{{submission.title}}</a> </h3> diff --git a/submissions/templates/submissions/_submission_card_content.html b/submissions/templates/submissions/_submission_card_content.html index ed9d01a7aef68db99bbdce1b013860b2d2c1c1e9..e22ce33c7322cc4d396ab30040545bb570db0151 100644 --- a/submissions/templates/submissions/_submission_card_content.html +++ b/submissions/templates/submissions/_submission_card_content.html @@ -4,5 +4,10 @@ {{block.super}} <p class="card-text">by {{submission.author_list}}</p> <p class="card-text text-muted">Version {{submission.arxiv_vn_nr}} ({% if submission.is_current %}current version{% else %}deprecated version {{submission.arxiv_vn_nr}}{% endif %})</p> - <p class="card-text text-muted">Submitted {{submission.submission_date}} to {{submission.get_submitted_to_journal_display}} - latest activity: {{submission.latest_activity}}</p> + <p class="card-text text-muted"> + {% if submission.publication %} + Published as <a href="{{submission.publication.get_absolute_url}}">{{submission.publication.in_issue.in_volume.in_journal.get_abbreviation_citation}} <strong>{{submission.publication.in_issue.in_volume.number}}</strong>, {{submission.publication.get_paper_nr}} ({{submission.publication.publication_date|date:'Y'}})</a> + {% else %} + Submitted {{submission.submission_date}} to {{submission.get_submitted_to_journal_display}} + {% endif %} - latest activity: {{submission.latest_activity}}</p> {% endblock %} diff --git a/submissions/templates/submissions/_submission_card_content_sparse.html b/submissions/templates/submissions/_submission_card_content_sparse.html new file mode 100644 index 0000000000000000000000000000000000000000..906b925abf41d3c1e98390859516711c5f665232 --- /dev/null +++ b/submissions/templates/submissions/_submission_card_content_sparse.html @@ -0,0 +1,14 @@ +{% extends 'submissions/_submission_card_base.html' %} + +{% block cardblock_class_block %}px-0{% endblock %} +{% block title_class_block %}pb-0 mb-0{% endblock %} + +{% block card_block_footer %} + {{block.super}} + + <div class="text-muted mb-1"> + <span class="d-inline-block">Submitted {{submission.submission_date}}</span> + <span class="d-inline-block">to {{submission.get_submitted_to_journal_display}}</span> + </div> + <div>by {{submission.author_list}}</div> +{% endblock %} diff --git a/submissions/views.py b/submissions/views.py index 54f3c34fd51b956cf78a103060a65c98e4e8f6f7..122efa1b838e30918ef04e8d88aee96146eefab4 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -16,7 +16,7 @@ from guardian.decorators import permission_required_or_403 from guardian.mixins import PermissionRequiredMixin from guardian.shortcuts import assign_perm -from .constants import SUBMISSION_STATUS_PUBLICLY_UNLISTED, SUBMISSION_STATUS_VOTING_DEPRECATED,\ +from .constants import SUBMISSION_STATUS_VOTING_DEPRECATED,\ SUBMISSION_STATUS_PUBLICLY_INVISIBLE, SUBMISSION_STATUS, ED_COMM_CHOICES from .models import Submission, EICRecommendation, EditorialAssignment,\ RefereeInvitation, Report, EditorialCommunication @@ -208,7 +208,7 @@ class SubmissionListView(ListView): paginate_by = 10 def get_queryset(self): - queryset = Submission.objects.public() + queryset = Submission.objects.public_overcomplete().filter(is_current=True) if 'to_journal' in self.kwargs: queryset = queryset.filter( latest_activity__gte=timezone.now() + datetime.timedelta(days=-60), @@ -219,7 +219,8 @@ class SubmissionListView(ListView): nrweeksback = self.kwargs['nrweeksback'] queryset = queryset.filter( discipline=discipline, - latest_activity__gte=timezone.now() + datetime.timedelta(weeks=-int(nrweeksback))) + latest_activity__gte=timezone.now() + datetime.timedelta(weeks=-int(nrweeksback)) + ) elif 'Submit' in self.request.GET: queryset = queryset.filter( title__icontains=self.request.GET.get('title_keyword', ''), @@ -349,12 +350,11 @@ def pool(request): to=contributor, accepted=None, deprecated=False) consider_assignment_form = ConsiderAssignmentForm() recs_to_vote_on = (EICRecommendation.objects.get_for_user_in_pool(request.user) - .filter(eligible_to_vote__in=[contributor]) - .exclude(recommendation=-1) - .exclude(recommendation=-2) - .exclude(voted_for__in=[contributor]) - .exclude(voted_against__in=[contributor]) - .exclude(voted_abstain__in=[contributor]) + .filter(eligible_to_vote=contributor) + .exclude(recommendation__in=[-1, -2]) + .exclude(voted_for=contributor) + .exclude(voted_against=contributor) + .exclude(voted_abstain=contributor) .exclude(submission__status__in=SUBMISSION_STATUS_VOTING_DEPRECATED)) rec_vote_form = RecommendationVoteForm() remark_form = RemarkForm() @@ -514,15 +514,17 @@ def volunteer_as_EIC(request, arxiv_identifier_w_vn_nr): arxiv_identifier_w_vn_nr=arxiv_identifier_w_vn_nr) errormessage = None if submission.status == 'assignment_failed': - errormessage = 'This Submission has failed pre-screening and has been rejected.' - context = {'errormessage': errormessage} - return render(request, 'submissions/accept_or_decline_assignment_ack.html', context) + errormessage = '<h3>Thank you for considering.</h3>' + errormessage += 'This Submission has failed pre-screening and has been rejected.' + messages.warning(request, errormessage) + return redirect(reverse('submissions:pool')) if submission.editor_in_charge: - errormessage = (submission.editor_in_charge.get_title_display() + ' ' + - submission.editor_in_charge.user.last_name + - ' has already agreed to be Editor-in-charge of this Submission.') - context = {'errormessage': errormessage} - return render(request, 'submissions/accept_or_decline_assignment_ack.html', context) + errormessage = '<h3>Thank you for considering.</h3>' + errormessage += (submission.editor_in_charge.get_title_display() + ' ' + + submission.editor_in_charge.user.last_name + + ' has already agreed to be Editor-in-charge of this Submission.') + messages.warning(request, errormessage) + return redirect(reverse('submissions:pool')) contributor = Contributor.objects.get(user=request.user) assignment = EditorialAssignment(submission=submission, to=contributor, @@ -549,8 +551,9 @@ def volunteer_as_EIC(request, arxiv_identifier_w_vn_nr): SubmissionUtils.send_EIC_appointment_email() SubmissionUtils.send_author_prescreening_passed_email() - context = {'assignment': assignment} - return render(request, 'submissions/accept_or_decline_assignment_ack.html', context) + messages.success(request, 'Thank you for becoming Editor-in-charge of this submission.') + return redirect(reverse('submissions:editorial_page', + args=[submission.arxiv_identifier_w_vn_nr])) @login_required