Skip to content

Add exact_match to the frontend #675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/crate.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default DS.Model.extend({
documentation: DS.attr('string'),
repository: DS.attr('string'),
license: DS.attr('string'),
exact_match: DS.attr('boolean'),

versions: DS.hasMany('versions', { async: true }),
badges: DS.attr(),
Expand Down
12 changes: 12 additions & 0 deletions app/styles/crate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@
.rev-dep-downloads {padding-left: 7px}
}

.exact-match {
margin-bottom: 40px;
border-bottom: solid beige;
padding-left: 40px;
div {
padding: 10px;
}
h1 {
color: green
}
}

.quick-links {
ul {
@include display-flex;
Expand Down
11 changes: 10 additions & 1 deletion app/templates/search.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,16 @@

<div id='crates' class='white-rows'>
{{#each model as |crate|}}
{{crate-row crate=crate}}
{{#if crate.exact_match}}
<div class='exact-match'>
<h1>Exact Match</h1>
{{crate-row crate=crate}}
</div>
{{else}}
<div>
{{crate-row crate=crate}}
</div>
{{/if}}
{{/each}}
</div>

Expand Down
1 change: 1 addition & 0 deletions mirage/fixtures/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default {
"description": "Yo dawg, use Rust to generate Rust, right in your Rust. (See\n`external_mixin` to use scripting languages.)\n",
"documentation": "https://github.com/huonw/external_mixin#rust_mixin",
"downloads": 477,
"exact_match": true,
"homepage": "https://github.com/huonw/external_mixin",
"id": "rust_mixin",
"keywords": ["rust", "plugin", "code-generation"],
Expand Down