diff --git a/modules/bibformat/etc/format_templates/HB_conf.bft b/modules/bibformat/etc/format_templates/HB_conf.bft
index 70439c6cd..8bc79ce38 100644
--- a/modules/bibformat/etc/format_templates/HB_conf.bft
+++ b/modules/bibformat/etc/format_templates/HB_conf.bft
@@ -1,4 +1,4 @@
EPFL HTML brief - conference
Brief format for conference, poster, proccedings, talk
-
+
\ No newline at end of file
diff --git a/modules/bibformat/etc/format_templates/HD_EPFL_default.bft b/modules/bibformat/etc/format_templates/HD_EPFL_default.bft
index 1e731c928..40b0f46ba 100644
--- a/modules/bibformat/etc/format_templates/HD_EPFL_default.bft
+++ b/modules/bibformat/etc/format_templates/HD_EPFL_default.bft
@@ -1,95 +1,95 @@
EPFL HTML detailed - default
Detailed format for article, review
FulltextFulltext
Related materialDocuments pertinents
diff --git a/modules/bibformat/etc/format_templates/PREVIEW_EPFL_default.bft b/modules/bibformat/etc/format_templates/PREVIEW_EPFL_default.bft
index 25e926a93..4f305a2f1 100644
--- a/modules/bibformat/etc/format_templates/PREVIEW_EPFL_default.bft
+++ b/modules/bibformat/etc/format_templates/PREVIEW_EPFL_default.bft
@@ -1,37 +1,37 @@
EPFL HTML preview detailed - default
Preview and detailed format
\ No newline at end of file
diff --git a/modules/bibformat/lib/elements/bfe_contact_lab.py b/modules/bibformat/lib/elements/bfe_contact_lab.py
index 294e2c1c9..a9c8c172e 100644
--- a/modules/bibformat/lib/elements/bfe_contact_lab.py
+++ b/modules/bibformat/lib/elements/bfe_contact_lab.py
@@ -1,35 +1,35 @@
# -*- coding: utf-8 -*-
"""BibFormat element - Prints link to lab"""
from invenio.messages import gettext_set_language
def format(bfo, kb_name, kb_url):
"""
Prints the contact informations.
Translate using given knowledge base.
@param kb_name a knowledge base use to translate the lab identifier
@param kb_url a knowledge base use to translate the lab identifier
"""
lab_identifiers = bfo.fields("909C0p")
out = []
for lab in lab_identifiers:
lab_name = bfo.kb(kb_name, lab)
lab_url = bfo.kb(kb_url, lab)
if lab_url:
- out.append('%s' % (lab_url, lab_name))
+ out.append('%s' % (lab_url, lab_name))
else:
out.append('%s' % lab_name)
# Add the TTO if we have a patent
if bfo.field('980__a') == 'PATENT':
out.append('Technology Transfer Office')
return ''.join(['%s' % elem for elem in out])
def escape_values(bfo):
"""
Called by BibFormat in order to check if output of this element
should be escaped.
"""
return 0
\ No newline at end of file
diff --git a/modules/bibformat/lib/elements/bfe_imprint.py b/modules/bibformat/lib/elements/bfe_imprint.py
index 4c10dc61c..3a33a6632 100644
--- a/modules/bibformat/lib/elements/bfe_imprint.py
+++ b/modules/bibformat/lib/elements/bfe_imprint.py
@@ -1,38 +1,34 @@
# -*- coding: utf-8 -*-
"""BibFormat element - Prints info about publisher"""
from invenio.messages import gettext_set_language
def format(bfo, separator=', ', hostname_class="", display_label="no", display_year="no", display_identifiers="no"):
"""
Print host (Order: Name of publisher, place of publication and date of publication).
"""
_ = gettext_set_language(bfo.lang)
output = ''
year = bfo.field('260__c')
if not year:
return output
publisher = bfo.field('260__b')
if publisher:
place = bfo.field('260__a')
if place:
output = '%s: %s, %s' % (place, publisher, year)
else:
output = '%s, %s' % (publisher, year)
else:
- # if patent, set label to Priority Date
- if bfo.field('980__a') == 'PATENT':
- output = '%s: %s' % (_("Priority date"), year)
- else:
- output = '%s: %s' % (_("Publication date"), year)
+ output = '%s: %s' % (_("Publication date"), year)
return output
def escape_values(bfo):
"""
Called by BibFormat in order to check if output of this element
should be escaped.
"""
return 0
diff --git a/modules/bibformat/lib/elements/bfe_title.py b/modules/bibformat/lib/elements/bfe_title.py
index 8365fdbf6..052ccd368 100644
--- a/modules/bibformat/lib/elements/bfe_title.py
+++ b/modules/bibformat/lib/elements/bfe_title.py
@@ -1,115 +1,115 @@
"""BibFormat element - Prints titles
"""
import cgi
from invenio import bibformat_utils
from invenio.bibdocfile import BibRecDocs
from invenio.config import CFG_SITE_URL
def add_link_to_fulltext(bfo, text):
"""
Creates a link to fulltext on given text.
"""
documents = BibRecDocs(bfo.recID)
# assert we have some files
if documents and len(documents.bibdocs) == 0:
return text
# check visibility
visible_list = []
for doc in documents.bibdocs:
files = doc.list_latest_files()
if len(files):
#try:
fulltext = files[0]
if fulltext.status in ['', 'PUBLIC']:
visible_list.append(fulltext)
#except IndexError:
# return
# build url
if len(visible_list) == 0:
return text
elif len(visible_list) == 1:
#only one, return a direct url to the last version
return '%s' % (visible_list[0].fullurl, text)
else:
return '%s' % (CFG_SITE_URL, bfo.recID, text)
def format_element(bfo, separator=" ", highlight='no', latex_to_html='no', link_to_fulltext='no', punctuation = ''):
"""
Prints the titles of a record.
@param separator: separator between the different titles
@param highlight: highlights the words corresponding to search query if set to 'yes'
@param latex_to_html: if 'yes', interpret as LaTeX title
@param link_to_fulltext: if 'yes', link title to fulltext if available.
@param punctuation: add this char if the title don't already end with one
"""
titles = []
title = bfo.field('245__a')
title_remainder = bfo.field('245__b')
edition_statement = bfo.field('250__a')
title_tome = bfo.field('245__n')
title_part = bfo.field('245__p')
#start with standard number if given
standard_number = bfo.field('740__a')
if len(standard_number) > 0:
standard_number += ' - '
titles.append(standard_number)
if len(title) > 0:
if title_remainder:
title += ': ' + title_remainder
if len(title_tome) > 0:
title += ", " + title_tome
if len(title_part) > 0:
title += ": " + title_part
titles.append( title )
title = bfo.field('246__a')
if len(title) > 0:
titles.append( title )
title = bfo.field('246__b')
if len(title) > 0:
titles.append( title )
title = bfo.field('246_1a')
if len(title) > 0:
titles.append( title )
titles = [cgi.escape(x) for x in titles]
if highlight == 'yes':
titles = [bibformat_utils.highlight(x, bfo.search_pattern) for x in titles]
if len(edition_statement) > 0:
out = separator.join(titles) + "; " + edition_statement
else:
out = separator.join(titles)
if latex_to_html == 'yes':
out = bibformat_utils.latex_to_html(out)
if link_to_fulltext == 'yes':
out = add_link_to_fulltext(bfo, out)
# add a , at the end if not already
if out and punctuation:
if out[-1] not in [',', '.', '!', '?', ';']:
out += punctuation
return out
def escape_values(bfo):
"""
Called by BibFormat in order to check if output of this element
should be escaped.
"""
- return 0
+ return 0
\ No newline at end of file