spud_search 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ <h3>Search Results</h3>
2
+ <div class="results">
3
+ <%if @results.blank?%>
4
+ <p>No Results Found.</p>
5
+ <%else%>
6
+ <%@results.each do |result|%>
7
+ <div class="result">
8
+ <%if result.class.name == 'SpudPost'%>
9
+ <h4><%=link_to result.title,blog_post_path(result.url_name)%></h4>
10
+ <p><%=truncate(result.content,:length => 200, :separator => ' ')%></p>
11
+ <%elsif result.class.name == 'SpudPage'%>
12
+ <h4><%=link_to result.name,page_path(:id => result.url_name)%></h4>
13
+
14
+ <p><%=truncate(result.meta_description,:length => 200, :separator => ' ')%></p>
15
+
16
+ <%end%>
17
+ </div>
18
+ <%end%>
19
+ <%=will_paginate @results%>
20
+ <%end%>
21
+ </div>
@@ -1,21 +1,7 @@
1
- <h3>Search Results</h3>
2
- <div class="results">
3
- <%if @results.blank?%>
4
- <p>No Results Found.</p>
5
- <%else%>
6
- <%@results.each do |result|%>
7
- <div class="result">
8
- <%if result.class.name == 'SpudPost'%>
9
- <h4><%=link_to result.title,blog_post_path(result.url_name)%></h4>
10
- <p><%=truncate(result.content,:length => 200, :separator => ' ')%></p>
11
- <%elsif result.class.name == 'SpudPage'%>
12
- <h4><%=link_to result.name,page_path(:id => result.url_name)%></h4>
13
-
14
- <p><%=truncate(result.meta_description,:length => 200, :separator => ' ')%></p>
15
-
16
- <%end%>
17
- </div>
18
- <%end%>
19
- <%=will_paginate @results%>
20
- <%end%>
21
- </div>
1
+ <%if Spud::Search.content_for.blank? == false%>
2
+ <%=content_for Spud::Search.content_for do%>
3
+ <%=render "index"%>
4
+ <%end%>
5
+ <%else%>
6
+ <%=render "index"%>
7
+ <%end%>
@@ -2,7 +2,8 @@ module Spud
2
2
  module Search
3
3
  include ActiveSupport::Configurable
4
4
 
5
- config_accessor :base_layout
5
+ config_accessor :base_layout,:content_for
6
6
  self.base_layout = "application"
7
+ self.content_for = nil
7
8
  end
8
9
  end
@@ -6,11 +6,7 @@ module Spud
6
6
  module Search
7
7
  class Engine < Rails::Engine
8
8
  engine_name :spud_search
9
- initializer :admin do
10
- Spud::Core.configure do |config|
11
- config.admin_applications += [{:name => "Search",:thumbnail => "spud/admin/template_thumb.png",:url => "/spud/admin/template_root",:order => 10}]
12
- end
13
- end
9
+
14
10
  initializer :assets do |config|
15
11
  Rails.application.config.assets.precompile += [
16
12
  "spud/admin/search*"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spud_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: spud_core
16
- requirement: &70230919566400 !ruby/object:Gem::Requirement
16
+ requirement: &70315766139120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.3.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70230919566400
24
+ version_requirements: *70315766139120
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: acts_as_indexed
27
- requirement: &70230919563780 !ruby/object:Gem::Requirement
27
+ requirement: &70315766136960 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 0.7.7
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70230919563780
35
+ version_requirements: *70315766136960
36
36
  description:
37
37
  email: destes@redwindsw.com
38
38
  executables: []
@@ -47,6 +47,7 @@ files:
47
47
  - app/helpers/search_helper.rb
48
48
  - app/helpers/spud/admin/users_helper.rb
49
49
  - app/helpers/spud/user_sessions_helper.rb
50
+ - app/views/search/_index.html.erb
50
51
  - app/views/search/index.html.erb
51
52
  - config/application.rb
52
53
  - config/boot.rb