sibu 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f0fc7bd3a2d8875fbef8b262138177995ddaf60
4
- data.tar.gz: a7e217c76b663623b83544e2d795b5de6d6c608d
3
+ metadata.gz: b05f7008d4b7d8ee375d74f6de51f7772ed3e68a
4
+ data.tar.gz: 5585207e5f786da54aa11d12a9d8e8b90aa0d2ce
5
5
  SHA512:
6
- metadata.gz: 651272394d1ea49918f25186a0bcc59eb5aa1bb2b73f7acd6108fa306a065e59dad20ce4c9c66993d4b6f14143119c7a4c3817ebd392f88cb44e4d92f66b0ba4
7
- data.tar.gz: f2b7299c8b124e0ca763c873f8f9f81a1fd8009d16564a4b31e57bbffa64be4550cadd2889334063c77e6eebac448f48027e71e34b5336f353dc649a7a9427b6
6
+ metadata.gz: 44d902c2b20de5c2525c673485d8fb7d729ee7d7475e9a8f4be9107a42530baad3b7fd1f7aa6dce298298acbf79ce096b2d7c08c11e599e70ccfc0c248c94f57
7
+ data.tar.gz: f4d3190ad437b679a791838071d4a87b2d1dc4cf74e94d69b9634ca6b0f2ff917a4ccb64bd5f84fb474c1ed5408f181b9a23d0671636e7a7c5cdb7399534b6a4
@@ -4,7 +4,7 @@ module Sibu
4
4
 
5
5
  def link_path(page_id)
6
6
  p = @site.page_by_id(page_id)
7
- p ? (@site.domain.blank? ? site_page_path(@site.id, p.id) : "/#{p.path}") : "#"
7
+ p ? (request.host == conf[:domain] ? site_page_path(@site.id, p.id) : "/#{p.path}") : "#"
8
8
  end
9
9
 
10
10
  def sections_templates
@@ -149,7 +149,7 @@ module Sibu
149
149
  defaults = {"id" => elt_id(elt), "value" => "", "text" => DEFAULT_TEXT}
150
150
  content = defaults.merge(elt.is_a?(Hash) ? elt : (select_element(elt) || {}))
151
151
  val = content.delete("value") || ""
152
- text = content.delete("text");
152
+ text = content.delete("text")
153
153
  html_opts.merge!({data: {id: elt_id(elt), type: "link", repeat: repeat, children: children}}) if action_name != 'show'
154
154
  if val.to_s.include?('/')
155
155
  content["href"] = val
@@ -47,7 +47,7 @@ module Sibu
47
47
  end
48
48
 
49
49
  def page_by_id(page_id)
50
- pages.where(id: page_id).first
50
+ pages.where(id: page_id).select(:id, :path).first
51
51
  end
52
52
 
53
53
  def save_and_init
data/lib/sibu/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sibu
2
- VERSION = '0.3.7'
2
+ VERSION = '0.3.8'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean-Baptiste Vilain