<commit_before>{{title crate.name}}

<div id='crates-heading'>
    <div class='info'>
        <img class='logo' src="/assets/crate.png"/>
        <h1>{{ crate.name }}</h1>
        <h2>{{ currentVersion.num }}</h2>
    </div>

    <div class='right'>
        {{#if session.currentUser}}
            <button class='tan-button' {{action 'toggleFollow' this}}>
                {{#if fetchingFollowing}}
                    <img src="/assets/ajax-loader.gif"/>
                {{else}}
                    {{#if following}}
                        Unfollow
                    {{else}}
                        Follow
                    {{/if}}
                {{/if}}
            </button>
        {{/if}}
        {{!--
            <a class='yellow-button' download
               {{action 'download' currentVersion}}
               href='{{currentVersion.dl_path}}'>
                <img src="/assets/button-download.png"/>
                Download
            </a>
        --}}
    </div>
</div>

{{! This is used to set the url of to actually download a file }}
<iframe id='download-frame' style='display:none'></iframe>

{{#if currentVersion.yanked}}
    <div class='crate-info'>
        This crate has been yanked, but it is still available for download for
        other crates that may be depending on it.
    </div>
{{else}}
<div class='crate-info'>
    <div class='docs'>
        {{#if crate.description}}
            <div class='about'>
                <h3>About This Package</h3>
                <p>{{ crate.description }}</p>
            </div>
        {{/if}}
        <div class='install'>
            <div class='action'>Cargo.toml</div>
            <code>{{ crate.name }} = "{{ currentVersion.num }}"</code>
        </div>
    </div>
    <div class='authorship'>
        <div class='top'>
            <div>
                <div class='last-update'><span class='small'>Last Updated</span></div>
                <div class='date'>{{moment-from-now crate.updated_at}}</div>
            </div>

            <div class="authors">
                <h3>Authors</h3>
                <ul>
                    {{#each displayedAuthors as |author|}}
                        <li>{{ format-email author.name }}</li>
                    {{/each}}
                </ul>
            </div>
        </div>

        <div class='bottom'>
            {{#if crate.license}}
                <div>
                    <h3>License</h3>
                    <p>{{ crate.license }}</p>
                </div>
            {{/if}}

            {{#unless crate.keywords.isPending}}
                {{#if anyKeywords}}
                    <div>
                        <h3>Keywords</h3>
                        <ul class='keywords'>
                            {{#each keywords as |keyword|}}
                                <li>{{link-to keyword.id 'keyword' keyword}}</li>
                            {{/each}}
                        </ul>
                    </div>
                {{/if}}
            {{/unless}}

            <div>
                <h3>Owners</h3>
                <ul class='owners'>
                    {{#each crate.owners as |owner|}}
                        <li>
                          {{#user-link user=owner}}
                            {{user-avatar user=owner size='medium-small'}}
                          {{/user-link}}
                        </li>
                    {{/each}}
                </ul>
            </div>
        </div>
    </div>
</div>

<div id='crate-links'>
    {{#if anyLinks}}
        <div class='section'>
          <h3>Links</h3>
          <ul>
            {{#if crate.homepage}}
                <li><a href="{{crate.homepage}}">Homepage</a></li>
            {{/if}}
            {{#if crate.wiki}}
                <li><a href="{{crate.wiki}}">Wiki</a></li>
            {{/if}}
            {{#if crate.mailing_list}}
                <li><a href="{{crate.mailing_list}}">Mailing list</a></li>
            {{/if}}
            {{#if crate.documentation}}
                <li><a href="{{crate.documentation}}">Documentation</a></li>
            {{/if}}
            {{#if crate.repository}}
                <li><a href="{{crate.repository}}">Repository</a></li>
            {{/if}}
            {{#if crate.reverse_dependencies}}
                <li>
                  {{#link-to 'crate.reverse_dependencies' (query-params dependency=crate.crate_id)}}
                    Dependent crates
                  {{/link-to}}
                </li>
            {{/if}}
          </ul>
        </div>
    {{/if}}

  <div class='section' id='crate-dependencies'>
    <h3>Dependencies</h3>
    <ul>
      {{#each currentDependencies as |dep|}}
        {{link-to-dep dep=dep}}
      {{else}}
          <li>None</li>
      {{/each}}
    </ul>
  </div>

  {{#if currentDevDependencies}}
    <div class='section' id='crate-dev-dependencies'>
      <h3>Dev-Dependencies</h3>
      <ul>
        {{#each currentDevDependencies as |dep|}}
            {{link-to-dep dep=dep}}
        {{/each}}
      </ul>
    </div>
  {{/if}}

  <div class='section' id='crate-versions'>
    <h3>Versions</h3>
    <ul>
      {{#each smallSortedVersions as |version|}}
      <li>
        {{#link-to 'crate.version' version.num}}
            {{ version.num }}
        {{/link-to}}
        <span class='date'>{{moment-format version.created_at 'll'}}</span>
        {{#if version.yanked}}
            <span class='yanked'>yanked</span>
        {{/if}}
      </li>
      {{/each}}
    </ul>
    <span class='small'>
      {{#if hasMoreVersions}}
      {{#link-to 'crate.versions' crate}}
          show all {{ crate.versions.length }} versions
      {{/link-to}}
      {{/if}}
    </span>
  </div>
</div>

<div id='crate-downloads'>
    <div class='stats'>
        <h3>Stats Overview</h3>
        <div class='stat'>
            <span class='num'>
                <img src="/assets/download.png"/>
                {{ format-num downloadsContext.downloads }}
            </span>
            <span class='desc small'>Downloads all time</span>
        </div>
        <div class='stat'>
            <span class="{{if crate.versions.isPending 'loading'}} num">
                <img src="/assets/package.png"/>
                {{ crate.versions.length }}
            </span>
            <span class='desc small'>Versions published</span>
        </div>
    </div>

    <div class='versions'>
        <span class='small'>Showing stats for</span>

        {{#rl-dropdown-container class="button-holder"}}
            {{#rl-dropdown-toggle class="tan-button dropdown"}}
                {{#if requestedVersion}}
                    {{ requestedVersion }}
                {{else}}
                    All Versions
                {{/if}}
                <span class='arrow'></span>
            {{/rl-dropdown-toggle}}

            {{#rl-dropdown id="all-versions" tagName="ul" class="dropdown" closeOnChildClick="a:link"}}
                <li class='all'>
                    {{#link-to 'crate.version' ''}}All Versions{{/link-to}}
                </li>
                {{#each smallSortedVersions as |version|}}
                    <li>
                        {{#link-to 'crate.version' version.num}}
                            {{ version.num }}
                        {{/link-to}}
                    </li>
                {{/each}}
            {{/rl-dropdown}}
        {{/rl-dropdown-container}}
    </div>
    <div class='graph'>
        <h4>Downloads over the last 90 days</h4>
        {{download-graph data=downloadData}}
    </div>
</div>
{{/if}}
<commit_msg>Add a backlink to newest for yanked crate versions<commit_after>{{title crate.name}}

<div id='crates-heading'>
    <div class='info'>
        <img class='logo' src="/assets/crate.png"/>
        <h1>{{ crate.name }}</h1>
        <h2>{{ currentVersion.num }}</h2>
    </div>

    <div class='right'>
        {{#if session.currentUser}}
            <button class='tan-button' {{action 'toggleFollow' this}}>
                {{#if fetchingFollowing}}
                    <img src="/assets/ajax-loader.gif"/>
                {{else}}
                    {{#if following}}
                        Unfollow
                    {{else}}
                        Follow
                    {{/if}}
                {{/if}}
            </button>
        {{/if}}
        {{!--
            <a class='yellow-button' download
               {{action 'download' currentVersion}}
               href='{{currentVersion.dl_path}}'>
                <img src="/assets/button-download.png"/>
                Download
            </a>
        --}}
    </div>
</div>

{{! This is used to set the url of to actually download a file }}
<iframe id='download-frame' style='display:none'></iframe>

{{#if currentVersion.yanked}}
    <div class='crate-info'>
        <div>
        <p>This crate has been yanked, but it is still available for download for
        other crates that may be depending on it.</p>
        <p>You may wish to
          {{#link-to 'crate' crate}}view the newest version{{/link-to}} instead.
        </p>
        </div>
    </div>
{{else}}
<div class='crate-info'>
    <div class='docs'>
        {{#if crate.description}}
            <div class='about'>
                <h3>About This Package</h3>
                <p>{{ crate.description }}</p>
            </div>
        {{/if}}
        <div class='install'>
            <div class='action'>Cargo.toml</div>
            <code>{{ crate.name }} = "{{ currentVersion.num }}"</code>
        </div>
    </div>
    <div class='authorship'>
        <div class='top'>
            <div>
                <div class='last-update'><span class='small'>Last Updated</span></div>
                <div class='date'>{{moment-from-now crate.updated_at}}</div>
            </div>

            <div class="authors">
                <h3>Authors</h3>
                <ul>
                    {{#each displayedAuthors as |author|}}
                        <li>{{ format-email author.name }}</li>
                    {{/each}}
                </ul>
            </div>
        </div>

        <div class='bottom'>
            {{#if crate.license}}
                <div>
                    <h3>License</h3>
                    <p>{{ crate.license }}</p>
                </div>
            {{/if}}

            {{#unless crate.keywords.isPending}}
                {{#if anyKeywords}}
                    <div>
                        <h3>Keywords</h3>
                        <ul class='keywords'>
                            {{#each keywords as |keyword|}}
                                <li>{{link-to keyword.id 'keyword' keyword}}</li>
                            {{/each}}
                        </ul>
                    </div>
                {{/if}}
            {{/unless}}

            <div>
                <h3>Owners</h3>
                <ul class='owners'>
                    {{#each crate.owners as |owner|}}
                        <li>
                          {{#user-link user=owner}}
                            {{user-avatar user=owner size='medium-small'}}
                          {{/user-link}}
                        </li>
                    {{/each}}
                </ul>
            </div>
        </div>
    </div>
</div>

<div id='crate-links'>
    {{#if anyLinks}}
        <div class='section'>
          <h3>Links</h3>
          <ul>
            {{#if crate.homepage}}
                <li><a href="{{crate.homepage}}">Homepage</a></li>
            {{/if}}
            {{#if crate.wiki}}
                <li><a href="{{crate.wiki}}">Wiki</a></li>
            {{/if}}
            {{#if crate.mailing_list}}
                <li><a href="{{crate.mailing_list}}">Mailing list</a></li>
            {{/if}}
            {{#if crate.documentation}}
                <li><a href="{{crate.documentation}}">Documentation</a></li>
            {{/if}}
            {{#if crate.repository}}
                <li><a href="{{crate.repository}}">Repository</a></li>
            {{/if}}
            {{#if crate.reverse_dependencies}}
                <li>
                  {{#link-to 'crate.reverse_dependencies' (query-params dependency=crate.crate_id)}}
                    Dependent crates
                  {{/link-to}}
                </li>
            {{/if}}
          </ul>
        </div>
    {{/if}}

  <div class='section' id='crate-dependencies'>
    <h3>Dependencies</h3>
    <ul>
      {{#each currentDependencies as |dep|}}
        {{link-to-dep dep=dep}}
      {{else}}
          <li>None</li>
      {{/each}}
    </ul>
  </div>

  {{#if currentDevDependencies}}
    <div class='section' id='crate-dev-dependencies'>
      <h3>Dev-Dependencies</h3>
      <ul>
        {{#each currentDevDependencies as |dep|}}
            {{link-to-dep dep=dep}}
        {{/each}}
      </ul>
    </div>
  {{/if}}

  <div class='section' id='crate-versions'>
    <h3>Versions</h3>
    <ul>
      {{#each smallSortedVersions as |version|}}
      <li>
        {{#link-to 'crate.version' version.num}}
            {{ version.num }}
        {{/link-to}}
        <span class='date'>{{moment-format version.created_at 'll'}}</span>
        {{#if version.yanked}}
            <span class='yanked'>yanked</span>
        {{/if}}
      </li>
      {{/each}}
    </ul>
    <span class='small'>
      {{#if hasMoreVersions}}
      {{#link-to 'crate.versions' crate}}
          show all {{ crate.versions.length }} versions
      {{/link-to}}
      {{/if}}
    </span>
  </div>
</div>

<div id='crate-downloads'>
    <div class='stats'>
        <h3>Stats Overview</h3>
        <div class='stat'>
            <span class='num'>
                <img src="/assets/download.png"/>
                {{ format-num downloadsContext.downloads }}
            </span>
            <span class='desc small'>Downloads all time</span>
        </div>
        <div class='stat'>
            <span class="{{if crate.versions.isPending 'loading'}} num">
                <img src="/assets/package.png"/>
                {{ crate.versions.length }}
            </span>
            <span class='desc small'>Versions published</span>
        </div>
    </div>

    <div class='versions'>
        <span class='small'>Showing stats for</span>

        {{#rl-dropdown-container class="button-holder"}}
            {{#rl-dropdown-toggle class="tan-button dropdown"}}
                {{#if requestedVersion}}
                    {{ requestedVersion }}
                {{else}}
                    All Versions
                {{/if}}
                <span class='arrow'></span>
            {{/rl-dropdown-toggle}}

            {{#rl-dropdown id="all-versions" tagName="ul" class="dropdown" closeOnChildClick="a:link"}}
                <li class='all'>
                    {{#link-to 'crate.version' ''}}All Versions{{/link-to}}
                </li>
                {{#each smallSortedVersions as |version|}}
                    <li>
                        {{#link-to 'crate.version' version.num}}
                            {{ version.num }}
                        {{/link-to}}
                    </li>
                {{/each}}
            {{/rl-dropdown}}
        {{/rl-dropdown-container}}
    </div>
    <div class='graph'>
        <h4>Downloads over the last 90 days</h4>
        {{download-graph data=downloadData}}
    </div>
</div>
{{/if}}

{'fraction_non_alphanumeric': 0.17287825290963776, 'fraction_numerical': 0.0036615666274355954, 'mean_word_length': 1.3265895953757225, 'pattern_counts': {'":': 0, '<': 355, '<?xml version=': 0, '>': 355, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 30, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2206649', 'n_tokens_mistral': 4494, 'n_tokens_neox': 4300, 'n_words': 878}