{% if annotation_fields %}
{% set old_annotations = None %}
{% if annotations and post.id in annotations %}
{% set old_annotations = annotations[post.id] %}
{% endif %}
{% for field in annotation_fields %}
{% set type = annotation_fields[field]["type"] %}
{% set label = annotation_fields[field]["label"] %}
{% set old_annotation = "" %}
{% if old_annotations and label in old_annotations %}
{% set old_annotation = old_annotations[label] %}
{% endif %}
{% if type == 'text' %}
{% elif type == 'textarea' %}
{% elif type == 'dropdown' %}
{% elif type == 'checkbox' %}
{% for option in annotation_fields[field]["options"] %}
{% set option_id = option.keys() | first %}
{% set option_label = option.values() | first %}
{% set checked = "checked" if old_annotation and option_label in old_annotation else "" %}
{% endfor %}