{% load i18n widget_tweaks spider_rdf %}
<ul class="w3-ul" rel="spkc:properties">
  {% for field in form.visible_fields %}
    {% if field.field.widget.input_type == "start_pseudo" %}
      <li>
        {% render_field field %}
          <ul class="w3-ul">
    {% elif field.field.widget.input_type == "stop_pseudo" %}
          </ul>
        {% render_field field %}
      </li>
    {% else %}
      <li class="" typeof="spkc:Property">
        <data hidden="hidden" property="spkc:fieldname" datatype="xsd:string">{{field.html_name}}</data>
        <data hidden="hidden" property="spkc:name" datatype="xsd:string">{{field.name}}</data>
        {% hashable_literalize field as hashable %}
        <data hidden="hidden" property="spkc:hashable" datatype="xsd:boolean">{{hashable}}</data>
        <div>{{ field.label_tag }}</div>
        {% if field.field.widget.allow_multiple_selected %}
          <ul class="w3-white">
            {% for val in field.value %}
              {% literalize val field as LiteralData %}
              {% if LiteralData != 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'|uriref %}
                {% if LiteralData|is_uriref %}
                  <li property="spkc:value">
                    <a href="{{LiteralData}}">{{val|default_if_none:""}}</a>
                  </li>
                {% elif LiteralData.datatype == 'http://www.w3.org/2001/XMLSchema#anyURI'|uriref %}
                  <li>
                    <data property="spkc:value" datatype="{{LiteralData.datatype}}" content="{{LiteralData}}"></data>
                    <a href="{{LiteralData}}">{{val|default_if_none:""}}</a>
                  </li>
                {% else %}
                  <li property="spkc:value" datatype="{{LiteralData.datatype}}" content="{{LiteralData}}">{{val|default_if_none:""}}</li>
                {% endif %}
              {% endif %}
            {% empty %}
              <li property="spkc:value" hidden="hidden" resource="rdf:nil"></li>
            {% endfor %}
          </ul>
        {% else %}
          {% literalize field as LiteralData %}
          {% if LiteralData|is_uriref %}
            <a class="w3-white" property="spkc:value" href="{{LiteralData}}">{{field.value|default_if_none:""}}</a>
          {% elif LiteralData.datatype == 'http://www.w3.org/2001/XMLSchema#anyURI'|uriref %}
            <span>
              <data hidden="hidden" property="spkc:value" datatype="{{LiteralData.datatype}}" content="{{LiteralData}}"></data>
              <a class="w3-white" href="{{LiteralData}}" resource="">{{field.value|default_if_none:""}}</a>
            </span>
          {% else %}
            {% literalize field as LiteralData %}
            <span property="spkc:value" datatype="{{LiteralData.datatype}}" content="{{LiteralData}}" class="w3-white">{{field.value|default_if_none:""}}</span>
          {% endif %}
        {% endif %}
      </li>
    {% endif %}
  {% empty %}{{form_empty_message|safe}}{% endfor %}
</ul>
