<div id='notes' class='gga-table'>
  <div class='desc header' data-key='system.notes'>
    <div class='headermenu'>
      <span>{{localize 'GURPS.notes'}}</span>
      <i class='fas fa-plus addnoteicon'></i>
    </div>
  </div>
  <div class='ref header'>{{localize "GURPS.abbrevRef"}}</div>

  {{#each (flatlist system.notes)}}
    {{#if ../isEditing}}
      <div class='desc indent{{indent}} notemenu' data-key='system.notes.{{@key}}'>
        <div style="display: inline-flex; flex-flow: column nowrap; width: 100%;">
          <input name="system.notes.{{@key}}.title" type="text" value="{{this.title}}" title="Title" placeholder="Title">
          <textarea
            name='system.notes.{{@key}}.notes'
            class='gcs-input-ta'
            type='text'
            style='height:120px !important'
          >{{this.notes}}</textarea>
        </div>
      </div>
      <div class='ref' data-key='system.notes.{{@key}}'>
        <input name='system.notes.{{@key}}.pageref' class='gcs-input-sm5' type='text' value='{{this.pageref}}' />
      </div>
    {{else}}
      {{#unless isCollapsed}}
        <div class='notedraggable notesmenu' data-key='system.notes.{{@key}}'>
          <div class='desc indent{{indent}} dblclkedit'>
            <div class='gga-desc-text'>
              <div>
                {{#if hasContains}}<i class='fas fa-caret-down expandcollapseicon'></i>{{/if}}
                {{#if hasCollapsed}}<i class='fas fa-caret-right expandcollapseicon'></i>{{/if}}
              </div>
              <div class='tooltip gga-manual'>
                {{#if this.notes}}
                  {{#if title}}<b>{{{gurpslinkbr this.title}}}</b> {{/if}}{{{gurpslinkbr this.notes}}}
                {{else}}
                  {{localize "GURPS.noteBlank"}}<i class='far fa-laugh-wink'></i>
                {{/if}}
              </div>
              <div>
                {{#if (isUserCreated this)}}
                  <i class='fas fa-bookmark tooltip gga-usercreated'>
                    <span class='tooltiptext'>{{localize "GURPS.equipmentUserCreated"}}</span>
                  </i>
                {{/if}}
              </div>
            </div>
          </div>
        </div>
        <div class='ref'>{{{pdflinkext this}}}</div>
      {{/unless}}
    {{/if}}
  {{/each}}
</div>