<!--
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at

  http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
-->

<div id="doc">
  <div class="errors-container"></div>
   
<div class="nav">
  <div class="span3">
    <button class="save-doc btn btn-success save" type="button"><i class="icon fonticon-circle-check"></i> Save</button>
    <button class="btn cancel-button">Back to _all_docs</button>
  </div>

  <div class="span7">
    <% if (attachments) { %>
    <div class="btn-group">
      <button class="dropdown-toggle btn" data-bypass="true" data-toggle="dropdown">
        View Attachments
        <span class="caret"></span>
      </button>
      <ul class="dropdown-menu">
        <%_.each(attachments, function (att) { %>
        <li>
        <a href="<%- att.url %>" target="_blank"> <strong> <%- att.fileName %> </strong> -
          <span> <%- att.contentType %>, <%- formatSize(att.size)%> </span>
        </a>
        </li>
        <% }) %>
      </ul>
    </div>
    <% } %> 
    <button class="btn upload"><i class="icon icon-circle-arrow-up"></i> Upload Attachment</button>
    <button class="btn duplicate"><i class="icon icon-repeat"></i> Clone document</button>
  </div>

  <button class="btn btn-danger delete"><i class="icon icon-trash"></i></button>
  </ul>

<div id="upload-modal"> </div>
<div id="duplicate-modal"> </div> 
</div>

  <div id="editor-container" class="doc-code"><%- JSON.stringify(doc.attributes, null, "  ") %></div>

</div>
