{% extends "layout.html" %} {% block title_name %} - {{ entity.name }}{% endblock %} {% block breadcrumb %} {{ [[_('files'), 'file_index'], entity.name]|crumb }} {% endblock %} {% block content %}
{% if 'contributor'|is_authorized %} {{ _('edit')|button(url_for('file_update', id_=entity.id)) }} {{ entity|display_delete_link }} {% endif %} {{ entity.id|bookmark_toggle }} {% if missing_file %} {{ _('missing file')|uc_first }}! {% else %} {{ _('download')|button(url_for('download_file', filename=filename)) }} {% endif %}

{{ entity.name }}

{{ info|display_info }}
{% if preview %} {{ filename }} {% elif not missing_file %} {{ _('no preview available')|uc_first }} {% endif %}
{{ entity|description }}
{% if 'contributor'|is_authorized %}
{{ _('add')|button(url_for('file_add', id_=entity.id, class_name='source')) }} {{ _('source')|button(url_for('source_insert', origin_id=entity.id)) }}
{% endif %} {{ tables['source'].display('source')|safe }}
{% for name in ['event', 'actor', 'place', 'feature', 'stratigraphic-unit', 'find'] %} {% if name not in ['feature', 'stratigraphic-unit', 'find'] or tables[name].rows %}
{% if 'contributor'|is_authorized and name not in ['feature', 'stratigraphic-unit', 'find'] %}
{{ _('add')|button(url_for('file_add', id_=entity.id, class_name=name)) }} {% if name == 'place' %} {{ _('place')|button(url_for('place_insert', origin_id=entity.id)) }} {% else %} {% for code in config['CLASS_CODES'][name]%} {{ code|get_class_name|button(url_for(name + '_insert', code=code, origin_id=entity.id)) }} {% endfor %} {% endif %}
{% endif %} {{ tables[name].display(name)|safe }}
{% endif %} {% endfor %}
{% if 'contributor'|is_authorized %}
{{ _('add')|button(url_for('entity_add_reference', id_=entity.id)) }} {{ _('bibliography')|button(url_for('reference_insert', code='bibliography', origin_id=entity.id)) }} {{ _('edition')|button(url_for('reference_insert', code='edition', origin_id=entity.id)) }}
{% endif %} {{ tables['reference'].display('reference')|safe }}
{% endblock %}