Skip to content

Commit d40878c

Browse files
authored
Merge pull request #399 from rcode5/chore/styled-search
improve search styling
2 parents 5d302d4 + 89a65c9 commit d40878c

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

app/assets/stylesheets/application/search.css.scss

+19
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@
1212
}
1313
}
1414
.search-results {
15+
.nothing {
16+
display: flex;
17+
flex-direction: column;
18+
19+
p {
20+
text-align: left;
21+
margin-top: 0;
22+
}
23+
> * {
24+
25+
flex: 3
26+
}
27+
.oops {
28+
flex: 1;
29+
font-size: initial;
30+
}
31+
font-size: initial;
32+
width: 100%;
33+
}
1534
}
1635

1736
.search-result {

app/views/search/show.html.slim

+3-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
input name="search" value=@query placeholder='search by titles, bands, songs...'
55
.instructions
66
p
7-
span Type in the search box to find tracks that have matches in their playlist (song/band) or by tags or by their description. Here are a couple things to try if you don't know where to start:
7+
span Type in the search box (and hit enter) to find tracks that have matches in their playlist (song/band) or by tags or by their description. Here are a couple things to try if you don't know where to start:
88
= " "
99
- example_searches.each.with_index do |qq, idx|
1010
a href="?search=#{qq}" = "\"#{qq}\""
@@ -25,8 +25,6 @@
2525
- else
2626
.nothing
2727
p.oops
28-
= ":( oops"
28+
= ":( well, hmm..."
2929
p
30-
| We couldn't find anything that matched your request. Click
31-
a href=root_path here
32-
| to start at the beginning.
30+
| We couldn't find anything that matched your request. We're not super good with mis-spellings.

app/views/welcome/index.slim

+2
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@
2323
= ":( oops"
2424
p
2525
| We couldn't find anything that matched your request. Click
26+
'
2627
a href=root_path here
28+
'
2729
| to start at the beginning.

spec/features/visitor_views_tracks_spec.rb

+6
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@
2828
scenario 'can search', js: true do
2929
visit root_path
3030
expect(page).to have_css('.tracks .track', count: 3)
31+
3132
click_on 'search'
33+
3234
fill_in 'search', with: "bootylicious\n"
3335
expect(page).to have_content 'the first mix today'
36+
3437
fill_in 'search', with: "james brown\n"
3538
expect(page).to have_content 'the second mix today'
39+
40+
fill_in 'search', with: "this garbage is not in the system\n"
41+
expect(page).to have_content 'well, hmm...'
3642
end
3743
end

0 commit comments

Comments
 (0)