<!--
Copyright 2016 Google Inc. All rights reserved.
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.
-->

{{define "content"}}
<div class="row">
  <div class="col-xs-12">
    <div id="panel-fileinfo" class="panel panel-default collapse in" data-toggle="collapse">
      <span class="sdk-version-21"><button id="toggle-fileinfo" class="glyphicon glyphicon-remove btn btn-default btn-right btn-xxs" type="button" data-toggle="collapse" data-target="#panel-fileinfo"></button></span>
      <div class="panel-body">
        <table id="fileinfo" class="fileinfo-table">
          <tr class="sdk-version-21">
            <td><b>File:</b> {{.Filename}}</td>
            <td><b>Build:</b> {{.CheckinSummary.BuildFingerprint}}</td>
          </tr>
          <tr>
            <td><b>Device:</b> {{.DeviceModel}} {{.CheckinSummary.Build}}</td>
            <td><b>Android ID:</b> {{.DeviceID}}</td>
          </tr>
        </table>
        <div id="btns-dialog">
          {{if .Error}}
          <a id="btn-errors" class="btn btn-default btn-toggle" data-toggle="modal" data-target="#dialog" href="#errors">Errors</a>
          <pre id="errors" style="display: none;">{{.Error}}</pre>
          {{end}}
          {{if .Warning}}
          <a id="btn-warnings" class="btn btn-default btn-toggle" data-toggle="modal" data-target="#dialog" href="#warnings">Warnings</a>
          <pre id="warnings" style="display: none;">{{.Warning}}</pre>
          {{end}}
        </div>
        {{if .Overflow}}
        <div id="dialog-message" data-toggle="tooltip" title="Overflow detected">
         Battery history log overflow has been detected for the uploaded bugreport.
         Please note analysis should not be entirely trusted due to overflow.
        </div>
        {{end}}
      </div>
    </div>
  </div>
  <div class="col-xs-12">
    <div id="panel-historian" class="panel panel-default panel-tabs collapse in">
      <div class="panel-heading">
        <ul class="nav nav-tabs">
          <li id="tab-historian-v2" class="active sdk-version-21" data-toggle="tooltip" title="Data visualization for history stats, version 2">
            <a href="#historian-v2" data-toggle="tab">Historian V2</a>
          </li>
          <li id="tab-historian" data-toggle="tooltip" title="Data visualization for history stats, version 1">
            <a href="#historian" data-toggle="tab">Historian</a>
          </li>
          <span class="sdk-version-21"><span id="toggle-historian" class="glyphicon glyphicon-remove btn btn-default btn-right-tabs btn-xxs" data-toggle="collapse" data-target="#panel-historian"></span></span>
        </ul>
      </div>
      <div class="panel-body">
        <div class="tab-content">
          <!-- historian v2 -->
          <div id="historian-v2" class="tab-pane fade in active" >
            <div class="graph"></div>
          </div>
          <!-- historian v1 -->
          <div id="historian" class="tab-pane fade">
            <div class="loading">Please wait, drawing chart...</div>
            <div id="historian-chart" class="hidden">{{ .Historian }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="col-xs-12 sdk-version-21">
    <div class="table-sidebar col-xs-3">
      {{template "tablesidebar" .}}
    </div>
    <div class="col-xs-9">
      <div class="row">
        <div id="panel-tables" class="panel panel-default panel-tabs">
          {{template "tables" .}}
        </div>
      </div>
    </div>
  </div>
</div>
{{end}}
