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
Click here to lend your support to: mephisto and make a donation at www.pledgie.com !
fix anomaly with page_url [Ian White]

git-svn-id: http://svn.techno-weenie.net/projects/mephisto/trunk@2331 
567b1171-46fb-0310-a4c9-b4bef9110e78
technoweenie (author)
Thu Oct 05 07:36:56 -0700 2006
commit  aa0cc3531e2339c7b4759f1f310cee9c53014551
tree    920a1c22778642e61230ea15ef370a8aa15d851b
parent  5afada7a089c3be601c83b5f89eadda4ee4aa8fb
...
4
5
6
7
 
8
9
10
11
 
12
13
14
...
4
5
6
 
7
8
9
10
 
11
12
13
14
0
@@ -4,11 +4,11 @@ class AssetDrop < BaseDrop
0
   def initialize(source)
0
     @source = source
0
     super source
0
- @site_liquid = [:id, :content_type, :size, :filename, :width, :height].inject({}) { |h, k| h.merge k.to_s => @source.send(k) }
0
+ @asset_liquid = [:id, :content_type, :size, :filename, :width, :height].inject({}) { |h, k| h.merge k.to_s => @source.send(k) }
0
   end
0
 
0
   def before_method(method)
0
- @site_liquid[method.to_s]
0
+ @asset_liquid[method.to_s]
0
   end
0
 
0
   [:image, :movie, :audio, :other, :pdf].each do |content|
...
82
83
84
85
 
86
87
88
...
82
83
84
 
85
86
87
88
0
@@ -82,7 +82,7 @@ module UrlFilters
0
 
0
   def page_url(page, section = nil)
0
     section ||= current_page_section
0
- page[:is_page_home] ? section.url : [section.url, page[:permalink]].join('/')
0
+ page[:is_page_home] ? section.url : section.url + (section.url == '/' ? '' : '/') + page[:permalink]
0
   end
0
 
0
   def atom_feed(url, title = nil)
...
36
37
38
39
 
 
 
 
 
 
 
40
41
42
...
36
37
38
 
39
40
41
42
43
44
45
46
47
48
0
@@ -36,7 +36,13 @@ context "Url Filters" do
0
     assert_equal "/about/welcome-to-mephisto", page_url(contents(:welcome).to_liquid)
0
     assert_equal "/about/about-this-page", page_url(contents(:about).to_liquid)
0
   end
0
-
0
+
0
+ specify "should generate paged url when site has paged home section" do
0
+ @context = {'site' => sites(:hostess).to_liquid, 'section' => sections(:cupcake_home).to_liquid}
0
+ assert_equal "/", page_url(contents(:cupcake_welcome).to_liquid(:page => true))
0
+ assert_equal "/welcome-to-cupcake", page_url(contents(:cupcake_welcome).to_liquid)
0
+ end
0
+
0
   specify "should generate asset urls" do
0
     assert_equal "/javascripts/foo.js", javascript_url('foo.js')
0
     assert_equal "/stylesheets/foo.css", stylesheet_url('foo.css')

Comments

    No one has commented yet.