public
Fork of halorgium/mephisto
Description: A mirror of the mephisto code-base
Homepage: http://mephistoblog.com/
Clone URL: git://github.com/technoweenie/mephisto.git
Search Repo:
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
RIP: Site#search_layout

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2680 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Sun Jan 14 17:15:53 -0800 2007
commit  40732b6005359dee6fb3e5c3e17ed84cb894e775
tree    774cb7ddd1c6e7eea0f8e1a999a25f35a4ed8150
parent  a7fe2f4d482cdcb173774b33b19c0ee1b4e72fcf
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 * SVN *
0
 
0
+* RIP: Site#search_layout
0
+
0
 * Add link_to_search_result filter that uses either a paged or blog permalink, depending on the search section.
0
 
0
 * Allow search page to take ?s parameter to specify section path.
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 class Admin::SettingsController < Admin::BaseController
0
   before_filter :find_and_sort_templates
0
- clear_empty_templates_for :site, :search_layout, :tag_layout, :only => :update
0
+ clear_empty_templates_for :site, :tag_layout, :only => :update
0
 
0
   def update
0
     if site.update_attributes params[:site]
...
261
262
263
264
 
265
266
267
...
261
262
263
 
264
265
266
267
0
@@ -261,7 +261,7 @@ class Site < ActiveRecord::Base
0
         else
0
           case template_type
0
             when :tag then tag_layout
0
- when :search then search_layout
0
+ when :search then sections.detect(&:home?).layout
0
           end
0
         end
0
       find_preferred_template(:layout, layout_template)
...
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
...
79
80
81
 
 
 
 
 
 
 
 
 
 
82
83
84
0
@@ -79,16 +79,6 @@
0
       <label for="site_search_path">Search area url</label>
0
     </dt>
0
     <dd><%= f.text_field :search_path %></dd>
0
- <% if @layouts.any? -%>
0
- <dt>
0
- <label for="site_search_layout">Search area layout</label>
0
- </dt>
0
- <dd>
0
- <select name="site[search_layout]">
0
- <%= options_from_templates_for_select(@layouts, @site.search_layout) %>
0
- </select>
0
- </dd>
0
- <% end -%>
0
     <dt>
0
       <label for="site_tag_path">Tag area url</label>
0
     </dt>
...
2
3
4
5
 
6
7
8
...
102
103
104
 
 
 
 
 
 
 
 
 
105
106
107
...
153
154
155
156
157
158
159
...
2
3
4
 
5
6
7
8
...
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
...
162
163
164
 
165
166
167
0
@@ -2,7 +2,7 @@
0
 # migrations feature of ActiveRecord to incrementally modify your database, and
0
 # then regenerate this schema definition.
0
 
0
-ActiveRecord::Schema.define(:version => 68) do
0
+ActiveRecord::Schema.define(:version => 69) do
0
 
0
   create_table "assets", :force => true do |t|
0
     t.column "content_type", :string
0
@@ -102,6 +102,15 @@ ActiveRecord::Schema.define(:version => 68) do
0
     t.column "site_id", :integer
0
   end
0
 
0
+ create_table "feedbacks", :force => true do |t|
0
+ t.column "site_id", :integer
0
+ t.column "name", :string
0
+ t.column "email", :string
0
+ t.column "body", :text
0
+ t.column "key", :string
0
+ t.column "created_at", :datetime
0
+ end
0
+
0
   create_table "memberships", :force => true do |t|
0
     t.column "site_id", :integer
0
     t.column "user_id", :integer
0
@@ -153,7 +162,6 @@ ActiveRecord::Schema.define(:version => 68) do
0
     t.column "permalink_style", :string
0
     t.column "search_path", :string
0
     t.column "tag_path", :string
0
- t.column "search_layout", :string
0
     t.column "tag_layout", :string
0
     t.column "current_theme_path", :string
0
   end
...
27
28
29
30
31
 
32
33
34
...
27
28
29
 
 
30
31
32
33
0
@@ -27,8 +27,7 @@ class Admin::SettingsControllerTest < Test::Unit::TestCase
0
 
0
   def test_should_clear_layouts
0
     login_as :quentin
0
- post :update, :site => { :title => 'foo', :search_layout => '-', :tag_layout => '-' }
0
- assert_nil sites(:first).reload.search_layout
0
+ post :update, :site => { :title => 'foo', :tag_layout => '-' }
0
     assert_nil sites(:first).tag_layout
0
   end
0
 
...
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
...
195
196
197
 
 
 
 
 
 
 
 
 
198
199
200
0
@@ -195,15 +195,6 @@ class MephistoControllerTest < Test::Unit::TestCase
0
     assert_tag :tag => 'h1', :content => "#{contents(:welcome).title} in #{sections(:about).name}"
0
   end
0
 
0
- def test_should_render_with_alternate_search_layout
0
- sites(:first).update_attribute :search_layout, 'alt_layout.liquid'
0
- dispatch 'search'
0
- assert_dispatch_action :search
0
- assert_preferred_template :search
0
- assert_layout_template :alt_layout
0
- assert_template_type :search
0
- end
0
-
0
   def test_should_search_entries
0
     dispatch 'search', :q => 'another'
0
     assert_dispatch_action :search

Comments

    No one has commented yet.