kitsune 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/views/kitsune/show.html.haml +5 -0
- data/config/kitsune_routes.rb +7 -1
- data/kitsune.gemspec +3 -1
- data/lib/kitsune/layout.rb +15 -0
- data/lib/kitsune/page.rb +9 -0
- metadata +3 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/config/kitsune_routes.rb
CHANGED
@@ -11,5 +11,11 @@ ActionController::Routing::Routes.draw do |map|
|
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
|
+
if defined?(Page)
|
16
|
+
Page.all.each do |page|
|
17
|
+
map.connect page.url, :controller => 'kitsune', :action => 'show', :url => page.url[1..-1].split('/')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
15
21
|
end
|
data/kitsune.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{kitsune}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["toastyapps", "<matt@toastyapps.com>"]
|
@@ -48,6 +48,7 @@ Gem::Specification.new do |s|
|
|
48
48
|
"app/views/admin/kitsune/sessions/new.html.haml",
|
49
49
|
"app/views/admin/kitsune/shared/_flashes.html.haml",
|
50
50
|
"app/views/kitsune/show.html.erb",
|
51
|
+
"app/views/kitsune/show.html.haml",
|
51
52
|
"app/views/layouts/admin/kitsune.html.erb",
|
52
53
|
"config/kitsune_routes.rb",
|
53
54
|
"doc/developers.html",
|
@@ -377,6 +378,7 @@ Gem::Specification.new do |s|
|
|
377
378
|
"lib/kitsune/faux_column.rb",
|
378
379
|
"lib/kitsune/form_helper_ext.rb",
|
379
380
|
"lib/kitsune/inspector.rb",
|
381
|
+
"lib/kitsune/layout.rb",
|
380
382
|
"lib/kitsune/mongo_mapper.rb",
|
381
383
|
"lib/kitsune/page.rb",
|
382
384
|
"lib/kitsune_user.rb",
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Kitsune
|
2
|
+
class Layout
|
3
|
+
def initialize(layout_file)
|
4
|
+
data = File.read(layout_file)
|
5
|
+
@content_areas = data.scan(/yield\s+:(\w+)\s+/i).flatten.uniq
|
6
|
+
end
|
7
|
+
|
8
|
+
def content_areas
|
9
|
+
@content_areas
|
10
|
+
end
|
11
|
+
|
12
|
+
def method_missing(method, *arg, &block)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/kitsune/page.rb
CHANGED
@@ -31,6 +31,14 @@ module Kitsune
|
|
31
31
|
serialize :data
|
32
32
|
|
33
33
|
|
34
|
+
def after_save
|
35
|
+
ActionController::Routing::Routes.reload!
|
36
|
+
end
|
37
|
+
|
38
|
+
def after_destroy
|
39
|
+
ActionController::Routing::Routes.reload!
|
40
|
+
end
|
41
|
+
|
34
42
|
def title_for_url
|
35
43
|
CGI.escape(title.downcase.gsub(/\s+/, '-')).squeeze('-')
|
36
44
|
end
|
@@ -47,6 +55,7 @@ module Kitsune
|
|
47
55
|
unless ActionController::Routing::Routes.recognize_path(url.present? ? url : url_for_page, :method => :get)[:controller] == 'kitsune'
|
48
56
|
errors.add_to_base("URL is already being used")
|
49
57
|
end
|
58
|
+
rescue
|
50
59
|
end
|
51
60
|
end
|
52
61
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitsune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toastyapps
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- app/views/admin/kitsune/sessions/new.html.haml
|
75
75
|
- app/views/admin/kitsune/shared/_flashes.html.haml
|
76
76
|
- app/views/kitsune/show.html.erb
|
77
|
+
- app/views/kitsune/show.html.haml
|
77
78
|
- app/views/layouts/admin/kitsune.html.erb
|
78
79
|
- config/kitsune_routes.rb
|
79
80
|
- doc/developers.html
|
@@ -403,6 +404,7 @@ files:
|
|
403
404
|
- lib/kitsune/faux_column.rb
|
404
405
|
- lib/kitsune/form_helper_ext.rb
|
405
406
|
- lib/kitsune/inspector.rb
|
407
|
+
- lib/kitsune/layout.rb
|
406
408
|
- lib/kitsune/mongo_mapper.rb
|
407
409
|
- lib/kitsune/page.rb
|
408
410
|
- lib/kitsune_user.rb
|