diff --git a/journals/migrations/0010_auto_20170407_0638.py b/journals/migrations/0010_auto_20170407_0638.py index aed88cab6444d1970524d43aa9d92bd11b13bd35..0e4a390f3f1debb8c889bb35e4a8c1828e1338fb 100644 --- a/journals/migrations/0010_auto_20170407_0638.py +++ b/journals/migrations/0010_auto_20170407_0638.py @@ -5,6 +5,51 @@ from __future__ import unicode_literals from django.db import migrations, models +def remove_doi_prefix(apps, schema_editor): + Journal = apps.get_model('journals', 'Journal') + for journal in Journal.objects.all(): + try: + journal.doi_string = journal.doi_string.split('10.21468/', 1)[1] + except KeyError: + print(' - Journal %s has no valid `doi_string`' % journal.id) + journal.save() + + Issue = apps.get_model('journals', 'Issue') + for issue in Issue.objects.all(): + try: + issue.doi_string = issue.doi_string.split('10.21468/', 1)[1] + except KeyError: + print(' - Issue %s has no valid `doi_string`' % issue.id) + issue.save() + + Volume = apps.get_model('journals', 'Volume') + for volume in Volume.objects.all(): + try: + volume.doi_string = volume.doi_string.split('10.21468/', 1)[1] + except KeyError: + print(' - Volume %s has no valid `doi_string`' % volume.id) + volume.save() + print(' - DOI prefixes removed...') + + +def add_doi_prefix(apps, schema_editor): + Journal = apps.get_model('journals', 'Journal') + for journal in Journal.objects.all(): + journal.doi_string = '10.21468/' + journal.doi_string + journal.save() + + Issue = apps.get_model('journals', 'Issue') + for issue in Issue.objects.all(): + issue.doi_string = '10.21468/' + issue.doi_string + issue.save() + + Volume = apps.get_model('journals', 'Volume') + for volume in Volume.objects.all(): + volume.doi_string = '10.21468/' + volume.doi_string + volume.save() + print(' - DOI prefixes added...') + + class Migration(migrations.Migration): dependencies = [ @@ -30,4 +75,5 @@ class Migration(migrations.Migration): field=models.CharField(blank=True, default='', max_length=200, unique=True), preserve_default=False, ), + migrations.RunPython(remove_doi_prefix, add_doi_prefix), ] diff --git a/journals/templates/journals/_base.html b/journals/templates/journals/_base.html index a78ad65eea9567e99fb5743ba4a8d5fc81467c9f..891fed8896a9229cbf5177a3b629f7fab2ff6628 100644 --- a/journals/templates/journals/_base.html +++ b/journals/templates/journals/_base.html @@ -14,8 +14,9 @@ {% endblock %} {% block secondary_navbar %} - <nav class="navbar navbar-secondary"> - <div class="container my-2"> +<div class="container my-2"> + <nav class="navbar navbar-secondary px-0"> + <div> <h2 class="banner d-inline-block mr-2"><a href="{% url 'scipost:landing_page' journal.doi_string %}">{{journal}}</a></h2> <ul class="links"> {% if journal.active or request.user.is_staff %} @@ -29,6 +30,7 @@ </ul> </div> </nav> +</div> {% endblock secondary_navbar %} diff --git a/journals/templates/journals/_publication_card_content.html b/journals/templates/journals/_publication_card_content.html index 50f92e4de2630ecc4bb02c2b4bdecc11e12e5e98..34689d4384a4dc7cade039f57f3216a113dd250b 100644 --- a/journals/templates/journals/_publication_card_content.html +++ b/journals/templates/journals/_publication_card_content.html @@ -1,6 +1,6 @@ <div class="card-block publication-{{publication.id}}"> <h3 class="card-title"><a href="{{publication.get_absolute_url}}">{{ publication.title }}</a></h3> <p class="card-text">{{ publication.author_list }}</p> - <p class="card-text text-muted">{{ publication.citation }} - published {{ publication.publication_date|date:'j F Y' }} | <a href="javascript:;" class="btn btn-outline-primary btn-sm mx-2" data-toggle="toggle" data-target=".card-block.publication-{{publication.id}} .abstract">Toggle abstract</a> <a href="{{publication.get_absolute_url}}/pdf" target="_blank">pdf</a></p> + <p class="card-text text-muted">{{ publication.citation }} - published {{ publication.publication_date|date:'j F Y' }} | <a href="javascript:;" class="mx-2" data-toggle="toggle" data-target=".card-block.publication-{{publication.id}} .abstract">Toggle abstract</a> <a href="{{publication.get_absolute_url}}/pdf" target="_blank">pdf</a></p> <p class="abstract mb-0 py-2" style="display:none;">{{ publication.abstract }}</p> </div> diff --git a/scipost/static/scipost/assets/css/_navbar.scss b/scipost/static/scipost/assets/css/_navbar.scss index 2edb6eea28f158a50b39c8ac16905bf8d87a5079..c9ca47fc15fc69689f38f779cc68b3a1ed8d1aa3 100644 --- a/scipost/static/scipost/assets/css/_navbar.scss +++ b/scipost/static/scipost/assets/css/_navbar.scss @@ -74,4 +74,9 @@ margin-top: -0.75rem; margin-bottom: 0; background-color: transparent; + + > div { + overflow-x: auto; + white-space: nowrap; + } } diff --git a/scipost/views.py b/scipost/views.py index 1382090889b8b3c0b9fd380d054631456a4965a4..6ba474479ab4bad1b5ea91428f7b868cba78390b 100644 --- a/scipost/views.py +++ b/scipost/views.py @@ -204,7 +204,7 @@ 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='SciPost Physics') + 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] diff --git a/submissions/templates/submissions/pool.html b/submissions/templates/submissions/pool.html index e423edb669f18b21f19c00a4d2e2cb1af83a63e0..c557b6b443fe8f3c483788a29743c2c126535a5f 100644 --- a/submissions/templates/submissions/pool.html +++ b/submissions/templates/submissions/pool.html @@ -43,7 +43,7 @@ <hr> {% endif %} - <div class="col-12"> + <div class="col-12" id="undergoing_rec_{{rec.id}}"> <div class="card card-outline-secondary"> {% include 'submissions/_submission_card_fellow_content.html' with submission=rec.submission %} </div> @@ -268,7 +268,7 @@ {% for recommendation in recommendations_undergoing_voting %} <li class="list-group-item"> <div class="card-block"> - <a href="#prepare_rec_{{recommendation.id}}">{{recommendation.submission.title}}</a> + <a href="#undergoing_rec_{{recommendation.id}}">{{recommendation.submission.title}}</a> <p class="text-muted my-0">{{recommendation.submission.author_list}}</p> <p class="my-0">Formulated on {{recommendation.date_submitted}}</p> </div> @@ -307,7 +307,7 @@ <ul class="list-group list-group-flush"> {% for submission in submissions_in_pool %} <li class="list-group-item"> - <div class="card-block"> + <div class="card-block" style="overflow: auto;"> <a href="#pool_submission_{{submission.id}}">{{submission.title}}</a> <p class="text-muted mb-1">{{submission.author_list}}</p> <p class="label label-secondary label-sm my-2">{{submission.get_status_display}}</p>