<commit_before><style>
    .ui[class*="top attached"].label,
    .ui.attached.label {
        padding: 5px !important;
    }

    .search {
        padding: 0 1em;
    }
    .secondary > .header.item {
        width: 100%;
    }
    .secondary.menu.item > .right {
        float: right;
        padding-right: 0;
    }
    .inverted.large.icon {
        text-shadow: -2px 0 rgba(72,72,74,1.0), 0 2px rgba(72,72,74,1.0), 2px 0 rgba(72,72,74,1.0), 0 -1px rgba(72,72,74,1.0);
        cursor: pointer;
    }
    .inverted.large.icon:hover {
        color: rgba(72,72,74,1.0);
        cursor: pointer;
    }
    .filter-pill {
        margin: 5px;
        border-radius: 1rem;
        min-width: 140px;
        background-color: rgb(203,203,203);
        color: rgb(121,121,121);
        text-align: left;
        font-size: 0.8rem;
        vertical-align: bottom;
        padding: 2px;
    }
    button:focus {
        outline:0;
    }
    .filter-pill .filter-text {
        float:left;
        margin: 4px;
    }

    .filter-pill .icon.close {
        vertical-align: bottom;
        margin: 4px;
        opacity: .7;
        float: right;
        cursor: pointer;
    }

    .filter-pill .icon.close:hover {
        opacity: 1.0;
        color: #fff;
    }
    .ui.button.tertiary {
        padding: 0;
        box-shadow: none !important;
        background: none !important;
        -webkit-font-smoothing: antialiased;
        font-weight: 500;
    }
    .ui.button.tertiary:hover {
        color: #2185d0;
        text-decoration: underline;
    }
    .ui.button.tertiary:not(:hover) {
        color: rgb(94, 139, 188);
    }
    .ui.icon.input > i.icon {
        right: 1em;
    }
    .ui.search {
        font-size: 1em;
        width: 100%;
    }

    img {
        display: block;
        height: auto;
        margin: auto;
    }

    .text-block.card h2 {
        position: absolute;
        width: 100%;
        height: 140px;
        margin-top: 0%;
        background: rgba(40, 59, 73, 0.5);
    }

    .text-block.card h2 i {
        padding-left: 32%;
        padding-top: 20%;
        position: absolute;
        font-size: 3em;
        font-weight: 100;
    }

    .text-block.card img {
        opacity: .4;
    }

    .pic {
        object-fit: cover;
    }

    span.zoom-icon {
        position: absolute;
        right: 0;
        top: 0;
        filter: alpha(opacity=50);
        -moz-opacity: 0.8;
        -khtml-opacity: 0.8;
        opacity: 0.8;
        width: 80px;
    }

    .middle.text {
        color: #666666;
        text-wrap: normal;
        text-align: justify
    }
</style>


