<html xmlns:py="http://genshi.edgewall.org/" 
  xmlns:xi="http://www.w3.org/2001/XInclude"
  py:strip=""
  >

  <py:def function="page_title">Bibliographica - ${c.model.title[0]} - ${c.model.identifier}</py:def>

  <py:def function="optional_head">

    <link type="text/css" href="/css/book.css" rel="stylesheet" />	
    <script type="text/javascript" src="/js/entry.js"></script>
  </py:def>

  <div py:match="content">
    <div id="book">
      <h1>Title: <strong>${c.model.title[0]}</strong></h1>
      <dl>
      <dt>Authors:</dt>
      <dd>
      <ul>
        <li py:for="auth in c.model.creators">
        <a href="${auth.local_path}">${auth.name[0]}</a>
            <py:with vars="birth=auth.birth; death=auth.death">
              <py:if test="birth">${birth.date[0][:4]} -
                <py:if test="death">${death.date[0][:4]}</py:if>
              </py:if>
              <py:if test="death and not birth">Died: ${death.date[0][:4]}</py:if>
            </py:with>
        </li>
      </ul>
      </dd>
      <dt py:if="len(list(c.model.publishers)) != 0">Publisher:</dt>
      <dd>
        <ul>
          <li py:for="publisher in c.model.publishers">
          <a href="${publisher.local_path}"> ${publisher.name}</a>
          </li>
        </ul>
      </dd>
      <dt py:if="c.model.issued[0]">Issued:</dt>
      <dd>${c.model.issued[0][:4]}</dd>
      <dt py:if="'description' in c.model.to_dict().keys()">Description:</dt>
        <dd class="description"  py:for="desc in c.model.descriptions">
          ${desc}
        </dd>
      <dt class="extent" py:if="'extent' in c.model.to_dict().keys()">Extent:</dt>
        <dd class="extent_value">${c.model.extent.next().value}</dd>
      <dt class="language" py:if="c.model.language">Language:</dt>
          <dd class="language_value">${c.model.language.next().value}</dd>
        </dl>
      <dt>Subjects:</dt>
      <dd>
        <ul>
          <li py:for="subj in c.model.subjects">
              <!-- simple keyword subject? -->
              <py:if test="subj.label">
                  <span class="subject_kw">${subj.label[0]}</span>
              </py:if>
              <!-- Dewey? -->
              <py:if test="subj.inscheme and subj.inscheme[0].startswith('http://dewey')">
              <span class="ddc">Dewey (DDC): ${subj.notation[0]} <span class="ddc_scheme"><a href="${subj.inscheme[0]}">${subj.inscheme[0]}</a></span></span>
              </py:if>
              <py:if test="subj.inscheme and subj.inscheme[0].startswith('http://id.loc.gov')">
              <span class="lcsh">LCSH: ${subj.preflabel[0]} <span class="lcsh_scheme"><a href="${subj.inscheme[0]}">${subj.inscheme[0]}</a></span></span>
              </py:if>
          </li>
        </ul>
      </dd>
      <py:if test="len(list(c.model.seealso)) > 0">
        <dt>See Also:</dt>
        <dd>
          <ul>
            <li py:for="link in c.model.seealso">
                <a href="${link}">${link}</a>
            </li>
          </ul>
        </dd>
      </py:if>
      <py:if test="len(list(c.model.isbn)) > 0">
        <dt>ISBN:</dt>
        <dd>
          <ul>
            <li py:for="isbn in c.model.isbn" class="isbn">
                ${isbn}
            </li>
          </ul>
        </dd>
      </py:if>

    </div>
  </div>

  <py:def function="primary_sidebar_extras">
  <h3 class="widget-title">Collections</h3>
  <li>Collections are lists of works you can create and share with others</li>
      <ul id="collections">
        <py:if test="c.user == None">
        <li>Please <a href="${url(controller='account', action='login')}">log in</a> 
                  to create collections</li>
        </py:if>
      <py:if test="c.user not in ['', None]">
        <h3  class="widget-title">Your collections</h3>
        <li><a href="#" id="newcollection">Add to new collection</a></li>
      </py:if>   
      </ul>
  <h3 class="widget-title">Formats  for this record</h3>
    <ul>
      <li class="hidden" id="uriref">${c.model.identifier}</li>
      <li><a href="${c.model.identifier}.nt">N triples</a></li>
      <li><a href="${c.model.identifier}.n3">N3</a></li>
      <li><a href="${c.model.identifier}.rdf">RDF</a></li>
      <li><a href="${c.model.identifier}.json">JSON</a></li>
      <li><a href="${c.model.identifier}.bibtex">BibTeX</a></li>
    </ul> 
  </py:def>
  <xi:include href="base.html" />
</html>


