|
36 | 36 | </div>
|
37 | 37 |
|
38 | 38 | <div local-class='lists'>
|
39 |
| - <section data-test-new-crates aria-busy="{{this.dataTask.isRunning}}"> |
| 39 | + <section data-test-new-crates> |
40 | 40 | <h2>New Crates</h2>
|
41 |
| - <CrateListNewest @crates={{this.model.new_crates}} /> |
| 41 | + <ol local-class="list" aria-busy="{{this.dataTask.isRunning}}"> |
| 42 | + {{#if this.dataTask.isRunning}} |
| 43 | + {{#each (placeholders 10)}} |
| 44 | + <li> |
| 45 | + <FrontPageList::Item::Placeholder @withSubtitle={{true}} /> |
| 46 | + </li> |
| 47 | + {{/each}} |
| 48 | + {{else}} |
| 49 | + {{#each this.model.new_crates as |crate index|}} |
| 50 | + <li> |
| 51 | + <FrontPageList::Item |
| 52 | + @route="crate" |
| 53 | + @model={{crate.id}} |
| 54 | + @title={{crate.name}} |
| 55 | + @subtitle="v{{crate.newest_version}}" |
| 56 | + data-test-crate-link={{index}} |
| 57 | + /> |
| 58 | + </li> |
| 59 | + {{/each}} |
| 60 | + {{/if}} |
| 61 | + </ol> |
42 | 62 | </section>
|
43 |
| - <section data-test-most-downloaded aria-busy="{{this.dataTask.isRunning}}"> |
| 63 | + |
| 64 | + <section data-test-most-downloaded> |
44 | 65 | <h2>Most Downloaded</h2>
|
45 |
| - <CrateListNameOnly @crates={{this.model.most_downloaded}} /> |
| 66 | + <ol local-class="list" aria-busy="{{this.dataTask.isRunning}}"> |
| 67 | + {{#if this.dataTask.isRunning}} |
| 68 | + {{#each (placeholders 10)}} |
| 69 | + <li> |
| 70 | + <FrontPageList::Item::Placeholder /> |
| 71 | + </li> |
| 72 | + {{/each}} |
| 73 | + {{else}} |
| 74 | + {{#each this.model.most_downloaded as |crate index|}} |
| 75 | + <li> |
| 76 | + <FrontPageList::Item |
| 77 | + @route="crate" |
| 78 | + @model={{crate.id}} |
| 79 | + @title={{crate.name}} |
| 80 | + data-test-crate-link={{index}} |
| 81 | + /> |
| 82 | + </li> |
| 83 | + {{/each}} |
| 84 | + {{/if}} |
| 85 | + </ol> |
46 | 86 | </section>
|
47 |
| - <section data-test-just-updated aria-busy="{{this.dataTask.isRunning}}"> |
| 87 | + |
| 88 | + <section data-test-just-updated> |
48 | 89 | <h2>Just Updated</h2>
|
49 |
| - <CrateListNewest @crates={{this.model.just_updated}} /> |
| 90 | + <ol local-class="list" aria-busy="{{this.dataTask.isRunning}}"> |
| 91 | + {{#if this.dataTask.isRunning}} |
| 92 | + {{#each (placeholders 10)}} |
| 93 | + <li> |
| 94 | + <FrontPageList::Item::Placeholder @withSubtitle={{true}} /> |
| 95 | + </li> |
| 96 | + {{/each}} |
| 97 | + {{else}} |
| 98 | + {{#each this.model.just_updated as |crate index|}} |
| 99 | + <li> |
| 100 | + <FrontPageList::Item |
| 101 | + @route="crate" |
| 102 | + @model={{crate.id}} |
| 103 | + @title={{crate.name}} |
| 104 | + @subtitle="v{{crate.newest_version}}" |
| 105 | + data-test-crate-link={{index}} |
| 106 | + /> |
| 107 | + </li> |
| 108 | + {{/each}} |
| 109 | + {{/if}} |
| 110 | + </ol> |
50 | 111 | </section>
|
51 |
| - <section data-test-most-recently-downloaded aria-busy="{{this.dataTask.isRunning}}"> |
| 112 | + |
| 113 | + <section data-test-most-recently-downloaded> |
52 | 114 | <h2>Most Recent Downloads</h2>
|
53 |
| - <CrateListNameOnly @crates={{this.model.most_recently_downloaded}} /> |
| 115 | + <ol local-class="list" aria-busy="{{this.dataTask.isRunning}}"> |
| 116 | + {{#if this.dataTask.isRunning}} |
| 117 | + {{#each (placeholders 10)}} |
| 118 | + <li> |
| 119 | + <FrontPageList::Item::Placeholder /> |
| 120 | + </li> |
| 121 | + {{/each}} |
| 122 | + {{else}} |
| 123 | + {{#each this.model.most_recently_downloaded as |crate index|}} |
| 124 | + <li> |
| 125 | + <FrontPageList::Item |
| 126 | + @route="crate" |
| 127 | + @model={{crate.id}} |
| 128 | + @title={{crate.name}} |
| 129 | + data-test-crate-link={{index}} |
| 130 | + /> |
| 131 | + </li> |
| 132 | + {{/each}} |
| 133 | + {{/if}} |
| 134 | + </ol> |
54 | 135 | </section>
|
55 |
| - <section data-test-keywords aria-busy="{{this.dataTask.isRunning}}"> |
| 136 | + |
| 137 | + <section data-test-keywords> |
56 | 138 | <h2>Popular Keywords <LinkTo @route="keywords">(see all)</LinkTo></h2>
|
57 |
| - <KeywordList @keywords={{this.model.popular_keywords}} /> |
| 139 | + <ul local-class="list" aria-busy="{{this.dataTask.isRunning}}"> |
| 140 | + {{#if this.dataTask.isRunning}} |
| 141 | + {{#each (placeholders 10)}} |
| 142 | + <li> |
| 143 | + <FrontPageList::Item::Placeholder @withSubtitle={{true}} /> |
| 144 | + </li> |
| 145 | + {{/each}} |
| 146 | + {{else}} |
| 147 | + {{#each this.model.popular_keywords as |keyword|}} |
| 148 | + <li> |
| 149 | + <FrontPageList::Item |
| 150 | + @route="keyword" |
| 151 | + @model={{keyword}} |
| 152 | + @title={{keyword.id}} |
| 153 | + @subtitle="{{format-num keyword.crates_cnt}} crates" |
| 154 | + /> |
| 155 | + </li> |
| 156 | + {{/each}} |
| 157 | + {{/if}} |
| 158 | + </ul> |
58 | 159 | </section>
|
59 |
| - <section data-test-categories aria-busy="{{this.dataTask.isRunning}}"> |
| 160 | + |
| 161 | + <section data-test-categories> |
60 | 162 | <h2>Popular Categories <LinkTo @route="categories">(see all)</LinkTo></h2>
|
61 |
| - <CategoryList @categories={{this.model.popular_categories}} /> |
| 163 | + <ul local-class="list" aria-busy="{{this.dataTask.isRunning}}"> |
| 164 | + {{#if this.dataTask.isRunning}} |
| 165 | + {{#each (placeholders 10)}} |
| 166 | + <li> |
| 167 | + <FrontPageList::Item::Placeholder @withSubtitle={{true}} /> |
| 168 | + </li> |
| 169 | + {{/each}} |
| 170 | + {{else}} |
| 171 | + {{#each this.model.popular_categories as |category|}} |
| 172 | + <li> |
| 173 | + <FrontPageList::Item |
| 174 | + @route="category" |
| 175 | + @model={{category.slug}} |
| 176 | + @title={{category.category}} |
| 177 | + @subtitle="{{format-num category.crates_cnt}} crates" |
| 178 | + /> |
| 179 | + </li> |
| 180 | + {{/each}} |
| 181 | + {{/if}} |
| 182 | + </ul> |
62 | 183 | </section>
|
63 | 184 | </div>
|
0 commit comments