<div class="ui inverted grey">
    <div class="ui grid">
        <div class="twelve wide column" id="tale-filters">
            <div id="tale-filter-items" class="ui compact menu">
                <a class="item clickable tale-filter-item {{if (eq filter 'All') 'active'}}" {{action 'selectFilter' 'All'}}>
                    All Tales
                </a>
                <a class="item clickable tale-filter-item {{if (eq filter 'Mine') 'active'}}" {{action 'selectFilter' 'Mine'}}>
                    My Tales
                </a>
            </div>
        </div>
        <div class="four wide column">
            <div id="tale-search" class="search">
                <div class="ui icon search input">
                    {{input class="prompt" placeholder="Search tales..." value=searchStr key-up="searchFilter"}}
                    <i class="search icon"></i>
                </div>
                <div class="results"></div>
            </div>
        </div>
    </div>
    
    {{#unless modelsInView.length}}
        <div class="ui center aligned segment" style="color: black;">
            There are no tales to display for applied filter: {{filter}}
        </div>
    {{/unless}}
    {{#if loadingTales}}
        <div style="display: inline">
            <div class="creating-tale-message">
                {{message}}
                <div class="centered"><i class="fa fa-4x fa-circle-notch fa-spin" aria-hidden="true"></i></div>
            </div>
        </div>
    {{else}}
        {{#if (and modelsInView.length (eq listView true))}}
            <div id="tales-table" class="ui selectable {{guid}} doubling selectable cards tales-table-short-intro">
                <table class="table table-striped table-bordered table-condensed">
                    <thead>
                        <tr>
                            <th style="color: #515151; text-align: center;">Research</th>
                            <th style="color: #515151; text-align: center;"><div>Category</div></th>
                            <th style="color: #515151">Title</th>
                            <th style="color: #515151">Description</th>
                            <th style="color: #515151">Author</th>
                            <th style="color: #515151; text-align: center;">Run</th>
                        </tr>
                    </thead>
                    <tbody>
                        {{#each modelsInView as |model|}}
                            <tr>
                                <td>
                                    <div class="card">
                                        <div class="content" style="color: #515151">
                                            <div class="left floated meta">{{if model.copyOfTale 'Copied Tale' 'Original Tale'}}</div>
                                            <div class="left floated meta">{{if model.public 'PUBLIC' 'PRIVATE'}}</div>
                                            <div class="blurring dimmable fluid image" style="min-height: 48px;">
                                                <div class="ui dimmer">
                                                    <div class="content">
                                                        <div class="center">
                                                            {{#if showLink}}
                                                                {{#link-to 'run.view' model._id (query-params tab="metadata") class="ui inverted button"}}View{{/link-to}}
                                                            {{/if}}
                                                            {{#if showSelect}}
                                                                <div class="ui inverted button" {{action 'select' model}}>Select</div>
                                                            {{/if}}
                                                        </div>
                                                    </div>
                                                </div>

                                                <img src="{{model.illustration}}" height="48" style="height: 48px; width: 48px" class="pic" />
                                                <span class="zoom-icon">
                                                    <img src="{{model.icon}}" width="32" height="32" style="height: 32px;width: 32px;margin: -0.5rem 1rem;">
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td style="text-align: center">
                                    <div style="text-transform:uppercase;color:#ba975e;font-weight: 500;font-size:75%;">
                                        {{model.category}}
                                    </div>
                                </td>
                                <td>
                                    <div style="font-weight:500;padding: 0 0 5px 0;color:#515151;font-size:75%;"> {{truncate-name model.title}} </div>
                                </td>
                                <td>
                                    <div style="max-height:120px; overflow: auto; color: #515151;">
                                        {{convert-markdown model.description}}
                                    </div>
                                </td>
                                <td>
                                    <div style="color: #67c096; font-size: 75%">{{tale-authors-to-str model.authors model.creator}}</div>
                                </td>
                                <td style="text-align: center;">
                                    {{#if (or (eq model.launchStatus 'starting') (and model.instance (eq model.instance.status 0)))}}
                                        <div class="ui message">
                                            <div class="ui segment" style="height:75%;">
                                                <div class="ui active inverted dimmer">
                                                    <div class="ui text loader" style="font-size:1rem;">Running Tale {{truncate-name model.title}}</div>
                                                </div>
                                            </div>
                                        </div>
                                    {{else if (or (eq model.launchStatus 'started') (and model.instance (eq model.instance.status 1)))}}
                                        <div class="ui green icon message">
                                            <div class="content">
                                                <div class="header">
                                                    <i class="checkmark icon"></i>
                                                    <p>The Tale '{{truncate-name model.title}}' is now running !</p>
                                                </div>
                                                <div class="ui buttons">
                                                  {{#link-to 'run.view' model._id}}
                                                    <div class="ui mini green icon button" style="margin-right: 10px">
                                                      <i class="play icon"></i>
                                                      Go to Tale
                                                    </div>
                                                  {{/link-to}}
                                                </div>
                                            </div>
                                        </div>
                                    {{else if (or (eq model.launchStatus 'error') (and model.instance (eq model.instance.status 2)))}}
                                        <div class="ui red icon message">
                                            <i class="remove circle icon"></i>
                                            <div class="content">
                                                <div class="header">
                                                    <p>The Tale '{{truncate-name model.title}}' could not be run !</p>
                                                    <p>{{model.launchError}}</p>
                                                </div>
                                            </div>
                                        </div>
                                    {{else if (or (not model.launchStatus) (not model.instance))}}
                                        <div class="ui mini green icon button" {{action 'launchTale' model}}>
                                            <i class="play round icon"></i>
                                        </div>
                                    {{/if}}
                                </td>
                            </tr>
                        {{/each}}
                    </tbody>
                </table>
            </div>
        {{else}}
            <div id="tales-table" class="tales-table-short-intro" style="padding: 5px 20px 5px 20px; margin-bottom: 1em; margin-top: 1em;">
                {{#if (gt runningTales.length 0)}}
                    <div class="ui {{cardsPerRow}}  doubling selectable cards {{guid}}">
                        {{#each runningTales as |model|}}
                            <div class="tale card">
                                <div class="extra content">
                                    <div class="right floated meta">{{if model.public 'PUBLIC' 'PRIVATE'}}</div>
                                    <div class="left floated meta">{{if model.copyOfTale 'Copied Tale' 'Original Tale'}}</div>
                                </div>
                                <div class="blurring dimmable fluid tale image">
                                    <div class="ui dimmer">
                                        <div class="content">
                                            <div class="center">
                                                {{#if (and showLink model.instance)}}
                                                    {{#link-to 'run.view' model._id class="ui inverted button"}}View{{/link-to}}
                                                {{else if showLink}}
                                                    {{#link-to 'run.view' model._id (query-params tab="metadata") class="ui inverted button"}}View{{/link-to}}
                                                {{/if}}
                                                {{#if showSelect}}
                                                    <div class="ui inverted button" {{action 'select' model}}>Select</div>
                                                {{/if}}
                                                {{#if (and showDelete (gt model._accessLevel 0))}}
                                                    <a class="ui tiny bottom right attached label" {{action 'attemptDeletion' model}}>
                                                        <i class="red remove icon"></i>
                                                    </a>
                                                {{/if}}
                                            </div>
                                        </div>
                                    </div>
        
                                    <img src="{{model.illustration}}" height="160" style="height: 160px;" alt="Research Image" class="pic" />
                                    <span class="zoom-icon">
                                        <img src="{{model.icon}}" width="80" style="width: 80px;" alt="Compute Icon">
                                    </span>
        
                                </div>
        
                                <div class="content" style="color: #515151;height:155px;">
                                    <div style="text-transform: uppercase; color: #ba975e;font-weight: 700;">{{model.category}}</div>
                                    <div style="font-weight: 700; font-size: 120%; padding: 0 0 5px 0;height:77px;"> {{truncate-name model.title}} </div>
                                    <div style="padding: 4px"></div>
                                    <div>
                                        by <span style="color: #67c096">{{tale-authors-to-str model.authors model.creator}}</span>
                                    </div>
                                </div>
                                <div class="extra content">
                                    <div class="ui right floated compact basic icon buttons borderless {{if (or model.instance (lt model._accessLevel 1)) 'disabled'}}">
                                        <button class="ui secondary button borderless {{if (or model.instance (lt model._accessLevel 1)) 'disabled'}}" {{action 'attemptDeletion' model}}
                                                style="cursor:{{if model.instance 'not-allowed' 'pointer'}}!important;"
                                                data-tooltip="{{if model.instance 'You must shut down your running instances to delete this Tale' 'Delete this Tale'}}{{if (lt model._accessLevel 1) 'You do not own this Tale'}}"
                                                data-position="top right">
                                            <i class="icon trash"></i>
                                        </button>
                                    </div>
                                    {{#if (or (or (eq model.launchStatus 'starting') (eq model.launchStatus 'stopping')) (and model.instance (eq model.instance.status 0)))}}
                                        <button class="ui basic primary loading compact button" disabled="true">
                                            <i class="fas fa-pulse fa-spinner icon"></i>
                                            Please Wait
                                        </button>
                                    {{else if (or (eq model.launchStatus 'started') (and model.instance (eq model.instance.status 1)))}}
                                        <button class="ui basic primary compact button borderless" {{action 'stopTale' model}}>
                                            <i class="stop icon"></i>
                                            Stop Tale
                                        </button>
                                    {{else if (or (eq model.launchStatus 'error') (and model.instance (eq model.instance.status 2)))}}
                                        <button class="ui basic negative compact button borderless" {{action 'startTale' model}}>
                                            <i class="exclamation circle icon"></i>
                                            Error
                                        </button>
                                    {{else if (or (not model.launchStatus) (not model.instance))}}
                                        <button class="ui basic primary compact button borderless" {{action 'startTale' model}}>
                                            <i class="play icon"></i>
                                            Run Tale
                                        </button>
                                    {{/if}}
                                </div>
                                
                            
                                {{!-- Display launch error, if necessary --}}
                                {{#if model.launchError}}
                                <div class="extra content" style="height:0;margin:0;padding:0;">
                                    <div class="ui tiny red message" style="max-height:200px;margin-top:5px;margin-bottom:20px;">
                                        <i class="close icon" {{action 'dismissLaunchError' model}}></i>
                                        <p>{{model.launchError}}</p>
                                    </div>
                                </div>
                                {{/if}}
                            </div>
                        {{/each}}
                    </div>
                    <p style="font-size: 1.1rem; margin-top:20px; color: rgba(0,0,0,0.87);">Currently running: <i>{{runningTales.length}} Tales (out of 2 maximum)</i></p>
                        
                    <hr />
                {{/if}}
                        
                <div class="ui {{cardsPerRow}} doubling selectable cards {{guid}}">
                   {{#each modelsInView as |model|}}
                        <div class="tale card">
                            <div class="extra content">
                                <div class="right floated meta">{{if model.public 'PUBLIC' 'PRIVATE'}}</div>
                                <div class="left floated meta">{{if model.copyOfTale 'Copied Tale' 'Original Tale'}}</div>
                            </div>
                            <div class="blurring dimmable fluid tale image">
                                <div class="ui dimmer">
                                    <div class="content">
                                        <div class="center">
                                            {{#if (and showLink model.instance)}}
                                                {{#link-to 'run.view' model._id class="ui inverted button"}}View{{/link-to}}
                                            {{else if showLink}}
                                                {{#link-to 'run.view' model._id (query-params tab="metadata") class="ui inverted button"}}View{{/link-to}}
                                            {{/if}}
                                            {{#if showSelect}}<commit_msg>Adjust z-index on error message. Fixes #555<commit_after><style>
    .ui[class*="top attached"].label,
    .ui.attached.label {
        padding: 5px !important;
    }

    .search {
        padding: 0 1em;
    }
    .secondary > .header.item {
        width: 100%;
    }
    .secondary.menu.item > .right {
        float: right;
        padding-right: 0;
    }
    .inverted.large.icon {
        text-shadow: -2px 0 rgba(72,72,74,1.0), 0 2px rgba(72,72,74,1.0), 2px 0 rgba(72,72,74,1.0), 0 -1px rgba(72,72,74,1.0);
        cursor: pointer;
    }
    .inverted.large.icon:hover {
        color: rgba(72,72,74,1.0);
        cursor: pointer;
    }
    .filter-pill {
        margin: 5px;
        border-radius: 1rem;
        min-width: 140px;
        background-color: rgb(203,203,203);
        color: rgb(121,121,121);
        text-align: left;
        font-size: 0.8rem;
        vertical-align: bottom;
        padding: 2px;
    }
    button:focus {
        outline:0;
    }
    .filter-pill .filter-text {
        float:left;
        margin: 4px;
    }

    .filter-pill .icon.close {
        vertical-align: bottom;
        margin: 4px;
        opacity: .7;
        float: right;
        cursor: pointer;
    }

    .filter-pill .icon.close:hover {
        opacity: 1.0;
        color: #fff;
    }
    .ui.button.tertiary {
        padding: 0;
        box-shadow: none !important;
        background: none !important;
        -webkit-font-smoothing: antialiased;
        font-weight: 500;
    }
    .ui.button.tertiary:hover {
        color: #2185d0;
        text-decoration: underline;
    }
    .ui.button.tertiary:not(:hover) {
        color: rgb(94, 139, 188);
    }
    .ui.icon.input > i.icon {
        right: 1em;
    }
    .ui.search {
        font-size: 1em;
        width: 100%;
    }

    img {
        display: block;
        height: auto;
        margin: auto;
    }

    .text-block.card h2 {
        position: absolute;
        width: 100%;
        height: 140px;
        margin-top: 0%;
        background: rgba(40, 59, 73, 0.5);
    }

    .text-block.card h2 i {
        padding-left: 32%;
        padding-top: 20%;
        position: absolute;
        font-size: 3em;
        font-weight: 100;
    }

    .text-block.card img {
        opacity: .4;
    }

    .pic {
        object-fit: cover;
    }

    span.zoom-icon {
        position: absolute;
        right: 0;
        top: 0;
        filter: alpha(opacity=50);
        -moz-opacity: 0.8;
        -khtml-opacity: 0.8;
        opacity: 0.8;
        width: 80px;
    }

    .middle.text {
        color: #666666;
        text-wrap: normal;
        text-align: justify
    }
</style>


<div class="ui inverted grey">
    <div class="ui grid">
        <div class="twelve wide column" id="tale-filters">
            <div id="tale-filter-items" class="ui compact menu">
                <a class="item clickable tale-filter-item {{if (eq filter 'All') 'active'}}" {{action 'selectFilter' 'All'}}>
                    All Tales
                </a>
                <a class="item clickable tale-filter-item {{if (eq filter 'Mine') 'active'}}" {{action 'selectFilter' 'Mine'}}>
                    My Tales
                </a>
            </div>
        </div>
        <div class="four wide column">
            <div id="tale-search" class="search">
                <div class="ui icon search input">
                    {{input class="prompt" placeholder="Search tales..." value=searchStr key-up="searchFilter"}}
                    <i class="search icon"></i>
                </div>
                <div class="results"></div>
            </div>
        </div>
    </div>
    
    {{#unless modelsInView.length}}
        <div class="ui center aligned segment" style="color: black;">
            There are no tales to display for applied filter: {{filter}}
        </div>
    {{/unless}}
    {{#if loadingTales}}
        <div style="display: inline">
            <div class="creating-tale-message">
                {{message}}
                <div class="centered"><i class="fa fa-4x fa-circle-notch fa-spin" aria-hidden="true"></i></div>
            </div>
        </div>
    {{else}}
        {{#if (and modelsInView.length (eq listView true))}}
            <div id="tales-table" class="ui selectable {{guid}} doubling selectable cards tales-table-short-intro">
                <table class="table table-striped table-bordered table-condensed">
                    <thead>
                        <tr>
                            <th style="color: #515151; text-align: center;">Research</th>
                            <th style="color: #515151; text-align: center;"><div>Category</div></th>
                            <th style="color: #515151">Title</th>
                            <th style="color: #515151">Description</th>
                            <th style="color: #515151">Author</th>
                            <th style="color: #515151; text-align: center;">Run</th>
                        </tr>
                    </thead>
                    <tbody>
                        {{#each modelsInView as |model|}}
                            <tr>
                                <td>
                                    <div class="card">
                                        <div class="content" style="color: #515151">
                                            <div class="left floated meta">{{if model.copyOfTale 'Copied Tale' 'Original Tale'}}</div>
                                            <div class="left floated meta">{{if model.public 'PUBLIC' 'PRIVATE'}}</div>
                                            <div class="blurring dimmable fluid image" style="min-height: 48px;">
                                                <div class="ui dimmer">
                                                    <div class="content">
                                                        <div class="center">
                                                            {{#if showLink}}
                                                                {{#link-to 'run.view' model._id (query-params tab="metadata") class="ui inverted button"}}View{{/link-to}}
                                                            {{/if}}
                                                            {{#if showSelect}}
                                                                <div class="ui inverted button" {{action 'select' model}}>Select</div>
                                                            {{/if}}
                                                        </div>
                                                    </div>
                                                </div>

                                                <img src="{{model.illustration}}" height="48" style="height: 48px; width: 48px" class="pic" />
                                                <span class="zoom-icon">
                                                    <img src="{{model.icon}}" width="32" height="32" style="height: 32px;width: 32px;margin: -0.5rem 1rem;">
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </td>
                                <td style="text-align: center">
                                    <div style="text-transform:uppercase;color:#ba975e;font-weight: 500;font-size:75%;">
                                        {{model.category}}
                                    </div>
                                </td>
                                <td>
                                    <div style="font-weight:500;padding: 0 0 5px 0;color:#515151;font-size:75%;"> {{truncate-name model.title}} </div>
                                </td>
                                <td>
                                    <div style="max-height:120px; overflow: auto; color: #515151;">
                                        {{convert-markdown model.description}}
                                    </div>
                                </td>
                                <td>
                                    <div style="color: #67c096; font-size: 75%">{{tale-authors-to-str model.authors model.creator}}</div>
                                </td>
                                <td style="text-align: center;">
                                    {{#if (or (eq model.launchStatus 'starting') (and model.instance (eq model.instance.status 0)))}}
                                        <div class="ui message">
                                            <div class="ui segment" style="height:75%;">
                                                <div class="ui active inverted dimmer">
                                                    <div class="ui text loader" style="font-size:1rem;">Running Tale {{truncate-name model.title}}</div>
                                                </div>
                                            </div>
                                        </div>
                                    {{else if (or (eq model.launchStatus 'started') (and model.instance (eq model.instance.status 1)))}}
                                        <div class="ui green icon message">
                                            <div class="content">
                                                <div class="header">
                                                    <i class="checkmark icon"></i>
                                                    <p>The Tale '{{truncate-name model.title}}' is now running !</p>
                                                </div>
                                                <div class="ui buttons">
                                                  {{#link-to 'run.view' model._id}}
                                                    <div class="ui mini green icon button" style="margin-right: 10px">
                                                      <i class="play icon"></i>
                                                      Go to Tale
                                                    </div>
                                                  {{/link-to}}
                                                </div>
                                            </div>
                                        </div>
                                    {{else if (or (eq model.launchStatus 'error') (and model.instance (eq model.instance.status 2)))}}
                                        <div class="ui red icon message">
                                            <i class="remove circle icon"></i>
                                            <div class="content">
                                                <div class="header">
                                                    <p>The Tale '{{truncate-name model.title}}' could not be run !</p>
                                                    <p>{{model.launchError}}</p>
                                                </div>
                                            </div>
                                        </div>
                                    {{else if (or (not model.launchStatus) (not model.instance))}}
                                        <div class="ui mini green icon button" {{action 'launchTale' model}}>
                                            <i class="play round icon"></i>
                                        </div>
                                    {{/if}}
                                </td>
                            </tr>
                        {{/each}}
                    </tbody>
                </table>
            </div>
        {{else}}
            <div id="tales-table" class="tales-table-short-intro" style="padding: 5px 20px 5px 20px; margin-bottom: 1em; margin-top: 1em;">
                {{#if (gt runningTales.length 0)}}
                    <div class="ui {{cardsPerRow}}  doubling selectable cards {{guid}}">
                        {{#each runningTales as |model|}}
                            <div class="tale card">
                                <div class="extra content">
                                    <div class="right floated meta">{{if model.public 'PUBLIC' 'PRIVATE'}}</div>
                                    <div class="left floated meta">{{if model.copyOfTale 'Copied Tale' 'Original Tale'}}</div>
                                </div>
                                <div class="blurring dimmable fluid tale image">
                                    <div class="ui dimmer">
                                        <div class="content">
                                            <div class="center">
                                                {{#if (and showLink model.instance)}}
                                                    {{#link-to 'run.view' model._id class="ui inverted button"}}View{{/link-to}}
                                                {{else if showLink}}
                                                    {{#link-to 'run.view' model._id (query-params tab="metadata") class="ui inverted button"}}View{{/link-to}}
                                                {{/if}}
                                                {{#if showSelect}}
                                                    <div class="ui inverted button" {{action 'select' model}}>Select</div>
                                                {{/if}}
                                                {{#if (and showDelete (gt model._accessLevel 0))}}
                                                    <a class="ui tiny bottom right attached label" {{action 'attemptDeletion' model}}>
                                                        <i class="red remove icon"></i>
                                                    </a>
                                                {{/if}}
                                            </div>
                                        </div>
                                    </div>
        
                                    <img src="{{model.illustration}}" height="160" style="height: 160px;" alt="Research Image" class="pic" />
                                    <span class="zoom-icon">
                                        <img src="{{model.icon}}" width="80" style="width: 80px;" alt="Compute Icon">
                                    </span>
        
                                </div>
        
                                <div class="content" style="color: #515151;height:155px;">
                                    <div style="text-transform: uppercase; color: #ba975e;font-weight: 700;">{{model.category}}</div>
                                    <div style="font-weight: 700; font-size: 120%; padding: 0 0 5px 0;height:77px;"> {{truncate-name model.title}} </div>
                                    <div style="padding: 4px"></div>
                                    <div>
                                        by <span style="color: #67c096">{{tale-authors-to-str model.authors model.creator}}</span>
                                    </div>
                                </div>
                                <div class="extra content">
                                    <div class="ui right floated compact basic icon buttons borderless {{if (or model.instance (lt model._accessLevel 1)) 'disabled'}}">
                                        <button class="ui secondary button borderless {{if (or model.instance (lt model._accessLevel 1)) 'disabled'}}" {{action 'attemptDeletion' model}}
                                                style="cursor:{{if model.instance 'not-allowed' 'pointer'}}!important;"
                                                data-tooltip="{{if model.instance 'You must shut down your running instances to delete this Tale' 'Delete this Tale'}}{{if (lt model._accessLevel 1) 'You do not own this Tale'}}"
                                                data-position="top right">
                                            <i class="icon trash"></i>
                                        </button>
                                    </div>
                                    {{#if (or (or (eq model.launchStatus 'starting') (eq model.launchStatus 'stopping')) (and model.instance (eq model.instance.status 0)))}}
                                        <button class="ui basic primary loading compact button" disabled="true">
                                            <i class="fas fa-pulse fa-spinner icon"></i>
                                            Please Wait
                                        </button>
                                    {{else if (or (eq model.launchStatus 'started') (and model.instance (eq model.instance.status 1)))}}
                                        <button class="ui basic primary compact button borderless" {{action 'stopTale' model}}>
                                            <i class="stop icon"></i>
                                            Stop Tale
                                        </button>
                                    {{else if (or (eq model.launchStatus 'error') (and model.instance (eq model.instance.status 2)))}}
                                        <button class="ui basic negative compact button borderless" {{action 'startTale' model}}>
                                            <i class="exclamation circle icon"></i>
                                            Error
                                        </button>
                                    {{else if (or (not model.launchStatus) (not model.instance))}}
                                        <button class="ui basic primary compact button borderless" {{action 'startTale' model}}>
                                            <i class="play icon"></i>
                                            Run Tale
                                        </button>
                                    {{/if}}
                                </div>
                                
                            
                                {{!-- Display launch error, if necessary --}}
                                {{#if model.launchError}}
                                <div class="extra content" style="height:0;margin:0;padding:0;">
                                    <div class="ui tiny red message" style="max-height:200px;margin-top:5px;margin-bottom:20px;z-index:999;">
                                        <i class="close icon" {{action 'dismissLaunchError' model}}></i>
                                        <p>{{model.launchError}}</p>
                                    </div>
                                </div>
                                {{/if}}
                            </div>
                        {{/each}}
                    </div>
                    <p style="font-size: 1.1rem; margin-top:20px; color: rgba(0,0,0,0.87);">Currently running: <i>{{runningTales.length}} Tales (out of 2 maximum)</i></p>
                        
                    <hr />
                {{/if}}
                        
                <div class="ui {{cardsPerRow}} doubling selectable cards {{guid}}">
                   {{#each modelsInView as |model|}}
                        <div class="tale card">
                            <div class="extra content">
                                <div class="right floated meta">{{if model.public 'PUBLIC' 'PRIVATE'}}</div>
                                <div class="left floated meta">{{if model.copyOfTale 'Copied Tale' 'Original Tale'}}</div>
                            </div>
                            <div class="blurring dimmable fluid tale image">
                                <div class="ui dimmer">
                                    <div class="content">
                                        <div class="center">
                                            {{#if (and showLink model.instance)}}
                                                {{#link-to 'run.view' model._id class="ui inverted button"}}View{{/link-to}}
                                            {{else if showLink}}
                                                {{#link-to 'run.view' model._id (query-params tab="metadata") class="ui inverted button"}}View{{/link-to}}
                                            {{/if}}
                                            {{#if showSelect}}
{'fraction_non_alphanumeric': 0.11582709159445831, 'fraction_numerical': 0.01684045625887306, 'mean_word_length': 0.8720216275659824, 'pattern_counts': {'":': 0, '<': 465, '<?xml version=': 0, '>': 471, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 502, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6122734', 'n_tokens_mistral': 9536, 'n_tokens_neox': 8559, 'n_words': 2219}