<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">

<xi:include href="master.html" />
<?python
from turbogears.i18n.format import format_date
def dateandtime(d):
    return format_date(d, format="full", time_format=", %X %Z")
?>

<head>
    <meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
    <title py:content="pagetitle" />
    <style py:if="css" type="text/css">
${css}

.invisible { display: none !important; }
    </style>
    <script type="text/javascript">
    function toggle_linenos() {
        linenos = getFirstElementByTagAndClassName('TD', 'linenos', 'paste-container');
        if (linenos) {
            toggleElementClass('invisible', linenos);
            return false;
        } else {
            location.href = "${tg.url(['/paste', paste.guid], ln=1)}";
        }
        return true;
    }
    </script>
</head>
<body>
  <div id="paste-container">
    <div class="paste-header">
      <h3 py:if="paste.title" py:content="paste.title" />
      <p>${paste.format.display_name} paste, added on <span class="paste-date"
        py:content="dateandtime(paste.created)" /></p>
      <div py:replace="style_select(value=form_values, **form_params)" />
      <p><a href="${tg.url(['/new', paste.guid])}">Copy &amp; Edit</a> ∙
        <a href="${tg.url(['/download', paste.guid])}">Download</a> ∙
        <a href="${mailto_url}">Send link</a> ∙
        <a href="${tg.url(['/paste', paste.guid], ln=lineno)}"
           onclick="return toggle_linenos();">Toggle line numbers</a>
        </p>
    </div>
    <div id="paste-code" py:content="Markup(pretty_code)" xml:space="preserve" />
  </div>
</body>
</html>
