<commit_before><div name="publisher" class="small publisher" >

<div class="main header">
    <h2>Publish Tale
        <span>Create an immutable copy of your Tale with a DOI <i class="info circle blue icon main"></i></span>
    </h2>
</div>
<hr>
{{#ui-accordion as |execute|}}

{{!-- Accordion menu that lists tale files which can be (de)selected by the user --}}
<div class="title">
    <h2>
        <i class="far fa-hdd"></i> Data
        <span>
            Select the files needed to fully reproduce your work
             <i class="dropdown icon"></i>
        </span>
    </h2>
</div>

<div class="content files">
    <div class="ui basic segment file-picker">
            {{ui/files/file-picker inputData=inputData taleId=modalContext}}
    </div>
</div>

<hr>
{{!-- Accordion menu that lists the files which cannot be removed by the user --}}
<div class="title">
    <h2>
        <i class="desktop icon"></i> Environment
            <span>
            Everything required to recreate chosen compute environment - view only 
            <i class="dropdown icon"></i>
        </span>
    </h2>
</div>

<div class="content">
        <div class="ui basic segment">
        <div class="ui list">
            <div class="item">
                 <i class="environment folder icon"></i>
                <div class="content">
                    <div class="environment name header">{{taleName}}</div>
                    <div class="list">
                        {{#each nonOptionalFile as |file|}}
                        <div class="item">
                                <label>
                                    <div class="content">
                                        <i class="file icon"></i>
                                         {{file}} <i class="info circle blue icon {{file}}"></i> 
                                    </div>
                                </label>
                            </div>
                        {{/each}}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<hr>
{{!-- Accordion menu that lets the user select a license --}}
<div class="title">
    <h2>
        <i class="fab fa-creative-commons"></i> Usage Rights
        <span>
            Choose how you wish your Tale to be stored and reused
            <i class="dropdown icon"></i>
        </span>

    </h2>
</div>

<div class="content">
    <div class="ui form">
        <div class="grouped fields">
            {{#each availableLicenses as |license|}}
            <div class="field">
                <div class="ui radio checkbox {{license.short}}" id="{{license.spdx}}">
                    <input type="radio" name="license-radio" checked="checked">
                    <label><img class="ui small image left floated" src="{{license.imageName}}">
                     {{license.name}} <i class="info circle blue icon {{license.short}}"></i></label> 
                </div>
            </div>
            {{/each}}
        </div>
    </div>
</div>
<hr>
{{/ui-accordion}}

<div class="actions">
    {{!-- Dropdown where the user can select which member node to put the package in --}}
    {{#ui-dropdown class="search selection dropdown" allowAdditions=false selected=selectedRepository onChange=(action 'onRepositoryChange')
    as |execute mapper|}}
    <div class="default text">Target Repository</div>
    <i class="dropdown icon"></i>
    <div class="menu">
        {{#each repositories as |type|}}
        <div class="item">
            {{type.name}}
        </div>
        {{/each}}
    </div>
    {{/ui-dropdown}}
    
    {{!-- Button that is shown when the user can publish the tale --}}
    {{#if enablePublish}}
    <div class="ui positive blue enabled right labeled icon button" {{action "publishedClicked"}}>
        Publish Tale
    </div>
    {{else if publishing}}
    {{!-- Button that has a loader on top --}}
        <div class="ui positive blue disabled loading right labeled icon button">
            Publishing
        </div>
    {{else}}
    {{!-- Button that is shown after publishing completes --}}
        <div class="ui positive green right labeled icon button" {{action "publishedClicked"}}>
            View Package
        </div>
    {{/if}}

    <div class="ui deny blue inverted button" {{action 'closeModal'}}>
        Cancel
    </div>

</div>
</div><commit_msg>Add the obsoletion warning dialog to the publishing modal. When a user publishes the same Tale twice, we'll obsolete the previous Tale. This dialog lets the user know that we won't delete their package on DataONE.<commit_after><div name="publisher" class="small publisher" >

<div class="main header">
    <h2>Publish Tale
        <span>Create an immutable copy of your Tale with a DOI <i class="info circle blue icon main"></i></span>
    </h2>
</div>
<hr>
{{#ui-accordion as |execute|}}

{{!-- Accordion menu that lists tale files which can be (de)selected by the user --}}
<div class="title">
    <h2>
        <i class="far fa-hdd"></i> Data
        <span>
            Select the files needed to fully reproduce your work
             <i class="dropdown icon"></i>
        </span>
    </h2>
</div>

<div class="content files">
    <div class="ui basic segment file-picker">
            {{ui/files/file-picker inputData=inputData taleId=modalContext}}
    </div>
</div>

<hr>
{{!-- Accordion menu that lists the files which cannot be removed by the user --}}
<div class="title">
    <h2>
        <i class="desktop icon"></i> Environment
            <span>
            Everything required to recreate chosen compute environment - view only 
            <i class="dropdown icon"></i>
        </span>
    </h2>
</div>

<div class="content">
        <div class="ui basic segment">
        <div class="ui list">
            <div class="item">
                 <i class="environment folder icon"></i>
                <div class="content">
                    <div class="environment name header">{{taleName}}</div>
                    <div class="list">
                        {{#each nonOptionalFile as |file|}}
                        <div class="item">
                                <label>
                                    <div class="content">
                                        <i class="file icon"></i>
                                         {{file}} <i class="info circle blue icon {{file}}"></i> 
                                    </div>
                                </label>
                            </div>
                        {{/each}}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<hr>
{{!-- Accordion menu that lets the user select a license --}}
<div class="title">
    <h2>
        <i class="fab fa-creative-commons"></i> Usage Rights
        <span>
            Choose how you wish your Tale to be stored and reused
            <i class="dropdown icon"></i>
        </span>

    </h2>
</div>

<div class="content">
    <div class="ui form">
        <div class="grouped fields">
            {{#each availableLicenses as |license|}}
            <div class="field">
                <div class="ui radio checkbox {{license.short}}" id="{{license.spdx}}">
                    <input type="radio" name="license-radio" checked="checked">
                    <label><img class="ui small image left floated" src="{{license.imageName}}">
                     {{license.name}} <i class="info circle blue icon {{license.short}}"></i></label> 
                </div>
            </div>
            {{/each}}
        </div>
    </div>
</div>
<hr>
{{/ui-accordion}}

<div class="actions">
    {{!-- Dropdown where the user can select which member node to put the package in --}}
    {{#ui-dropdown class="search selection dropdown" allowAdditions=false selected=selectedRepository onChange=(action 'onRepositoryChange')
    as |execute mapper|}}
    <div class="default text">Target Repository</div>
    <i class="dropdown icon"></i>
    <div class="menu">
        {{#each repositories as |type|}}
        <div class="item">
            {{type.name}}
        </div>
        {{/each}}
    </div>
    {{/ui-dropdown}}
    
    {{!-- Button that is shown when the user can publish the tale --}}
    {{#if enablePublish}}
    <div class="ui positive blue enabled right labeled icon button" {{action "publishedClicked"}}>
        Publish Tale
    </div>
    {{else if publishing}}
    {{!-- Button that has a loader on top --}}
        <div class="ui positive blue disabled loading right labeled icon button">
            Publishing
        </div>
    {{else}}
    {{!-- Button that is shown after publishing completes --}}
        <div class="ui positive green right labeled icon button" {{action "publishedClicked"}}>
            View Package
        </div>
    {{/if}}

    <div class="ui deny blue inverted button" {{action 'closeModal'}}>
        Cancel
    </div>

</div>

{{!-- <div class="ui obsolete modal" style="display: none">
    <i class="close icon"></i>
    <div class="header">
        Publish your Tale.
    </div>
    <div class="image content">
        <div class="description">
            <p>
                We noticed this Tale has already been published. If you publish the Tale again,
                it will obsolete, but not remove the original published Tale. Are you sure you 
                wish to obsolete the already published Tale?
            </p>
        </div>
    </div>
    <div class="actions">
        <div class="ui black deny button" {{action 'denyDataONE'}}>
            Cancel
        </div>
        <div class="ui positive right labeled icon button" {{action 'startTutorial'}}>
            Publish & Obsolete
            <i class="checkmark icon"></i>
        </div>
    </div>
</div> --}}
</div>
{'fraction_non_alphanumeric': 0.14395334561080417, 'fraction_numerical': 0.0016369961121342337, 'mean_word_length': 1.8202538949798037, 'pattern_counts': {'":': 0, '<': 239, '<?xml version=': 0, '>': 239, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '523588', 'n_tokens_mistral': 2681, 'n_tokens_neox': 2586, 'n_words': 885}