<div ng-if="ctrl.loading">
  <spinner inline="true" />
  <em>Fetching changes&hellip;</em>
</div>

<div ng-if="!ctrl.loading">
  <button
    type="button"
    class="btn btn-danger pull-right"
    ng-click="ctrl.restore(ctrl.baseInfo.version)"
    ng-if="ctrl.isNewLatest"
  >
    <icon name="'history'"></icon>&nbsp;&nbsp;Restore to version {{ctrl.baseInfo.version}}
  </button>
  <section>
    <p class="small muted">
      <strong>Version {{ctrl.newInfo.version}}</strong> updated by
      <span>{{ctrl.newInfo.createdBy}} </span>
      <span>{{ctrl.newInfo.ageString}}</span>
      <span> - {{ctrl.newInfo.message}}</span>
    </p>
    <p class="small muted">
      <strong>Version {{ctrl.baseInfo.version}}</strong> updated by
      <span>{{ctrl.baseInfo.createdBy}} </span>
      <span>{{ctrl.baseInfo.ageString}}</span>
      <span> - {{ctrl.baseInfo.message}}</span>
    </p>
  </section>

  <div id="delta" diff-delta>
    <div class="delta-basic" compile="ctrl.delta.basic"></div>
  </div>

  <div class="gf-form-button-row">
    <button class="btn btn-secondary" ng-click="ctrl.getDiff('json')">View JSON Diff</button>
  </div>

  <div class="delta-html" ng-show="ctrl.diff === 'json'" compile="ctrl.delta.json"></div>
</div>
