<div id="TipInfoBox" class="card card-default">
  <div class="card-header" data-ng-if="Authentication.session.role === 'receiver'">
    <div class="row">
      <div class="col-md-12">
        <div class="float-left">
          <span class="input-group">
            <input id="assignLabelInput" type="text" class="form-control" data-ng-attr-placeholder="{{'Label' | translate}}" data-ng-model="tip.label" />
            <span class="input-group-append" data-uib-tooltip="{{'Label the report' | translate}}">
              <button id="assignLabelButton" class="btn btn-primary" data-ng-click="updateLabel(tip.label)">
                <i class="fa-solid fa-tag"></i>
              </button>
            </span>
          </span>
        </div>
        <div class="float-right" data-ng-if="Authentication.session.role === 'receiver'">
          <span data-ng-include="'views/partials/tip_submission_status.html'"></span>
        </div>
      </div>
    </div>
  </div>
  <div class="card-body">
    <table class="table table-borderless table-striped">
      <thead>
      <tr>
        <th class="TipInfoID" data-ng-if="Authentication.session.role === 'receiver'">
          <i class="fa-solid fa-hashtag"></i>
        </th>
        <th class="TipInfoContext" data-ng-if="public.contexts.length > 1">
          <i class="fa-solid fa-inbox"></i>
          <span data-translate>Channel</span>
        </th>
        <th class="TipInfoSubmissionDate">
          <i class="fa-solid fa-clock"></i>
          <span data-translate>Date</span>
        </th>
        <th class="TipInfoLastUpdate">
          <i class="fa-solid fa-clock"></i>
          <span data-translate>Last update</span>
        </th>
        <th class="TipInfoExpirationDate">
          <i class="fa-solid fa-hourglass"></i>
          <span data-translate>Expiration date</span>
        </th>
        <th class="TipInfoReadReceipt" data-ng-if="Authentication.session.role === 'receiver'">
          <i class="fa-solid fa-eye"></i>
        </th>
        <th class="TipInfoConnection" data-ng-if="Authentication.session.role === 'receiver'">
          <i class="fa-solid fa-network-wired"></i>
          <span>Tor</span>
        </th>
        <th class="TipInfoSubmissionStatus">
          <i class="fa-solid fa-dot-circle"></i>
          <span data-translate>Status</span>
        </th>
        <th class="TipInfoScore" data-ng-if="Authentication.session.role === 'receiver' && public.node.enable_scoring_system">
          <i class="fa-solid fa-flash"></i>
          <span data-translate>Score</span>
        </th>
      </tr>
      </thead>
      <tbody>
      <tr>
        <td class="TipInfoID" data-ng-if="Authentication.session.role === 'receiver'">{{tip.progressive}}</td>
        <td class="TipInfoContext" data-ng-if="public.contexts.length > 1">{{tip.context.name}}</td>
        <td class="TipInfoCreationDate">{{tip.creation_date | date:'dd-MM-yyyy HH:mm'}}</td>
        <td class="TipInfoUpdateDate">{{tip.update_date | date:'dd-MM-yyyy HH:mm'}}</td>
        <td class="TipInfoExpirationDate">
          <span data-ng-if="!Utils.isNever(tip.expiration_date)">{{tip.expiration_date | date:'dd-MM-yyyy HH:mm'}}</span>
          <span data-ng-if="Utils.isNever(tip.expiration_date)">-</span>
        </td>
        <td class="TipInfoLastAccess" data-ng-if="Authentication.session.role === 'receiver'">
          <i data-ng-if="tip.last_access >= tip.update_date" class="fa-solid fa-check"
             data-uib-tooltip="{{'The whistleblower has already read the last update' | translate}} ({{tip.last_access | date:'dd-MM-yyyy HH:mm'}})"></i>
          <i data-ng-if="tip.last_access < tip.update_date" class="fa-solid fa-times"
             data-uib-tooltip="{{'The whistleblower has not read the last update yet' | translate}}"></i>
        </td>
        <td class="TipInfoConnection" data-ng-if="Authentication.session.role === 'receiver'">
          <i data-ng-if="tip.tor" class="fa-solid fa-check"></i>
          <i data-ng-if="!tip.tor" class="fa-solid fa-times"></i>
        </td>
	<td class="TipInfoSubmissionStatus">{{tip.submissionStatusStr}}</td>
        <td class="TipInfoScore" data-ng-if="Authentication.session.role === 'receiver' && public.node.enable_scoring_system" data-ng-switch="tip.score">
          <span data-ng-switch-when="0">-</span>
          <span class="badge badge-primary" data-ng-switch-when="1" data-translate>Low</span>
          <span class="badge badge-primary" data-ng-switch-when="2" data-translate>Medium</span>
          <span class="badge badge-primary" data-ng-switch-when="3" data-translate>High</span>
        </td>
      </tr>
      </tbody>
    </table>
  </div>
</div>
