Skip to content

Commit 48430a2

Browse files
committed
Add exact_match to the frontend
1 parent 4082d4e commit 48430a2

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

app/models/crate.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default DS.Model.extend({
1616
documentation: DS.attr('string'),
1717
repository: DS.attr('string'),
1818
license: DS.attr('string'),
19+
exact_match: DS.attr('boolean'),
1920

2021
versions: DS.hasMany('versions', { async: true }),
2122
badges: DS.attr(),

app/styles/crate.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,18 @@
139139
.rev-dep-downloads {padding-left: 7px}
140140
}
141141

142+
.exact-match {
143+
margin-bottom: 40px;
144+
border-bottom: solid beige;
145+
padding-left: 40px;
146+
div {
147+
padding: 10px;
148+
}
149+
h1 {
150+
color: green
151+
}
152+
}
153+
142154
.quick-links {
143155
ul {
144156
@include display-flex;

app/templates/search.hbs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,16 @@
4747

4848
<div id='crates' class='white-rows'>
4949
{{#each model as |crate|}}
50-
{{crate-row crate=crate}}
50+
{{#if crate.exact_match}}
51+
<div class='exact-match'>
52+
<h1>Exact Match</h1>
53+
{{crate-row crate=crate}}
54+
</div>
55+
{{else}}
56+
<div>
57+
{{crate-row crate=crate}}
58+
</div>
59+
{{/if}}
5160
{{/each}}
5261
</div>
5362

mirage/fixtures/search.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default {
55
"description": "Yo dawg, use Rust to generate Rust, right in your Rust. (See\n`external_mixin` to use scripting languages.)\n",
66
"documentation": "https://github.com/huonw/external_mixin#rust_mixin",
77
"downloads": 477,
8+
"exact_match": true,
89
"homepage": "https://github.com/huonw/external_mixin",
910
"id": "rust_mixin",
1011
"keywords": ["rust", "plugin", "code-generation"],

0 commit comments

Comments
 (0)