Quote:
Originally Posted by Wiggo
I've tried to add an icon to a column for has_notes similar to extra_files
Code:
if has_extra_files() then icon = add_icon(icon, 'extra_files.png') fi;
but this doen't work. Is it possible to show an icon for has_notes regardless the type of notes (author,tag, series...)?
|
This template returns the list of lookup names with items on the book that have notes. If none do, return the empty string. If you want to use it, make it a stored template and call it in the icon template.
I don't know if the performance will be acceptable, especially if lots of items in lots of columns have notes.
Code:
python:
def evaluate(book, context):
db = context.db.new_api
notes_on_book = db.items_with_notes_in_book(book.id)
return '' if not notes_on_book else ', '.join(notes_on_book.keys())