Skip to content

Commit c791774

Browse files
committed
FrontPageList::Item: Use ember-link instead of LinkTo
1 parent cfa742c commit c791774

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<LinkTo @route={{@route}} @model={{@model}} local-class="link" ...attributes>
1+
<a href={{@link.url}} local-class="link" ...attributes {{on "click" @link.transitionTo}}>
22
<div local-class="left">
33
<div local-class="title">{{@title}}</div>
44
{{#if @subtitle}}<div local-class="subtitle">{{@subtitle}}</div>{{/if}}
55
</div>
66
{{svg-jar "chevron-right" local-class="right"}}
7-
</LinkTo>
7+
</a>

app/templates/index.hbs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@
7373
{{#each this.model.new_crates as |crate index|}}
7474
<li>
7575
<FrontPageList::Item
76-
@route="crate"
77-
@model={{crate.id}}
76+
@link={{link "crate" crate.id}}
7877
@title={{crate.name}}
7978
@subtitle="v{{crate.newest_version}}"
8079
data-test-crate-link={{index}}
@@ -98,8 +97,7 @@
9897
{{#each this.model.most_downloaded as |crate index|}}
9998
<li>
10099
<FrontPageList::Item
101-
@route="crate"
102-
@model={{crate.id}}
100+
@link={{link "crate" crate.id}}
103101
@title={{crate.name}}
104102
data-test-crate-link={{index}}
105103
/>
@@ -122,8 +120,7 @@
122120
{{#each this.model.just_updated as |crate index|}}
123121
<li>
124122
<FrontPageList::Item
125-
@route="crate"
126-
@model={{crate.id}}
123+
@link={{link "crate" crate.id}}
127124
@title={{crate.name}}
128125
@subtitle="v{{crate.newest_version}}"
129126
data-test-crate-link={{index}}
@@ -147,8 +144,7 @@
147144
{{#each this.model.most_recently_downloaded as |crate index|}}
148145
<li>
149146
<FrontPageList::Item
150-
@route="crate"
151-
@model={{crate.id}}
147+
@link={{link "crate" crate.id}}
152148
@title={{crate.name}}
153149
data-test-crate-link={{index}}
154150
/>
@@ -171,8 +167,7 @@
171167
{{#each this.model.popular_keywords as |keyword|}}
172168
<li>
173169
<FrontPageList::Item
174-
@route="keyword"
175-
@model={{keyword}}
170+
@link={{link "keyword" keyword}}
176171
@title={{keyword.id}}
177172
@subtitle="{{format-num keyword.crates_cnt}} crates"
178173
/>
@@ -195,8 +190,7 @@
195190
{{#each this.model.popular_categories as |category|}}
196191
<li>
197192
<FrontPageList::Item
198-
@route="category"
199-
@model={{category.slug}}
193+
@link={{link "category" category.slug}}
200194
@title={{category.category}}
201195
@subtitle="{{format-num category.crates_cnt}} crates"
202196
/>

0 commit comments

Comments
 (0)