<div class="main">
  <div class="block row">
    <div class="name">
      <a class="document" *ngIf="link" [href]="link" target="_blank">{{title}}</a>
      <span *ngIf="!link">{{title}}</span>
    </div>
    <div class="toggle" *ngIf="isExpandable"><button type="button" [class.less]="isExpanded" (click)="toggle()"></button></div>
  </div>
  <div class="block" *ngIf="registryOptions?.states && activeSince">
    <div class="state {{entry.state?.name}}">{{entry.state?.title}}</div>
    <div class="dates">
      <table class="default">
        <tr><td class="caption">Дата выдачи</td><td class="value">{{activeSince || '—'}}</td></tr>
        <tr><td class="caption">Срок действия</td><td class="value">{{activeTill || '—'}}</td></tr>
      </table>
    </div>
  </div>
  <div class="block" *ngIf="editMode">
    <div class="inline-menu default">
      <button *ngIf="registryOptions?.operations" type="button" class="add" (click)="add()"></button>
      <button type="button" class="move" title="Переместить"></button>
      <button type="button" class="edit" title="Редактировать" (click)="edit()"></button>
      <button type="button" class="delete" title="Удалить" (click)="delete()"></button>
    </div>
  </div>
</div>
<div class="details" *ngIf="isExpanded">
  <div class="block" *ngIf="registryOptions?.properties">
    <entry-properties [entry]="entry"></entry-properties>
  </div>
  <div class="block" *ngIf="registryOptions?.operations">
    <entry-operations [entry]="entry" [editMode]="editMode"></entry-operations>
  </div>
</div>
