<?cs include "header.cs" ?>
<?cs include "macros.cs" ?>



<div id="ctxtnav" class="nav">
 <h2>Mailarc Navigation</h2><?cs
 with:links = chrome.links ?><?cs
  if:len(links.prev) || len(links.up) || len(links.next) ?><ul><?cs
   if:len(links.prev) ?>
    <li class="first<?cs if:!len(links.up) && !len(links.next) ?> last<?cs /if ?>">
     &larr; <a href="<?cs var:links.prev.0.href ?>" title="<?cs
       var:links.prev.0.title ?>">前のメール</a>
    </li><?cs
   /if ?><?cs
   if:len(links.up) ?>
    <li class="<?cs if:!len(links.prev) ?>first<?cs /if ?><?cs
                    if:!len(links.next) ?> last<?cs /if ?>">
     <a href="<?cs var:links.up.0.href ?>" title="<?cs
       var:links.up.0.title ?>">リストに戻る</a>
    </li><?cs
   /if ?><?cs
   if:len(links.next) ?>
    <li class="<?cs if:!len(links.prev) && !len(links.up) ?>first <?cs /if ?>last">
     <a href="<?cs var:links.next.0.href ?>" title="<?cs
       var:links.next.0.title ?>">次のメール</a> &rarr;
    </li><?cs
   /if ?></ul><?cs
  /if ?><?cs
 /with ?>
</div>


<div id="content" class="mailarc">

<?cs if mailarc.reflist.count >= 2 ?>
 <form id="prefs" method="get" action="">
  <div class="title">関連するメール</div>
  <?cs each item = mailarc.reflist.items ?>
  <div>
  <?cs if item.href ?><a class="subject" href="<?cs var:item.href ?>"><?cs var:item.subject ?>  </a>
  <?cs else ?><?cs var:item.subject ?>
  <?cs /if ?>
  </div>
  <div><?cs var:item.fromname ?></div>
  <?cs /each ?>
 </form>
<?cs /if ?>

<h1><?cs var:mailarc.subject ?></h1>
<h2><?cs var:mailarc.from ?> <?cs var:mailarc.senddate ?></h2>

<p >
<?cs var:mailarc.dumy_page_html ?>
</p>

 <?cs if mailarc.action == "delete" ?>
  <h1>Delete <?cs
   if:?mailarc.version ?>version <?cs var:mailarc.version ?> of <?cs /if ?><a href="<?cs
    var:mailarc.current_href ?>"><?cs var:mailarc.page_name ?></a></h1>
  <form action="<?cs var:mailarc.current_href ?>" method="post">
   <input type="hidden" name="action" value="delete" />
   <p><strong>Are you sure you want to <?cs
    if:!?mailarc.version ?>completely <?cs /if ?>delete <?cs
    if:?mailarc.version ?>version <?cs var:mailarc.version ?> of <?cs
    /if ?>this page?</strong><br /><?cs
   if:mailarc.only_version ?>
    This is the only version the page, so the page will be removed
    completely!<?cs
   /if ?><?cs
   if:?mailarc.version ?>
    <input type="hidden" name="version" value="<?cs var:mailarc.version ?>" /><?cs
   /if ?>
   This is an irreversible operation.</p>
   <div class="buttons">
    <input type="submit" name="cancel" value="Cancel" />
    <input type="submit" value="Delete <?cs
      if:?mailarc.version ?>this version<?cs else ?>page<?cs /if ?>" />
   </div>
  </form>
 
 
 <?cs else ?>
  <?cs if mailarc.action == "view" ?>
   <div class="mailarcpage">
    <div id="searchable"><?cs var:mailarc.page_html ?></div>
   </div>
   <?cs if:len(mailarc.attachments) ?>
    <h3 id="tkt-changes-hdr">Attachments</h3>
    <ul class="tkt-chg-list"><?cs
     each:attachment = mailarc.attachments ?><li class="tkt-chg-change"><a href="<?cs
      var:attachment.href ?>"><?cs
      var:attachment.filename ?></a> (<?cs var:attachment.size ?>) -<?cs
      if:attachment.description ?><q><?cs var:attachment.description ?></q>,<?cs
      /if ?> added by <?cs var:attachment.author ?> on <?cs
      var:attachment.time ?>.</li><?cs
     /each ?>
    </ul>
  <?cs /if ?>
  <script type="text/javascript">
   addHeadingLinks(document.getElementById("searchable"));
  </script>
 <?cs /if ?>
 <?cs /if ?>
</div>

<?cs include "footer.cs" ?>
