Commit f0c783b3 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add a postprocessing function highlight_cppm_speaker.

parent f320831f
......@@ -46,6 +46,25 @@ def highlight_cppm_authors(value, template, record):
return value
def highlight_cppm_speaker(value, template, record):
# cppm speaker is in bold
speaker = record.publications.conference_speaker.strip()
if speaker in record.publications.authors_cppm:
value = value.replace(speaker, '<b>%s</b>' % speaker)
# cppm auhtors are underlined
li = record.publications.authors_cppm.split(',')
for author in li:
author = author.strip()
if author == speaker:
continue
value = value.replace(author, '<u>%s</u>' % author)
return value
def remove_undef(value, template, record):
undef = current.T(plugin_dbui.UNDEF)
return re.sub(', *%s *,' % undef, ',', value)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment