diff --git a/SciPost_v1/settings/local_jorran.py b/SciPost_v1/settings/local_jorran.py deleted file mode 100644 index 1d47922efff81ddbc6b2157ce74b9fee93f697a6..0000000000000000000000000000000000000000 --- a/SciPost_v1/settings/local_jorran.py +++ /dev/null @@ -1,22 +0,0 @@ -from .base import * - -# THE MAIN THING HERE -DEBUG = True - -# Debug toolbar settings -INSTALLED_APPS += ( - 'debug_toolbar', -) -MIDDLEWARE_CLASSES += ( - 'debug_toolbar.middleware.DebugToolbarMiddleware', -) -INTERNAL_IPS = ['127.0.0.1', '::1'] - -# Static and media -STATIC_ROOT = '/Users/jorranwit/Develop/SciPost/scipost_v1/local_files/static/' -MEDIA_ROOT = '/Users/jorranwit/Develop/SciPost/scipost_v1/local_files/media/' -WEBPACK_LOADER['DEFAULT']['BUNDLE_DIR_NAME'] =\ - '/Users/jorranwit/Develop/SciPost/scipost_v1/local_files/static/bundles/' - -MAILCHIMP_API_USER = get_secret("MAILCHIMP_API_USER") -MAILCHIMP_API_KEY = get_secret("MAILCHIMP_API_KEY") diff --git a/journals/models.py b/journals/models.py index 1d1862c0f3b71df99ca9d038738bedb9b45af0d6..38ac13ee20b40105a10f8b2b1a19d76d022775a5 100644 --- a/journals/models.py +++ b/journals/models.py @@ -177,41 +177,6 @@ class Publication(models.Model): + ', ' + self.get_paper_nr() + ' (' + self.publication_date.strftime('%Y') + ')') - def citations_as_ul(self): - output = '<ul>' - context = Context({}) - nr = 0 - for cit in self.citedby: - output += '<li>{{ auth_' + str(nr) + ' }}' - context['auth_' + str(nr)] = (cit['first_author_given_name'] - + ' ' + cit['first_author_surname']) - if cit['multiauthors']: - output += ' <em>et al.</em>' - output += (', <em>{{ title_' + str(nr) + ' }}</em>, <br/>' - '{{ journal_abbrev_' + str(nr) + ' }}') - context['title_' + str(nr)] = cit['article_title'] - context['journal_abbrev_' + str(nr)] = cit['journal_abbreviation'] - if cit['volume']: - context['volume_' + str(nr)] = cit['volume'] - output += ' <strong>{{ volume_' + str(nr) + ' }}</strong>' - output += ', ' - if cit['first_page']: - output += '{{ first_page_' + str(nr) + ' }}' - context['first_page_' + str(nr)] = cit['first_page'] - elif cit['item_number']: - output += '{{ item_number_' + str(nr) + ' }}' - context['item_number_' + str(nr)] = cit['item_number'] - output += (' ({{ year_' + str(nr) + ' }}) ' - '<a href="https://doi.org/{{ doi_' + str(nr) + ' }}" ' - 'target="_blank">[Crossref]</a>') - context['year_' + str(nr)] = cit['year'] - context['doi_' + str(nr)] = cit['doi'] - output += '</li>' - nr += 1 - output += '</ul>' - template = Template(output) - return template.render(context) - class Deposit(models.Model): """ diff --git a/journals/templates/journals/_publication_citations.html b/journals/templates/journals/_publication_citations.html index 355d008552537c5a70eec3db1b156406089db734..7e47e1448d34865c403c03c79259978d36004437 100644 --- a/journals/templates/journals/_publication_citations.html +++ b/journals/templates/journals/_publication_citations.html @@ -1,49 +1,8 @@ -{# TO BE USED IN FUTURE #} - - - -{% comment %} -output = '<ul>' -context = Context({}) -nr = 0 -{ - first_author_given_name: 'John', - first_author_surname: 'Doe', - multiauthors: true - article_title: 'Phase transitions on 2D Ising model', - journal_abbreviation: 'SciPostPhys', - vol: '' - -} -for cit in self.citedby: - output += '<li>{{ auth_' + str(nr) + ' }}' - context['auth_' + str(nr)] = (cit['first_author_given_name'] - + ' ' + cit['first_author_surname']) - if cit['multiauthors']: - output += ' <em>et al.</em>' - output += (', <em>{{ title_' + str(nr) + ' }}</em>, <br/>' - '{{ journal_abbrev_' + str(nr) + ' }}') - context['title_' + str(nr)] = cit['article_title'] - context['journal_abbrev_' + str(nr)] = cit['journal_abbreviation'] - if cit['volume']: - context['volume_' + str(nr)] = cit['volume'] - output += ' <strong>{{ volume_' + str(nr) + ' }}</strong>' - output += ', ' - if cit['first_page']: - output += '{{ first_page_' + str(nr) + ' }}' - context['first_page_' + str(nr)] = cit['first_page'] - elif cit['item_number']: - output += '{{ item_number_' + str(nr) + ' }}' - context['item_number_' + str(nr)] = cit['item_number'] - output += (' ({{ year_' + str(nr) + ' }}) ' - '<a href="https://doi.org/{{ doi_' + str(nr) + ' }}" ' - 'target="_blank">[Crossref]</a>') - context['year_' + str(nr)] = cit['year'] - context['doi_' + str(nr)] = cit['doi'] - output += '</li>' - nr += 1 -output += '</ul>' -template = Template(output) -return template.render(context) - -{% endcomment %} +<ul> + {% for cite in publication.citedby %} + <li> + {{cite.first_author_given_name}} {{cite.first_author_surname}}{% if cite.multiauthors %} <em>et al.</em>{% endif %}, <em>{{cite.article_title}}</em><br> + {{cite.journal_abbreviation}}{% if cite.volume %} <strong>{{cite.volume}}</strong>{% endif %}, {{cite.first_page|default_if_none:''}} {{cite.item_number|default_if_none:''}} ({{cite.year}}) <a href="https://doi.org/{{cite.doi}}" target="_blank">[Crossref]</a> + </li> + {% endfor %} +</ul> diff --git a/journals/templates/journals/publication_detail.html b/journals/templates/journals/publication_detail.html index d9b2be5ee1dcee0250844d6a0b70062b3b403e8e..cf323f58bd990fd4478e0960c35922b9bb04a405 100644 --- a/journals/templates/journals/publication_detail.html +++ b/journals/templates/journals/publication_detail.html @@ -31,42 +31,31 @@ <meta name="citation_firstpage" content="{{ publication.paper_nr|paper_nr_string_filter }}"/> <meta name="citation_pdf_url" content="https://scipost.org/{{ publication.doi_string }}/pdf"/> - <script> - $(document).ready(function(){ - $("#citationslist").hide(); - - $("#citationslistbutton").click(function(){ - $("#citationslist").toggle(); - }); - }); - </script> - {% endblock headsup %} {% block content %} {% include 'journals/_publication_details.html' with publication=publication %} + <hr> {% if publication.citedby|length >= 1 %} - <hr> + <div class="row"> <div class="col-6 col-md-2"> <h3 class="mb-2">Cited by {{ publication.citedby|length }}</h3> - <button class="btn btn-sm btn-secondary" id="citationslistbutton">Toggle view</button> + <a href="javascript:;" data-toggle="toggle" data-target="#citationslist">Toggle view</a> </div> <div class="col-6 col-md-2"> <img src="{% static 'scipost/images/citedby.gif' %}" alt="Crossref Cited-by" width="64" /> </div> </div> - <div class="row" id="citationslist"> + <div class="row" id="citationslist" style="display: none;"> <div class="col-12"> - {# {% include 'journals/_publication_citations.html' with publication=publication %}#} - {{ publication.citations_as_ul }} + {% include 'journals/_publication_citations.html' with publication=publication %} </div> </div> {% endif %} - <hr> <div class="row"> <div class="col-12"> <h3>View more material from these authors:</h3> diff --git a/scipost/static/scipost/assets/css/_journals.scss b/scipost/static/scipost/assets/css/_journals.scss index afeed45d4a42b636ba39b9d83922a72cd7058369..a2f1946f4558a8964fab6ceb18be41f0224f4d4a 100644 --- a/scipost/static/scipost/assets/css/_journals.scss +++ b/scipost/static/scipost/assets/css/_journals.scss @@ -60,6 +60,8 @@ ul.publicationClickables { list-style-type: none; margin: 0; padding: 2px 0; + border: 1px solid #eee; + border-bottom: 1px solid #ddd; li { display: inline-block;