{% from 'macros.html' import display_artist_credit, write_a_review, show_life_span with context %} {% for result in results %} {% if type == "artist" %} {{ result['name'] }} {% if result['disambiguation'] is defined %}({{ result['disambiguation'] }}){% endif %} {{ result['sort-name'] is defined and result['sort-name'] }} {{ result['type'] is defined and result['type'] or '-' }} {{ result['country'] is defined and result['country'] or '-' }} {{ write_a_review(entity_type='artist', entity_id=result.id) }} {% elif type == "release-group" %} {{ result['title'] }} {% if result['disambiguation'] is defined %}({{ result['disambiguation'] }}){% endif %} {{ display_artist_credit(result) }} {{ result['primary-type'] is defined and result['primary-type'] or '-' }} {{ write_a_review(entity_type='release_group', entity_id=result.id) }} {% elif type == "event" %} {{ result['name'] }} {{show_life_span(result, True)}} {{ display_artist_credit(result) }} {% if result['place-relation-list'] is defined %} {{ result['place-relation-list'][0]['place']['name'] }} {% else %} - {% endif %} {{ write_a_review(entity_type='event', entity_id=result.id) }} {% elif type == "place" %} {{ result['name'] }} {% if result['disambiguation'] is defined %}({{ result['disambiguation'] }}){% endif %} {{ result['type'] is defined and result['type'] or '-' }} {% if result['area'] is defined %} {{ result['area']['name'] }} {% else %} - {% endif %} {{ write_a_review(entity_type='place', entity_id=result.id) }} {% elif type == "work" %} {{ result['title'] }} {% if result['disambiguation'] is defined %}({{ result['disambiguation'] }}){% endif %} {{ display_artist_credit(result) }} {{ result['type'] is defined and result['type'] or '-' }} {{ result['language'] is defined and result['language'] or '-' }} {{ write_a_review(entity_type='work', entity_id=result.id) }} {% elif type == "label" %} {{ result['name'] }} {% if result['disambiguation'] is defined %}({{ result['disambiguation'] }}){% endif %} {{ result['type'] is defined and result['type'] or '-' }} {{ result['country'] is defined and result['country'] or '-' }} {{ write_a_review(entity_type='label', entity_id=result.id) }} {% elif type == "recording" %} {{ result['title'] }} {% if result['disambiguation'] is defined %}({{ result['disambiguation'] }}){% endif %} {% if result['length'] is defined %} {{ result['length'] | track_length_ms }} {% else %} - {% endif %} {{ display_artist_credit(result) }} {% if result['release-list'] is defined and result['release-list'] %} {{ result['release-list'][0].title or '-' }} {% else %} - {% endif %} {{ write_a_review(entity_type='label', entity_id=result.id) }} {% elif type == "bb_edition_group" %} {{ result['name'] }} {% if result['disambiguation'] is defined and result['disambiguation'] %}({{ result['disambiguation'] }}){% endif %} {% if result['edition_group_type'] is defined and result['edition_group_type'] %} {{ result['edition_group_type'] }} {% else %} - {% endif %} {% if result['author_credits'] is defined and result['author_credits'] %} {% if result["author_credits"]|length > 1 %} {{ result['author_credits'][0]['name'] }} + {{ result["author_credits"]|length - 1 }} more {% else %} {{ result['author_credits'][0]['name'] }} {% endif %} {% else %} - {% endif %} {{ write_a_review(entity_type='bb_edition_group', entity_id=result.bbid) }} {% elif type == "bb_literary_work" %} {{ result['name'] }} {% if result['disambiguation'] is defined and result['disambiguation'] %}({{ result['disambiguation'] }}){% endif %} {% if result['work_type'] is defined and result['work_type'] %} {{ result['work_type'] }} {% else %} - {% endif %} {% if result['languages'] is defined and result['languages'] %} {% if result["languages"]|length > 1 %} {{ result['languages'][0] }} + {{ result["languages"]|length - 1 }} more {% else %} {{ result['languages'][0] }} {% endif %} {% else %} - {% endif %} {{ write_a_review(entity_type='bb_literary_work', entity_id=result.bbid) }} {% elif type == "bb_author" %} {{ result['name'] }} {% if result['disambiguation'] is defined and result['disambiguation'] %}({{ result['disambiguation'] }}){% endif %} {% if result['author_type'] is defined and result['author_type'] %} {{ result['author_type'] }} {% else %} - {% endif %} {% if result['gender'] is defined and result['gender'] %} {{ result['gender'] }} {% else %} - {% endif %} {{ write_a_review(entity_type='bb_author', entity_id=result.bbid) }} {% elif type == "bb_series" %} {{ result['name'] }} {% if result['disambiguation'] is defined and result['disambiguation'] %}({{ result['disambiguation'] }}){% endif %} {% if result['series_type'] is defined and result['series_type'] %} {{ result['series_type'] }} {% else %} - {% endif %} {{ write_a_review(entity_type='bb_series', entity_id=result.bbid) }} {% endif %} {% endfor %}