Skip to content
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

Fix some issues and errors #32

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 36 additions & 0 deletions .travis.yml
@@ -0,0 +1,36 @@
language: ruby
before_install:
- 'if [[ "$TRAVIS_RUBY_VERSION" =~ "jruby" ]] ; then gem update --system ; fi'
before_script:
- "bundle exec rake refinery:testing:dummy_app > /dev/null"
script:
- "bundle exec rspec spec"
notifications:
email: true
irc:
use_notice: true
skip_join: true
channels:
- "irc.freenode.org#refinerycms"
campfire:
on_success: always
on_failure: always
rooms:
- secure: "JaX+Ckvdd2wqL2bD6t8PHvMDBHxWBlCrkBKPcDKxV0t0DOwzzzwxMryVqcRi\nPsmM/zvmWFATDyRmivhNOpu4lRg9RytSroxZ9nkmbLDqjCyEAZ6tv4yZXME/\nPaxPwmfwgS9g8TKjj3lSWS7rEpqqg0D5S0XIfIHrj6KB6LUmFHc="
env:
- DB=postgresql
- DB=mysql
matrix:
allow_failures:
- rvm: rbx-18mode
- rvm: rbx-19mode
- rvm: jruby-19mode
- rvm: jruby-18mode
rvm:
- 2.0
- 1.9.3
- 1.8.7
- rbx-19mode
- jruby-19mode
- rbx-18mode
- jruby-18mode
23 changes: 13 additions & 10 deletions app/views/refinery/search/show.html.erb
Expand Up @@ -2,18 +2,21 @@
<%= t('.search_results_for', :what => params[:query]) %>
<% end %>

<% content_for :body_content_left do %>
<ul id="search_results">
<% @results.each do |result| %>
<li>
<span class='result_type'>
<%= result_type result %>
</span>
<%= link_to result_title(result).html_safe, result_url(result) %>
</li>
<% content_for :body do %>
<% if @results.empty? %>
<%= t('.no_results_for', :what => params[:query]) %>
<% else %>
<ul id="search_results">
<% @results.each do |result| %>
<li>
<span class='result_type'>
<%= result_type result %>
</span>
<%= link_to result_title(result).html_safe, result_url(result) %>
</li>
<% end %>
<% end %>
</ul>

<% end %>

<%= render :partial => "/refinery/content_page" %>
1 change: 1 addition & 0 deletions config/locales/en.yml
Expand Up @@ -7,3 +7,4 @@ en:
search:
show:
search_results_for: Search Results for '%{what}'
no_results_for: No results found for your search '%{what}'.
23 changes: 17 additions & 6 deletions readme.md
@@ -1,7 +1,4 @@
# Search plugin for [RefineryCMS](http://www.refinerycms.com)
[Github](http://github.com/resolve/refinerycms)

By: [Resolve Digital](http://www.resolvedigital.com)
# Search plugin for [Refinery CMS](http://www.refinerycms.com)

Powered by: [acts_as_indexed](http://github.com/dougal/acts_as_indexed) - Check his readme and documentation for more info on how it works.

Expand All @@ -10,9 +7,23 @@ Powered by: [acts_as_indexed](http://github.com/dougal/acts_as_indexed) - Check
Simply use this by adding the following to your `Gemfile`:

```ruby
gem 'refinerycms-search', '~> 2.0.0', :git => 'git://github.com/resolve/refinerycms-search.git', :branch => '2-0-stable'
gem 'refinerycms-search', '~> 2.0.0'
```

Now, run ``bundle install``

Next, to install the search plugin run:

rails generate refinery:search

Run database migrations:

rake db:migrate

Finally seed your database and you're done.

rake db:seed

## RE-SAVE all records that have not been indexed before.

A sample search form can be found in [views/refinery/shared/_search.html.erb](http://github.com/resolve/refinerycms-search/blob/master/app/views/refinery/shared/_search.html.erb).
Expand Down Expand Up @@ -65,4 +76,4 @@ end

You will need to replace the indexed fields with those appropriate for your model.

If you wish to override the url used in the search results just add a `url` method to your model and the result of this method will be used instead.
If you wish to override the url used in the search results just add a `url` method to your model and the result of this method will be used instead.
5 changes: 4 additions & 1 deletion refinerycms-search.gemspec
@@ -1,3 +1,5 @@
# Encoding: UTF-8

Gem::Specification.new do |s|
s.name = %q{refinerycms-search}
s.version = %q{2.0.0}
Expand All @@ -6,8 +8,9 @@ Gem::Specification.new do |s|
s.description = %q{Provides extra functionality for searching your frontend website using Refinery CMS.}
s.homepage = %q{http://refinerycms.com}
s.email = %q{info@refinerycms.com}
s.authors = ["Resolve Digital"]
s.authors = ["Uģis Ozols", "Joe Sak", "Philip Arndt"]
s.require_paths = %w(lib)
s.license = %q{MIT}

s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- spec/*`.split("\n")
Expand Down