<section class="ship-domain-command">
    {{#if domain.hasExplicitOwner}}
    <button type="button" class="ship-domain-command-card" data-ship-domain-drop="owner" data-ship-domain-node="{{domain.owner.nodeId}}" {{#if domain.canManage}}data-ship-domain-menu="owner" draggable="true" title="Open or drag {{domain.owner.name}}. Right-click to remove this owner."{{else}}title="Open {{domain.owner.name}}"{{/if}}>
        <span class="nexus-entity-image {{#if (eq domain.owner.entityType 'faction')}}is-emblem{{else}}is-person{{/if}}">{{#if domain.owner.imageSrc}}<img src="{{domain.owner.imageSrc}}" alt="" draggable="false">{{else}}<i class="fas fa-shield-halved"></i>{{/if}}</span>
        <span><em><i class="fas fa-shield-halved"></i> {{domain.ownerLabel}}</em><strong>{{domain.owner.name}}</strong><small>{{domain.owner.subtitle}}</small></span>
    </button>
    {{else if domain.hasCaptain}}
    <div class="ship-domain-command-card is-derived-owner" data-ship-domain-drop="owner" title="This independent ship is owned and operated by its captain. Drop a Person or Organization here to record a separate owner.">
        <i class="fas fa-shield-halved"></i><span><em>Independent Ship</em><strong>Captain-owned</strong>{{#if domain.canManage}}<small>Drop a new owner here.</small>{{/if}}</span>
    </div>
    {{else}}
    <div class="ship-domain-command-card is-empty" data-ship-domain-drop="owner"><i class="fas fa-shield-halved"></i><span><em>Independent Ship</em><strong>No owner recorded</strong>{{#if domain.canManage}}<small>Drop a Person or Organization here.</small>{{/if}}</span></div>
    {{/if}}

    {{#if domain.hasCaptain}}
    <button type="button" class="ship-domain-command-card" data-ship-domain-drop="captain" data-ship-domain-node="{{domain.captain.nodeId}}" {{#if domain.canManage}}data-ship-domain-menu="captain" draggable="true" title="Open or drag {{domain.captain.name}}. Right-click to remove this captain."{{else}}title="Open {{domain.captain.name}}"{{/if}}>
        <span class="nexus-entity-image is-person">{{#if domain.captain.imageSrc}}<img src="{{domain.captain.imageSrc}}" alt="" draggable="false">{{else}}<i class="fas fa-user-astronaut"></i>{{/if}}</span>
        <span><em><i class="fas fa-crown"></i> Captained by</em><strong>{{domain.captain.name}}</strong><small>{{domain.captain.subtitle}}</small></span>
    </button>
    {{else}}
    <div class="ship-domain-command-card is-empty" data-ship-domain-drop="captain"><i class="fas fa-crown"></i><span><em>Captained by</em><strong>No captain assigned</strong>{{#if domain.canManage}}<small>Drop a Person here to appoint a captain.</small>{{/if}}</span></div>
    {{/if}}

    {{#if domain.hasLocation}}
    <button type="button" class="ship-domain-command-card is-location" data-ship-domain-drop="location" data-ship-domain-node="{{domain.location.nodeId}}" {{#if domain.canManage}}draggable="true" title="Open or drag {{domain.location.name}}"{{/if}}>
        <span class="nexus-entity-image is-place">{{#if domain.location.imageSrc}}<img src="{{domain.location.imageSrc}}" alt="" draggable="false">{{else}}<i class="fas fa-location-crosshairs"></i>{{/if}}</span>
        <span><em><i class="fas fa-location-crosshairs"></i> Current Location</em><strong>{{domain.location.name}}</strong><small>{{domain.locationModeLabel}}{{#if domain.location.adopted}} &middot; Existing marker{{/if}}</small></span>
    </button>
    {{else}}
    <div class="ship-domain-command-card is-location is-empty" data-ship-domain-drop="location"><i class="fas fa-location-crosshairs"></i><span><em>Current Location</em><strong>Location unknown</strong>{{#if domain.canManage}}<small>Drop a Place here{{#if domain.automaticLocationTracking}}, or place this Ship on a Scene{{/if}}.</small>{{/if}}</span></div>
    {{/if}}
</section>
