...
 
Commits (4)
This diff is collapsed.
......@@ -70,6 +70,8 @@ urlpatterns = [
path('resources/publications', views.references, name='references'),
path('resources/publication/<int:id>', views.reference),
path('resources/publications/<int:id>', views.reference, name='reference'),
path('resources/publications/<int:id>/edit', views.referenceform, name='editreference'),
path('resources/publications/<int:id>/<str:export_method>', views.export_reference, name = 'export_reference'),
path('resources/publications/add', views.referenceform, name='newreference'),
path('resources/publications/create/<int:dataset>', views.referenceform, name='newflowreference'),
path('resources/publications/tags/<int:tag>', views.references, name='tag_search'),
......
......@@ -9,7 +9,7 @@ from django.contrib.auth.decorators import login_required
from django.db.models import Count
from django.contrib import messages
from django.db.models import Q
from django.http import JsonResponse
from django.http import JsonResponse, HttpResponse
from django.contrib.auth.models import User
from django.contrib.auth import login
from django.contrib.sites.models import Site
......@@ -234,6 +234,13 @@ def reference(request, id):
context = { 'section': 'literature', 'page': 'publications', 'info': info, 'related': related, 'authors': authors, 'editlink': editlink, 'data': data, 'datatables': True }
return render(request, 'core/reference.html', context)
#GW: Export reference funcion 10/12
def export_reference(request,id, export_method):
info = get_object_or_404(Reference, pk=id)
data = Data.objects.filter(dataset__references=info)
context = {'info': info}
return render(request, 'core/'+export_method+'.html', context)
@login_required
def referenceform(request, id=False, dataset=False):
processes = Process.objects.filter(slug__isnull=False).order_by('id')
......@@ -442,7 +449,7 @@ def updateorgs(request):
info.type = 'universities'
info.parent = Organization.objects.get(pk=49)
info.save()
if info.id == 51:
info.parent = Organization.objects.get(pk=57)
info.name = "Department of Environmental & Geographical Science"
......
<div class="modal fade" id="bibtext-modal" tabindex="-1" role="dialog" aria-labelledby="Bibtext" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">Bibtext</h4>
</div>
<div id="form-modal-body" class="modal-body">
<pre><code>@article{reference_tag,
author = "{{info.authorlist}}",
title = "{{info.title}}",
journal = "{{info.journal}}",
year = {{info.year}},
url = "{{info.url}}",
doi = "{{info.doi}}",
}</code></pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
{% extends 'multiplicity/base.html' %}
{% load static %}
{% block title %}{{ info.title }} | Publications | {% endblock %}
......@@ -136,9 +137,9 @@
<h2 class="panel-title">Download reference</h2>
</div>
<div class="panel-body">
<a class="btn btn-info" href="http://">Bibtex</a>
<a class="btn btn-info" href="http://">EndNote</a>
<a class="btn btn-info" href="http://">Zotero</a>
<a class="btn btn-info" data-toggle="modal" href="#bibtext-modal">Bibtex</a>
<a class="btn btn-info" data-toggle="modal" href="#ris-modal">RIS</a>
<a class="btn btn-info" data-toggle="modal" href="#ris-modal">RefWorks</a>
</div>
</div>
<div class="panel panel-dark">
......
<div class="modal fade" id="ris-modal" tabindex="-1" role="dialog" aria-labelledby="RIS" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">RIS</h4>
</div>
<div id="form-modal-body" class="modal-body">
<pre><code>
TY - JOUR
T1 - {{info.title}}
AU - {{info.authorlist}}
Y1 - {{info.year}}
UR - {{info.url}}
DO - {{info.doi}}
N2 - {{info.abstract}}
ER - </code></pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>