<div class="settlement-main settlement-main-{{ifThen isPlayMode 'play' 'edit'}}">
  <header class="settlement-header flexrow">
    <img class="actor-img" src="{{actor.img}}" data-edit="img" data-action="editImage" data-tooltip="{{actor.name}}" />
    <div class="settlement-header-info">
      <div class="settlement-name-row flexrow">
        {{formInput fields.name value=source.name rootId=partId disabled=isPlayMode}}
        {{#unless isPlayMode}}
        {{formInput systemFields.archetype value=system.archetype name="system.archetype" localize=true}}
        {{else}}
        <span class="settlement-archetype-badge">{{localize (lookup archetypeChoices system.archetype)}}</span>
        {{/unless}}
        <a class="control" data-action="toggleSheet" data-tooltip="OATHHAMMER.ToggleSheet" data-tooltip-direction="UP">
          <i class="fa-solid fa-{{ifThen isPlayMode 'lock' 'pen'}}"></i>
        </a>
      </div>
      <div class="settlement-stats flexrow">
        <div class="stat-item">
          <label>{{localize "OATHHAMMER.Label.Renown"}}</label>
          {{formInput systemFields.renown value=system.renown name="system.renown" disabled=isPlayMode}}
        </div>
        <div class="stat-item">
          <label>{{localize "OATHHAMMER.Label.Territory"}}</label>
          {{formInput systemFields.territory value=system.territory name="system.territory" disabled=isPlayMode}}
        </div>
        <div class="stat-item">
          <label>{{localize "OATHHAMMER.Label.Population"}}</label>
          {{formInput systemFields.population value=system.population name="system.population" disabled=isPlayMode}}
        </div>
        <div class="stat-item stat-item--flags">
          {{#unless isPlayMode}}
          <label>
            {{formInput systemFields.isCapital value=system.isCapital name="system.isCapital"}}
            {{localize "OATHHAMMER.Label.IsCapital"}}
          </label>
          <label>
            {{formInput systemFields.underSiege value=system.underSiege name="system.underSiege"}}
            {{localize "OATHHAMMER.Label.UnderSiege"}}
          </label>
          {{else}}
          {{#if system.isCapital}}<span class="settlement-badge settlement-badge--capital">★ {{localize "OATHHAMMER.Label.Capital"}}</span>{{/if}}
          {{#if system.underSiege}}<span class="settlement-badge settlement-badge--siege">⚔ {{localize "OATHHAMMER.Label.UnderSiege"}}</span>{{/if}}
          {{/unless}}
        </div>
      </div>
    </div>
  </header>
</div>
