Skip to content

Commit

Permalink
+ indexes, + styling, + tips
Browse files Browse the repository at this point in the history
  • Loading branch information
floere committed Feb 10, 2011
1 parent 7fa91c3 commit 466a7d9
Show file tree
Hide file tree
Showing 13 changed files with 109 additions and 11 deletions.
30 changes: 27 additions & 3 deletions client/stylesheets/stylesheet.css
@@ -1,7 +1,8 @@
body {
text-align: center;
font-family: Lucida Grande;
margin: 0px; }
margin: 0px;
background-color: white; }

img {
margin: -2px 0px 0px; }
Expand All @@ -20,8 +21,30 @@ div.content {

div.header {
height: 70px;
background-color: #199399;
background: -moz-radial-gradient(50% 100%, circle, beige 90px, #199399 600px);
background: -webkit-gradient(radial, 50% 100%, 90, 50% 100%, 600, from(beige), to(#199399)); }

div.powered {
font-size: 0.8em;
text-align: right;
width: 300px;
position: absolute;
right: 20px; }
div.powered h1 {
font-size: 0.99em; }

div.try {
font-size: 0.8em;
text-align: left;
width: 300px;
position: absolute;
left: 20px; }
div.try h1 {
font-size: 0.99em; }
div.try p a {
display: block; }

#picky {
text-align: left;
margin: 0px auto;
Expand Down Expand Up @@ -50,7 +73,7 @@ div.header {
margin-top: 0px;
padding: 0px; }
#picky .results div.gem {
background-color: #ffeeee;
background-color: #f5f5ea;
padding: 2px 19px;
margin: 3px 0px; }
#picky .results em {
Expand All @@ -60,7 +83,8 @@ div.header {
display: block;
padding: 10px; }
#picky .results p.dependencies {
color: #aaaaaa; }
color: #aaaaaa;
font-size: 0.9em; }
#picky .results p.authors {
color: #555555;
font-size: 0.8em; }
Expand Down
30 changes: 29 additions & 1 deletion client/stylesheets/stylesheet.sass
Expand Up @@ -2,6 +2,7 @@ body
:text-align center
:font-family Lucida Grande
:margin 0px
:background-color white

img
:margin -2px 0px 0px
Expand All @@ -21,8 +22,34 @@ div.content

div.header
:height 70px
:background-color #199399
:background -moz-radial-gradient(50% 100%, circle, beige 90px, #199399 600px)
:background -webkit-gradient(radial, 50% 100%, 90, 50% 100%, 600, from(beige), to(#199399))

div.powered
:font-size 0.8em
:text-align right
:width 300px
:position absolute
:right 20px

h1
:font-size 0.99em

div.try
:font-size 0.8em
:text-align left
:width 300px
:position absolute
:left 20px

h1
:font-size 0.99em

p
a
:display block

#picky
:text-align left
:margin 0px auto
Expand Down Expand Up @@ -54,7 +81,7 @@ div.header
:padding 0px

div.gem
:background-color #ffeeee
:background-color #f5f5ea
:padding 2px 19px
:margin 3px 0px

Expand All @@ -68,6 +95,7 @@ div.header

p.dependencies
:color #aaa
:font-size 0.9em

p.authors
:color #555
Expand Down
53 changes: 49 additions & 4 deletions client/views/search.haml
Expand Up @@ -10,10 +10,56 @@
%body
.header
-# %img{:src => "images/picky.png"}/
.powered
%h1 Powered by
%p
%a{ :href => "http://florianhanke.com/picky" } Picky (the helpful search engine)
.try
%h1 Fun things to try!
%p
Where is yajl used?
%a{ :href => 'javascript:pickyClient.insert("yajl")' } yajl
(then, click on "dependencies")
%p
How many gems use rspec?
%a{ :href => 'javascript:pickyClient.insert("use:rspec")' } use:rspec
(check the number)
%p
Gems that are by Kaspar that use flexmock:
%a{ :href => 'javascript:pickyClient.insert("kaspar flexmock")' } kaspar flexmock
%p
The same, explicitly qualified:
%a{ :href => 'javascript:pickyClient.insert("by:kaspar using:flexmock")' } by:kaspar using:flexmock
%p
Doesn't have to be "using:", can also be "needs:", or "dependency:"
%a{ :href => 'javascript:pickyClient.insert("needs:rspec dependency:flexmock")' } needs:rspec dependency:flexmock
%p
Where did Eloy work on?
%a{ :href => 'javascript:pickyClient.insert("author:eloy")' } author:eloy
Just Eloy works as well:
%a{ :href => 'javascript:pickyClient.insert("eloy")' } eloy
%p
What is DHH called again? Heynemeyer?
%a{ :href => 'javascript:pickyClient.insert("heynemeyer~")' } heynemeyer~
%p
Hmm, it was a gem that started with "Pi", version 1.0.2.
%a{ :href => 'javascript:pickyClient.insert("Pi* 1.0.2")' } Pi* 1.0.2
%p
The same, but at the end, the asterisk is not needed:
%a{ :href => 'javascript:pickyClient.insert("1.0.2 Pi")' } 1.0.2 Pi
%p
How many gems are exactly version 1.0.0?
%a{ :href => 'javascript:pickyClient.insert("1.0.0")' } 1.0.0
%p
Is picky 1.3 (and friends) already out?
%a{ :href => 'javascript:pickyClient.insert("picky 1.3")' } picky 1.3
(yes!)
%p
How about Rails 5?
%a{ :href => 'javascript:pickyClient.insert("name:rails 5")' } name:rails 5
(nooo!)
%p
= Picky::Helper.cached_interface
%p
%a{:href => "http://florianhanke.com/picky"} To the Picky Homepage
:javascript
pickyClient = new PickyClient({
// A full query displays the rendered results.
Expand All @@ -36,7 +82,6 @@
qualifiers: {
en:{
named: 'name',
version: 'versions',
written: 'author',
writer: 'author',
using: 'dependencies',
Expand All @@ -60,4 +105,4 @@

// An initial search text, prefilled.
//
pickyClient.insert('picky');
pickyClient.insert('');
7 changes: 4 additions & 3 deletions server/app/application.rb
Expand Up @@ -31,9 +31,10 @@ class PickySearch < Application
similarity: Similarity::Phonetic.new(3),
partial: Partial::Substring.new(from: 1)

gems_index.define_category :versions,
gems_index.define_category :version,
partial: Partial::Substring.new(from: 1),
qualifiers: [:version]
qualifiers: [:version],
from: :versions

gems_index.define_category :author,
similarity: Similarity::Phonetic.new(3),
Expand All @@ -43,7 +44,7 @@ class PickySearch < Application
gems_index.define_category :dependencies,
similarity: Similarity::Phonetic.new(3),
partial: Partial::Substring.new(from: 1),
qualifiers: [:dependency, :dependencies, :depends, :using, :uses, :needs]
qualifiers: [:dependency, :dependencies, :depends, :using, :uses, :use, :needs]

options = { :weights => { [:name] => +3 } }

Expand Down

0 comments on commit 466a7d9

Please sign in to comment.