Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Search hasn't been updated in a while, how's this? #8

Merged
merged 8 commits into from
This page is out of date. Refresh to see the latest.
View
2  app/views/search/show.html.erb
@@ -17,7 +17,7 @@
<% end %>
<%= render :partial => "/shared/content_page" %>
-<% content_for :head do %>
+<% content_for :stylesheets do %>
<style type='text/css'>
#search_results {
list-style: none;
View
2  app/views/shared/_search.html.erb
@@ -1,4 +1,4 @@
-<% form_tag search_url do -%>
+<%= form_tag search_url do -%>
<%= text_field_tag :query, {}, {:type => "search",
:placeholder => "Search site for...",
:value => (params[:query] if params[:query])} %>
View
18 db/migrate/01_create_search_page.rb
@@ -0,0 +1,18 @@
+class CreateSearchPage < ActiveRecord::Migration
+
+ def self.up
+ load(Rails.root.join('db', 'seeds', 'refinerycms_search.rb'))
+ end
+
+ def self.down
+ if defined?(UserPlugin)
+ UserPlugin.destroy_all({:name => "refinerycms_search"})
+ end
+
+ if defined?(Page)
+ Page.delete_all({:link_url => "/search"})
+ end
+
+ end
+
+end
View
24 db/seeds/refinerycms_search.rb
@@ -0,0 +1,24 @@
+if defined?(::User)
+ User.all.each do |user|
+ if user.plugins.where(:name => 'refinerycms_search').blank?
+ user.plugins.create(:name => 'refinerycms_search',
+ :position => (user.plugins.maximum(:position) || -1) +1)
+ end
+ end
+end
+
+if defined?(::Page)
+ unless Page.where(:menu_match => "^/search.*$").any?
+ page = Page.create(
+ :title => "Search Results",
+ :link_url => "/search",
+ :deletable => false,
+ :position => ((Page.maximum(:position, :conditions => {:parent_id => nil}) || -1)+1),
+ :menu_match => "^/search.*$"
+ )
+
+ Page.default_parts.each do |default_page_part|
+ page.parts.create(:title => default_page_part, :body => nil)
+ end
+ end
+end
View
4 lib/gemspec.rb
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-version = '0.9.8'
+version = '1.0.0'
raise "Could not get version so gemspec can not be built" if version.nil?
files = Dir.glob("**/*").flatten.reject do |file|
file =~ /\.gem$/
@@ -17,7 +17,7 @@
s.authors = ["Resolve Digital"]
s.require_paths = %w(lib)
- s.add_dependency 'refinerycms', '>= 0.9.8'
+ s.add_dependency 'refinerycms', '>= 1.0.0'
s.files = [
'#{files.join("',\n '")}'
View
8 lib/generators/refinerycms_search_generator.rb
@@ -0,0 +1,8 @@
+require 'refinery/generators'
+
+class RefinerycmsSearchGenerator < ::Refinery::Generators::EngineInstaller
+
+ source_root File.expand_path('../../../', __FILE__)
+ engine_name "search"
+
+end
View
2  lib/refinerycms-search.rb
@@ -18,7 +18,7 @@ def searchable_models
config.after_initialize do
::Refinery::Plugin.register do |plugin|
plugin.name = 'refinerycms_search'
- plugin.version = 1.0
+ plugin.version = 1.1
plugin.hide_from_menu = true
end
end
View
10 readme.md
@@ -9,11 +9,11 @@ Powered by: [acts_as_indexed](http://github.com/dougal/acts_as_indexed) - Check
Simply use this by adding the following to your ``Gemfile``:
- gem 'refinerycms-search', '~> 0.9.8'
-
-You'll also need to create a page (from the 'Pages' tab) with a custom URL of '/search'.
-You can set a custom URL for a page in the Advanced Options via the "Forward this page to another website or page" option.
-It's probably also a good idea to uncheck the 'show in menu' option for this page.
+ gem 'refinerycms-search', '~> 1.0.0'
+
+ bundle install
+ rails g refinerycms_search
+ rake db:migrate
## Restart your web server and RE-SAVE all records that have not been indexed before.
View
4 refinerycms-search.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = %q{refinerycms-search}
- s.version = %q{0.9.8}
+ s.version = %q{1.0.0}
s.date = %q{2010-10-01}
s.summary = %q{Extra search handling for Refinery CMS}
s.description = %q{Provides extra functionality for searching your frontend website using Refinery CMS.}
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.authors = ["Resolve Digital"]
s.require_paths = %w(lib)
- s.add_dependency 'refinerycms', '>= 0.9.8'
+ s.add_dependency 'refinerycms', '>= 1.0.0'
s.files = [
'app',
Something went wrong with that request. Please try again.