<form style="background: var(--fco-sheet-background-colour); color:var(--fco-sheet-text-colour); width:100%; height: 100%; border:none !important; padding:10px">
    <div style="display:flex; flex-direction:row">
        <table style="background-color:transparent; border:none; width:100px"><tr><td><img  data-uuid="{{this.document.uuid}}" class="fco_popviewable" width="100" height="auto" style="padding:0px; border:0;" id="avatar" src="{{document.img}}"></img></td></tr></table>
        <textarea class="mfate-sheet__identity-name" rows="2" disabled="disabled" style="width:70%">{{document.name}}</textarea>
        <span style="vertical-align:middle; width:30%">
            <div {{#unless this.GM}} style="opacity:0.6" {{/unless}}>{{localize 'fate-core-official.container'}}</div>
            <div>
                <input type="checkbox" name="system.container.isContainer" {{#if system.container.isContainer}}checked="checked"{{/if}}{{#if (gt numExtras 1)}}disabled="disabled"{{/if}}{{#if (gt numExtras 0)}}{{#if system.container.isContainer}} disabled="disabled"{{/if}}{{/if}} {{#unless this.GM}}disabled="disabled"{{/unless}}></input> 
            </div>
            {{#if system.container.isContainer}}
            <div>Movable?</div>
            <div><input type="checkbox" name="system.container.movable" {{#if system.container.movable}}checked="checked"{{/if}}{{#unless this.GM}}disabled="disabled"{{/unless}}></input></div>{{/if}}
            {{#if system.container.isContainer}}<div>Locked?</div><div><input type="checkbox" name="system.container.locked" {{#if system.container.locked}}checked="checked"{{/if}} {{#unless this.GM}}disabled="disabled"{{/unless}}></input>
            <label style="padding-left:25px; vertical-align:top; color:var(--fco-sheet-text-colour);">Security: </label><input class="mfate-sheet__meta-value" style="width:3rem; vertical-align:top; background-color:var(--fco-sheet-input-colour) !important; color:var(--fco-sheet-text-colour);" type="number" name="system.container.security" value="{{system.container.security}}" {{#unless this.GM}}disabled="disabled"{{/unless}}></input></div>{{/if}}        
            {{#if system.container.isContainer}}</span>{{/if}}
    </div>

    {{#if (expanded this.document '_extras')}}<div style="height:82%">{{else}}<div class="mfate-extras-collapsed">{{/if}}
        {{#unless viewable}}This container is closed, locked, or too far away for you to see what's inside it.{{else}}
        <div class="mfate-panel__header">
            <div class="mfate-panel__header-label">
                <div {{#if (expanded this.document '_extras')}}class="i icon fas fa-compress mfate-panel__header-button" title="{{localize 'fate-core-official.Minimise'}}" {{else}}title="{{localize 'fate-core-official.Maximise'}}" class="i icon fas fa-expand mfate-panel__header-button"{{/if}} name="expandExtrasPane" title="{{localize 'fate-core-official.Maximise'}}"></div>{{localize 'fate-core-official.Extras'}}
                {{#if (expanded this.document '_extras')}}
                    {{#unless system.container.isContainer}}
                        {{#if (lt numExtras 1)}}
                            <div title="{{localize 'fate-core-official.AddANewExtra'}}" style="font-size:medium; padding-top:5px; padding-left:5px; padding-right:5px; padding-bottom:5px; float:right;" name="add_player_extra" i icon class="fas fa-plus mfate-panel__header-button"></div>
                            {{else}}
                        {{/if}}
                        {{else}}
                            <div title="{{localize 'fate-core-official.AddANewExtra'}}" style="font-size:medium; padding-top:5px; padding-left:5px; padding-right:5px; padding-bottom:5px; float:right;" name="add_player_extra" i icon class="fas fa-plus mfate-panel__header-button"></div>
                    {{/unless}}
                {{/if}}
                {{#if (expanded this.document '_extras')}}<div class="i icon fas fa-expand mfate-panel__header-button" style="font-size:medium; padding-top:5px; padding-left:5px; padding-right:5px; padding-bottom:5px; float:right;" name="expandExtras" title="{{localize 'fate-core-official.MaximiseAll'}}"></div>{{/if}}
                {{#if (expanded this.document '_extras')}}<div class="i icon fas fa-compress mfate-panel__header-button" style="font-size:medium; padding-top:5px; padding-left:5px; padding-right:5px; padding-bottom:5px; float:right;" name="compressExtras" title="{{localize 'fate-core-official.MinimiseAll'}}"></div>{{/if}}                        
            </div>
        </div>
    {{#if (expanded this.document '_extras')}}
    <div class="mthing-extras__content" id="mthing-content">
        <div class="fate-extras__content-body" name="extras_body">
            <div class="fate-extras__row">
                {{#each items}}
                <div name="item_header" class="mf_draggable" draggable="true" id="{{../this.document.id}}_{{this.id}}" data-item="{{this.uuid}}" data-item-id="{{this.id}}">
                <div class = "fate-extras__row-header">
                    <button type="button" name="expandExtra" style="color:var(--fco-sheet-text-colour); width:20px; height:20px; float:left; background-color:transparent; border:none" {{#if (expanded ../this.document (fco_concat this.id '_extra'))}}icon class="fas fa-compress fu_button" title="{{localize 'fate-core-official.Minimise'}}"{{else}}icon class = "fas fa-expand fu_button" title="{{localize 'fate-core-official.Maximise'}}"{{/if}} id="{{this.id}}_expandExtra"></button>&nbsp&nbsp{{{this.richName}}}
                    {{#if ../this.GM}}<button i icon class="fas fa-trash fate-extras__row-header-button fu_button" type="button" name="delete_extra" id="{{this.id}}_delete"></button>{{/if}}
                    {{#if ../this.GM}}<button name="edit_extra" type="button" i icon class="fas fa-edit  fate-extras__row-header-button fu_button" id="{{this.id}}_edit"></button>{{/if}}
                    <button name="grab_extra" type="button" i icon class="fas fa-hand-paper  fate-extras__row-header-button fu_button" id="{{this.id}}_{{../this.document.id}}_grab" enabled="enabled"></button>
                </div>
                <div class="fate-extras__row-body">
                            <div class="fate-extras__row-body-content">{{#unless (expanded ../this.document (fco_concat this.id '_extra'))}}{{else}}{{{this.richDesc}}}{{/unless}}</div>
                </div>
                </div>
                {{/each}}
            </div>
        </div>
    </div>
    {{/if}}
    {{/unless}}
    {{#if system.container.isContainer}}{{#unless system.container.locked}}{{#if (gt numExtras 0)}}<button type="button" style="border:2px groove var(--fco-foundry-interactable-color); background-color:var(--fco-sheet-input-colour); color:var(--fco-sheet-text-colour); width:150px" name="container_take_all">Take All</button>{{/if}}{{/unless}}{{#if system.container.movable}}<button type="button" style="border:2px groove var(--fco-foundry-interactable-color); background-color:var(--fco-sheet-input-colour); color:var(--fco-sheet-text-colour); width:150px" name="container_take">Take Container</button>{{/if}}{{/if}}
</form>
