seiten 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/app/controllers/seiten/pages_controller.rb +0 -1
- data/lib/seiten/page.rb +2 -1
- data/lib/seiten/page_store.rb +9 -4
- data/lib/seiten/version.rb +1 -1
- data/lib/seiten.rb +0 -1
- data/test/dummy/config/navigation/en.yml +8 -0
- data/test/dummy/log/development.log +1 -0
- data/test/dummy/log/test.log +2356 -0
- data/test/page_test.rb +6 -0
- metadata +2 -4
- data/test/dummy/tmp/pids/server.pid +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 048ecf4f24e37168dfc694a467371919f46ce631
|
4
|
+
data.tar.gz: 63c13ce42bc05f60039f5e0f437d3f9810f72e85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a123a3ecdbdb8d2e529169b352bf2a242abc8f52d0b89902a7a09af951423ef87aec1a8ac117c5eb1c93f4cb4a4b920eb764a9d81e71f5f699aaa0c0f80f3b30
|
7
|
+
data.tar.gz: 2489e06d4d622e9ae121f50ef73f803600c6be8387afe4764931613395ca11e3aa55cfad861e0f08fc89d1ffeb780f1a31e7c1c8e51a801bfd5fbde8b69d2591
|
data/lib/seiten/page.rb
CHANGED
@@ -2,7 +2,7 @@ module Seiten
|
|
2
2
|
|
3
3
|
class Page
|
4
4
|
|
5
|
-
attr_accessor :id, :parent_id, :title, :children, :slug, :redirect, :layout
|
5
|
+
attr_accessor :id, :parent_id, :title, :children, :slug, :redirect, :layout, :metadata
|
6
6
|
|
7
7
|
# initialize Page object with attributes
|
8
8
|
def initialize(options={})
|
@@ -13,6 +13,7 @@ module Seiten
|
|
13
13
|
@external = options[:external]
|
14
14
|
@redirect = options[:redirect]
|
15
15
|
@layout = options[:layout]
|
16
|
+
@metadata = options[:metadata].each_with_object({}){|(k,v), h| h[k.to_sym] = v} if options[:metadata]
|
16
17
|
end
|
17
18
|
|
18
19
|
class << self
|
data/lib/seiten/page_store.rb
CHANGED
@@ -7,8 +7,7 @@ module Seiten
|
|
7
7
|
def initialize(options={})
|
8
8
|
@storage_type = options[:storage_type] || Seiten.config[:default_storage_type]
|
9
9
|
@storage_directory = options[:storage_directory] || File.join(Rails.root, Seiten.config[:default_storage_directory])
|
10
|
-
@storage_language = options[:storage_language] || I18n.locale
|
11
|
-
@storage_language = @storage_language.to_sym
|
10
|
+
@storage_language = (options[:storage_language] || I18n.locale).to_sym
|
12
11
|
@storage_file = options[:storage_file] || load_storage_file
|
13
12
|
@pages = load_pages
|
14
13
|
end
|
@@ -51,9 +50,15 @@ module Seiten
|
|
51
50
|
Seiten::PageStore.storages << Seiten::PageStore.new(storage_language: locale, storage_directory: File.join(Rails.root, "app", "pages", locale))
|
52
51
|
end
|
53
52
|
else
|
54
|
-
Seiten::PageStore.storages << Seiten::PageStore.new(storage_language:
|
53
|
+
Seiten::PageStore.storages << Seiten::PageStore.new(storage_language: default_locale)
|
55
54
|
end
|
56
|
-
set_current_page_store(storage_language:
|
55
|
+
set_current_page_store(storage_language: default_locale)
|
56
|
+
end
|
57
|
+
|
58
|
+
# NOTE: Haven't found out what's the problem, but Rails has some weird I18n behaviour on initialization.
|
59
|
+
# This method returns I18n.default_locale if config.i18n.default_locale is not set.
|
60
|
+
def default_locale
|
61
|
+
Rails.application.config.i18n.default_locale || I18n.default_locale
|
57
62
|
end
|
58
63
|
|
59
64
|
end
|
data/lib/seiten/version.rb
CHANGED
data/lib/seiten.rb
CHANGED
@@ -8,7 +8,15 @@
|
|
8
8
|
inherit: true
|
9
9
|
nodes:
|
10
10
|
- title: "Logo Design"
|
11
|
+
metadata:
|
12
|
+
header_image: "logo.jpg"
|
13
|
+
description: "Our logo design is awesome."
|
14
|
+
variables:
|
15
|
+
fuck: "you"
|
11
16
|
- title: "Web Development"
|
17
|
+
metadata:
|
18
|
+
header_image: "web-development.jpg"
|
19
|
+
description: "First class web development."
|
12
20
|
- title: "Hire us"
|
13
21
|
redirect: "/contact" # links to Contact page
|
14
22
|
|
@@ -4556,3 +4556,4 @@ Processing by Seiten::PagesController#show as HTML
|
|
4556
4556
|
Completed 200 OK in 5ms (Views: 5.2ms | ActiveRecord: 0.0ms)
|
4557
4557
|
Connecting to database specified by database.yml
|
4558
4558
|
Connecting to database specified by database.yml
|
4559
|
+
Connecting to database specified by database.yml
|