{% 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 %}