github.com/aychain/blockbook@v0.1.1-0.20181121092459-6d1fc7e07c5b/static/templates/tx.html (about)

     1  {{define "specific"}}{{$cs := .CoinShortcut}}{{$tx := .Tx}}{{$txSpecific := .TxSpecific}}
     2  <h1>Transaction</h1>
     3  <div class="alert alert-data ellipsis">
     4      <span class="data">{{$tx.Txid}}</span>
     5  </div>
     6  <h3>Summary</h3>
     7  <div class="data-div">
     8      <table class="table data-table">
     9          <tbody>
    10              {{if $tx.Confirmations}}
    11              <tr>
    12                  <td style="width: 25%;">Mined Time</td>
    13                  <td class="data">{{formatUnixTime $tx.Blocktime}}</td>
    14              </tr>{{end}}
    15              <tr>
    16                  <td style="width: 25%;">In Block</td>
    17                  <td class="ellipsis data">{{if $tx.Confirmations}}{{$tx.Blockhash}}{{else}}Unconfirmed{{end}}</td>
    18              </tr>
    19              {{if $tx.Confirmations}}
    20              <tr>
    21                  <td>In Block Height</td>
    22                  <td class="data"><a href="/block/{{$tx.Blockheight}}">{{$tx.Blockheight}}</a></td>
    23              </tr>{{end}}
    24              <tr>
    25                  <td>Total Input</td>
    26                  <td class="data">{{formatAmount $tx.ValueIn}} {{$cs}}</td>
    27              </tr>
    28              <tr>
    29                  <td>Total Output</td>
    30                  <td class="data">{{formatAmount $tx.ValueOut}} {{$cs}}</td>
    31              </tr>
    32              {{if $tx.Fees}}
    33              <tr>
    34                  <td>Fees</td>
    35                  <td class="data">{{formatAmount $tx.Fees}} {{$cs}}</td>
    36              </tr>{{end}}
    37          </tbody>
    38      </table>
    39  </div>
    40  <h3>Details</h3>
    41  <div class="data-div">
    42      {{template "txdetail" .}}
    43  </div>
    44  <div class="data-div">
    45      <h5>Raw Transaction</h5>
    46      <div class="alert alert-data" style="word-wrap: break-word; font-size: smaller;">
    47          <pre id="txSpecific"></pre>
    48      </div>
    49      <script type="text/javascript">
    50          txSpecific = {{ $txSpecific }};
    51          function syntaxHighlight(json) {
    52              json = JSON.stringify(json, undefined, 2);
    53              json = json.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
    54              return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
    55                  var cls = 'number';
    56                  if (/^"/.test(match)) {
    57                      if (/:$/.test(match)) {
    58                          cls = 'key';
    59                      } else {
    60                          cls = 'string';
    61                      }
    62                  } else if (/true|false/.test(match)) {
    63                      cls = 'boolean';
    64                  } else if (/null/.test(match)) {
    65                      cls = 'null';
    66                  }
    67                  return '<span class="' + cls + '">' + match + '</span>';
    68              });
    69          }
    70          document.getElementById('txSpecific').innerHTML = syntaxHighlight(txSpecific);
    71      </script>
    72  </div>
    73  {{end}}