{{=[[ ]]=}}
<!DOCTYPE html>
<html>
  <head>
    <title>{{label}}</title>
    {{>head}}
  </head>
  <body>
    <div data-role="page">
      <div data-role="header">
        {{>home}}
        <h1>{{label}}</h1>
        {{#page_config.can_change}}
        <a href="{{rt}}/[[form.urlpath]]/{{id}}/edit" data-icon="edit" data-transition="flip">
          Edit
        </a>
        {{/page_config.can_change}}
      </div>
      <div role="main" class="ui-content">
        [[#form.has_geo]]
        <div class="ui-grid-a ui-responsive">
        <div class="ui-block-a">
        [[/form.has_geo]]
          <h1>{{label}}</h1>
          <table>
          [[#fields]]
            [[^type_is_note]]
            [[^type_is_geo]]
            [[^type_is_binary]]
            <tr>
              <th>[[label]]</th>
              [[^wq:nested]]
              [[#wq:ForeignKey]]
              <td>{{[[real_name]]_label}}</td>
              [[/wq:ForeignKey]]
              [[^wq:ForeignKey]]
              <td>{{[[name]][[#has_label]]_label[[/has_label]]}}</td>
              [[/wq:ForeignKey]]
              [[/wq:nested]]
              [[#wq:nested]]
              <td>
                {{#[[plural_name]]}}
                <table>
                [[#children]]
                [[^type_is_note]]
                [[^type_is_geo]]
                [[^type_is_binary]]
                  <tr>
                    <th>[[label]]</th>
                    [[#wq:ForeignKey]]
                    <td>{{[[real_name]]_label}}</td>
                    [[/wq:ForeignKey]]
                    [[^wq:ForeignKey]]
                    <td>{{[[name]][[#has_label]]_label[[/has_label]]}}</td>
                    [[/wq:ForeignKey]]
                  </tr>
                [[/type_is_binary]]
                [[/type_is_geo]]
                [[/type_is_note]]
                [[/children]]
                </table>
                <hr>
                {{/[[plural_name]]}}
              </td>
              [[/wq:nested]]
            </tr>
            [[/type_is_binary]]
            [[/type_is_geo]]
            [[/type_is_note]]
          [[/fields]]
          </table>
        [[#form.has_geo]]
        </div>
        <div class="ui-block-b">
          <div class="map detail-map" id="[[form.name]]-{{id}}-map"></div>
        </div>
        </div>
        [[/form.has_geo]]
        [[#fields]]
        [[#type_is_binary]]
        <h3>[[label]]</h3>
        <img src="{{[[name]]}}" alt="[[label]] - {{label}}" style="max-width:100%">
        [[/type_is_binary]]
        [[#wq:nested]]
        [[#children]]
        [[#type_is_binary]]
        {{#[[plural_name]]}}
        <h3>[[label]]</h3>
        <img src="{{[[name]]}}" alt="[[label]] - {{label}}" style="max-width:100%">
        {{/[[plural_name]]}}
        [[/type_is_binary]]
        [[/children]]
        [[/wq:nested]]
        [[/fields]]
      </div>
    </div>
  </body>
</html>
