diff --git a/.template-lintrc.js b/.template-lintrc.js index 1d984309976..3c356744210 100644 --- a/.template-lintrc.js +++ b/.template-lintrc.js @@ -9,6 +9,5 @@ module.exports = { 'require-valid-alt-text': false, 'no-action': false, 'no-curly-component-invocation': false, - 'no-implicit-this': false, }, }; diff --git a/app/templates/application.hbs b/app/templates/application.hbs index 85fd02c80f8..ff67276504a 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -16,16 +16,21 @@ @@ -58,11 +63,11 @@ | - {{#if session.currentUser}} + {{#if this.session.currentUser}} - - {{ session.currentUser.name }} + + {{ this.session.currentUser.name }} @@ -89,7 +94,7 @@
  • Browse All Crates
  • - {{#if session.currentUser}} + {{#if this.session.currentUser}}
  • Dashboard
  • Account Settings
  • Owner Invites
  • @@ -106,12 +111,17 @@ diff --git a/app/templates/catch-all.hbs b/app/templates/catch-all.hbs index 277a59b51a4..d12c0c162ec 100644 --- a/app/templates/catch-all.hbs +++ b/app/templates/catch-all.hbs @@ -7,7 +7,7 @@ @type="text" class="search" placeholder="Search" - @value={{search}} + @value={{this.search}} @enter={{action "search"}} required={{true}} /> diff --git a/app/templates/categories.hbs b/app/templates/categories.hbs index e89957e8722..f8c95b9742f 100644 --- a/app/templates/categories.hbs +++ b/app/templates/categories.hbs @@ -9,8 +9,8 @@ @@ -19,7 +19,7 @@ {{svg-jar "sort"}} - {{ currentSortBy }} + {{ this.currentSortBy }} @@ -40,7 +40,7 @@
    - {{#each model as |category|}} + {{#each this.model as |category|}}
    @@ -60,13 +60,13 @@
    diff --git a/app/templates/category-slugs.hbs b/app/templates/category-slugs.hbs index 5adf0881bae..297fcb8e7f5 100644 --- a/app/templates/category-slugs.hbs +++ b/app/templates/category-slugs.hbs @@ -8,7 +8,7 @@
    - {{#each model as |category|}} + {{#each this.model as |category|}}
    {{category.slug}}
    {{category.description}}
    {{/each}} diff --git a/app/templates/category/index.hbs b/app/templates/category/index.hbs index f47c50b15cd..137718ba48e 100644 --- a/app/templates/category/index.hbs +++ b/app/templates/category/index.hbs @@ -1,22 +1,22 @@ -{{ title category.category ' - Categories' }} +{{ title this.category.category ' - Categories' }}
    {{svg-jar "crate"}}

    - {{#each category.parent_categories as |parent|}}{{parent.category}}::{{/each}} - {{~ category.category }} + {{#each this.category.parent_categories as |parent|}}{{parent.category}}::{{/each}} + {{~ this.category.category }}

    -

    {{ category.description }}

    +

    {{ this.category.description }}

    -{{#if category.subcategories }} +{{#if this.category.subcategories }}

    Subcategories

    - {{#each category.subcategories as |subcategory| }} + {{#each this.category.subcategories as |subcategory| }}
    @@ -42,8 +42,8 @@ @@ -52,7 +52,7 @@ {{svg-jar "sort"}} - {{ currentSortBy }} + {{ this.currentSortBy }} @@ -83,19 +83,19 @@
    - {{#each model as |crate|}} + {{#each this.model as |crate|}} {{/each}}
    diff --git a/app/templates/components/api-token-row.hbs b/app/templates/components/api-token-row.hbs index 0c7f905afe7..58db299cdca 100644 --- a/app/templates/components/api-token-row.hbs +++ b/app/templates/components/api-token-row.hbs @@ -1,32 +1,33 @@ -
    +
    - {{#if api_token.isNew}} + {{#if this.api_token.isNew}} {{else}} - {{ api_token.name }} + {{ this.api_token.name }} {{/if}}
    - {{#unless api_token.isNew}} + {{#unless this.api_token.isNew}}
    - - Created {{moment-from-now api_token.created_at}} + + Created {{moment-from-now this.api_token.created_at}}
    - {{#if api_token.last_used_at}} + {{#if this.api_token.last_used_at}}
    - - Last used {{moment-from-now api_token.last_used_at}} + + Last used {{moment-from-now this.api_token.last_used_at}}
    {{else}} @@ -38,12 +39,12 @@ {{/unless}}
    - {{#if api_token.isNew}} + {{#if this.api_token.isNew}} {{/if}} - {{#if api_token.isSaving}} + {{#if this.api_token.isSaving}} {{/if}}
    -{{#if serverError}} +{{#if this.serverError}}
    - {{ serverError }} + {{ this.serverError }}
    {{/if}} -{{#if api_token.token}} +{{#if this.api_token.token}}
    Please record this token somewhere, you cannot retrieve its value again. For use on the command line you can save it to ~/.cargo/credentials with: -
    cargo login {{ api_token.token }}
    +
    cargo login {{ this.api_token.token }}
    {{/if}} diff --git a/app/templates/components/badge-appveyor.hbs b/app/templates/components/badge-appveyor.hbs index 7c6cc34c8a2..d2248383ae0 100644 --- a/app/templates/components/badge-appveyor.hbs +++ b/app/templates/components/badge-appveyor.hbs @@ -1,8 +1,8 @@ - + {{ text }} + title="{{ this.text }}"> diff --git a/app/templates/components/badge-azure-devops.hbs b/app/templates/components/badge-azure-devops.hbs index b58e9721f46..e291bd739ca 100644 --- a/app/templates/components/badge-azure-devops.hbs +++ b/app/templates/components/badge-azure-devops.hbs @@ -1,3 +1,3 @@ - - {{ text }} + + {{ this.text }} diff --git a/app/templates/components/badge-bitbucket-pipelines.hbs b/app/templates/components/badge-bitbucket-pipelines.hbs index 5c1abebe40f..9a0d9b0ea8e 100644 --- a/app/templates/components/badge-bitbucket-pipelines.hbs +++ b/app/templates/components/badge-bitbucket-pipelines.hbs @@ -1,6 +1,6 @@ - + {{ text }} + src="https://img.shields.io/bitbucket/pipelines/{{ this.repository }}/{{ this.branch }}" + alt="{{ this.text }}" + title="{{ this.text }}"> diff --git a/app/templates/components/badge-circle-ci.hbs b/app/templates/components/badge-circle-ci.hbs index c26dc67f844..8d04b7a8d69 100644 --- a/app/templates/components/badge-circle-ci.hbs +++ b/app/templates/components/badge-circle-ci.hbs @@ -1,6 +1,6 @@ - + {{ text }} + src="https://circleci.com/gh/{{ this.repository }}/tree/{{ this.branch }}.svg?style=shield" + alt="{{ this.text }}" + title="{{ this.text }}"> diff --git a/app/templates/components/badge-cirrus-ci.hbs b/app/templates/components/badge-cirrus-ci.hbs index 33afc52d760..c9ce44f1b22 100644 --- a/app/templates/components/badge-cirrus-ci.hbs +++ b/app/templates/components/badge-cirrus-ci.hbs @@ -1,6 +1,6 @@ - + {{ text }} + src="https://api.cirrus-ci.com/github/{{ this.repository }}.svg?branch={{ this.branch }}" + alt="{{ this.text }}" + title="{{ this.text }}"> diff --git a/app/templates/components/badge-codecov.hbs b/app/templates/components/badge-codecov.hbs index b411913e4a5..a1f42125582 100644 --- a/app/templates/components/badge-codecov.hbs +++ b/app/templates/components/badge-codecov.hbs @@ -1,6 +1,6 @@ - + {{ text }} + src="https://codecov.io/{{ this.service }}/{{ this.repository }}/coverage.svg?branch={{ this.branch }}" + alt="{{ this.text }}" + title="{{ this.text }}"> diff --git a/app/templates/components/badge-coveralls.hbs b/app/templates/components/badge-coveralls.hbs index 3beeeaeae84..36cb421bc32 100644 --- a/app/templates/components/badge-coveralls.hbs +++ b/app/templates/components/badge-coveralls.hbs @@ -1,6 +1,6 @@ - + {{ text }} + src="https://coveralls.io/repos/{{ this.service }}/{{ this.repository }}/badge.svg?branch={{ this.branch }}" + alt="{{ this.text }}" + title="{{ this.text }}"> diff --git a/app/templates/components/badge-gitlab.hbs b/app/templates/components/badge-gitlab.hbs index e24b1cecafc..b9e1b4bb88b 100644 --- a/app/templates/components/badge-gitlab.hbs +++ b/app/templates/components/badge-gitlab.hbs @@ -1,6 +1,6 @@ - + {{ text }} + src="https://gitlab.com/{{ this.repository }}/badges/{{ this.branch }}/pipeline.svg" + alt="{{ this.text }}" + title="{{ this.text }}"> diff --git a/app/templates/components/badge-is-it-maintained-issue-resolution.hbs b/app/templates/components/badge-is-it-maintained-issue-resolution.hbs index 604b2d128df..0e294482e8d 100644 --- a/app/templates/components/badge-is-it-maintained-issue-resolution.hbs +++ b/app/templates/components/badge-is-it-maintained-issue-resolution.hbs @@ -1,6 +1,6 @@ - + {{ text }} + src="https://isitmaintained.com/badge/resolution/{{ this.repository }}.svg" + alt="{{ this.text }}" + title="{{ this.text }}"> diff --git a/app/templates/components/badge-is-it-maintained-open-issues.hbs b/app/templates/components/badge-is-it-maintained-open-issues.hbs index 7034e257d96..d2c4533a75b 100644 --- a/app/templates/components/badge-is-it-maintained-open-issues.hbs +++ b/app/templates/components/badge-is-it-maintained-open-issues.hbs @@ -1,6 +1,6 @@ - + {{ text }} + src="https://isitmaintained.com/badge/open/{{ this.repository }}.svg" + alt="{{ this.text }}" + title="{{ this.text }}"> diff --git a/app/templates/components/badge-maintenance.hbs b/app/templates/components/badge-maintenance.hbs index c1fe446056e..f959fd3548c 100644 --- a/app/templates/components/badge-maintenance.hbs +++ b/app/templates/components/badge-maintenance.hbs @@ -1,6 +1,6 @@ -{{#unless none}} +{{#unless this.none}} {{text}} + src="https://img.shields.io/badge/maintenance-{{this.escapedStatus}}-{{this.color}}.svg" + alt="{{this.text}}" + title="{{this.text}}"> {{/unless}} diff --git a/app/templates/components/badge-travis-ci.hbs b/app/templates/components/badge-travis-ci.hbs index c61c2e6d64d..61f099026bf 100644 --- a/app/templates/components/badge-travis-ci.hbs +++ b/app/templates/components/badge-travis-ci.hbs @@ -1,6 +1,6 @@ - + {{ text }} + src="https://travis-ci.org/{{ this.repository }}.svg?branch={{ this.branch }}" + alt="{{ this.text }}" + title="{{ this.text }}"> diff --git a/app/templates/components/category-list.hbs b/app/templates/components/category-list.hbs index 985ab43c528..aaacf8aec3c 100644 --- a/app/templates/components/category-list.hbs +++ b/app/templates/components/category-list.hbs @@ -1,5 +1,5 @@
      - {{#each categories as |category|}} + {{#each this.categories as |category|}}
    • {{ category.category }} ({{ format-num category.crates_cnt }}) diff --git a/app/templates/components/crate-badge.hbs b/app/templates/components/crate-badge.hbs index 0f330cb527a..d4288727fde 100644 --- a/app/templates/components/crate-badge.hbs +++ b/app/templates/components/crate-badge.hbs @@ -1,5 +1,5 @@ {{ crate.max_version }} diff --git a/app/templates/components/crate-downloads-list.hbs b/app/templates/components/crate-downloads-list.hbs index 00c6027b1c9..6bd66d063d0 100644 --- a/app/templates/components/crate-downloads-list.hbs +++ b/app/templates/components/crate-downloads-list.hbs @@ -1,5 +1,5 @@
        - {{#each crates as |crate|}} + {{#each this.crates as |crate|}}
      • {{ crate.name }} ({{ crate.max_version }}) diff --git a/app/templates/components/crate-list.hbs b/app/templates/components/crate-list.hbs index 471ad905ee1..f4c69d02739 100644 --- a/app/templates/components/crate-list.hbs +++ b/app/templates/components/crate-list.hbs @@ -1,5 +1,5 @@
          - {{#each crates as |crate index|}} + {{#each this.crates as |crate index|}}
        1. {{ crate.name }} ({{ crate.max_version }}) diff --git a/app/templates/components/crate-readme.hbs b/app/templates/components/crate-readme.hbs index 24b77319bfe..0308050c294 100644 --- a/app/templates/components/crate-readme.hbs +++ b/app/templates/components/crate-readme.hbs @@ -1 +1 @@ -{{html-safe rendered}} +{{html-safe this.rendered}} diff --git a/app/templates/components/crate-row.hbs b/app/templates/components/crate-row.hbs index a3dbc2bb232..df146bec53b 100644 --- a/app/templates/components/crate-row.hbs +++ b/app/templates/components/crate-row.hbs @@ -1,44 +1,44 @@
          - {{ crate.name }} - - - {{#each crate.annotated_badges as |badge|}} + {{ this.crate.name }} + + + {{#each this.crate.annotated_badges as |badge|}} {{component badge.component_name badge=badge data-test-badge=badge.badge_type}} {{/each}}
          - {{ truncate-text crate.description }} + {{ truncate-text this.crate.description }}
          {{svg-jar "download"}} - All-Time: {{ format-num crate.downloads }} + All-Time: {{ format-num this.crate.downloads }}
          {{svg-jar "download"}} - Recent: {{ format-num crate.recent_downloads }} + Recent: {{ format-num this.crate.recent_downloads }}
          {{svg-jar "latest-updates" height="32" width="32"}} -
          diff --git a/app/templates/components/crate-toml-copy.hbs b/app/templates/components/crate-toml-copy.hbs index bf381b3cbb5..8cc512edb80 100644 --- a/app/templates/components/crate-toml-copy.hbs +++ b/app/templates/components/crate-toml-copy.hbs @@ -1,8 +1,8 @@ - + {{svg-jar "copy" alt="Copy Cargo.toml snippet to clipboard"}} -
          - {{#if showNotification}} - {{#if showSuccess}} +
          + {{#if this.showNotification}} + {{#if this.showSuccess}} Copied! {{else}} An error occured. Please use CTRL+C. diff --git a/app/templates/components/email-input.hbs b/app/templates/components/email-input.hbs index 6989e867a71..20174c5723e 100644 --- a/app/templates/components/email-input.hbs +++ b/app/templates/components/email-input.hbs @@ -1,4 +1,4 @@ -{{#if emailIsNull }} +{{#if this.emailIsNull }}

          Please add your email address. We will only use @@ -7,20 +7,20 @@

          {{/if}} -{{#if isEditing }} +{{#if this.isEditing }}
          Email
          @@ -32,8 +32,8 @@
          - {{#if emailNotVerified }} + {{#if this.emailNotVerified }}
          - {{#if user.email_verification_sent}} + {{#if this.user.email_verification_sent}}

          We have sent a verification email to your address.

          {{/if}}

          Your email has not yet been verified.

          -
          {{/if}} - {{#if isError}} + {{#if this.isError}}
          -

          {{emailError}}

          +

          {{this.emailError}}

          {{/if}} diff --git a/app/templates/components/flash-message.hbs b/app/templates/components/flash-message.hbs index bd62cd6d1da..324e005bc9a 100644 --- a/app/templates/components/flash-message.hbs +++ b/app/templates/components/flash-message.hbs @@ -1 +1 @@ -{{message}} \ No newline at end of file +{{this.message}} \ No newline at end of file diff --git a/app/templates/components/keyword-list.hbs b/app/templates/components/keyword-list.hbs index db3c832465e..12c0cda5435 100644 --- a/app/templates/components/keyword-list.hbs +++ b/app/templates/components/keyword-list.hbs @@ -1,5 +1,5 @@
            - {{#each keywords as |keyword|}} + {{#each this.keywords as |keyword|}}
          • {{ keyword.id }} ({{ format-num keyword.crates_cnt }}) diff --git a/app/templates/components/link-to-dep.hbs b/app/templates/components/link-to-dep.hbs index 6f87dd048b6..e0f26de3ee0 100644 --- a/app/templates/components/link-to-dep.hbs +++ b/app/templates/components/link-to-dep.hbs @@ -1,6 +1,6 @@ - - {{ dep.crate_id }} {{ format-req dep.req }} + + {{ this.dep.crate_id }} {{ format-req this.dep.req }} -{{#if dep.optional}} +{{#if this.dep.optional}} optional {{/if}} diff --git a/app/templates/components/owned-crate-row.hbs b/app/templates/components/owned-crate-row.hbs index cf15839c470..4e8254aa3c2 100644 --- a/app/templates/components/owned-crate-row.hbs +++ b/app/templates/components/owned-crate-row.hbs @@ -1,11 +1,11 @@ -