uzuuzu-cms 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/VERSION +1 -1
  2. data/lib/uzuuzu-cms.rb +2 -0
  3. data/lib/uzuuzu-cms/controller/admin/view/index.rhtml +35 -0
  4. data/lib/uzuuzu-cms/controller/contents.rb +6 -2
  5. data/lib/uzuuzu-cms/controller/error.rb +11 -0
  6. data/lib/uzuuzu-cms/controller/index.rb +0 -9
  7. data/lib/uzuuzu-cms/controller/initialize.rb +22 -87
  8. data/lib/uzuuzu-cms/controller/openid.rb +1 -1
  9. data/lib/uzuuzu-cms/controller/page.rb +43 -6
  10. data/lib/uzuuzu-cms/controller/user.rb +1 -2
  11. data/lib/uzuuzu-cms/controller/view/crud/destroy.rhtml +2 -2
  12. data/lib/uzuuzu-cms/controller/view/crud/edit.rhtml +2 -2
  13. data/lib/uzuuzu-cms/controller/view/crud/index.rhtml +2 -2
  14. data/lib/uzuuzu-cms/controller/view/crud/new.rhtml +2 -2
  15. data/lib/uzuuzu-cms/controller/view/crud/show.rhtml +2 -2
  16. data/lib/uzuuzu-cms/controller/view/error/404.rhtml +1 -1
  17. data/lib/uzuuzu-cms/controller/view/error/500.rhtml +1 -1
  18. data/lib/uzuuzu-cms/controller/view/initialize/step1.rhtml +7 -5
  19. data/lib/uzuuzu-cms/controller/view/initialize/step2.rhtml +6 -19
  20. data/lib/uzuuzu-cms/controller/view/openid/index.rhtml +3 -3
  21. data/lib/uzuuzu-cms/controller/view/user/entry.rhtml +4 -4
  22. data/lib/uzuuzu-cms/helper/page.rb +61 -0
  23. data/lib/uzuuzu-cms/model/authority.rb +18 -0
  24. data/lib/uzuuzu-cms/{controller/view/admin/index.rhtml → model/authority_group.rb} +0 -0
  25. data/lib/uzuuzu-cms/model/contents.rb +4 -2
  26. data/lib/uzuuzu-cms/model/info.rb +61 -89
  27. data/lib/uzuuzu-cms/model/layout.rb +19 -1
  28. data/lib/uzuuzu-cms/model/page.rb +57 -98
  29. data/lib/uzuuzu-cms/model/page_meta.rb +20 -0
  30. data/lib/uzuuzu-cms/model/user.rb +2 -0
  31. data/lib/uzuuzu-cms/wrapper/application.rb +6 -0
  32. data/lib/uzuuzu-cms/wrapper/controller.rb +17 -1
  33. data/lib/uzuuzu-cms/wrapper/helper.rb +6 -0
  34. data/lib/uzuuzu-cms/wrapper/lang/ja.yaml +5 -14
  35. data/lib/uzuuzu-cms/wrapper/model.rb +1 -1
  36. data/lib/uzuuzu-cms/wrapper/uzuuzu.rb +10 -0
  37. data/uzuuzu-cms.gemspec +11 -7
  38. metadata +12 -8
  39. data/lib/uzuuzu-cms/controller/plugin.rb +0 -16
  40. data/lib/uzuuzu-cms/controller/view/initialize/step3.rhtml +0 -24
  41. data/lib/uzuuzu-cms/controller/view/layout.rhtml +0 -25
  42. data/lib/uzuuzu-cms/model/page_body.rb +0 -37
@@ -0,0 +1,20 @@
1
+ # coding: utf-8
2
+
3
+ module UzuUzu
4
+ #
5
+ #
6
+ #
7
+ class PageMeta
8
+ include DataMapper::Resource
9
+
10
+ property :id, Serial
11
+ property :name, String,
12
+ :length => 255,
13
+ :required => true
14
+ property :content, String,
15
+ :length => 255,
16
+ :required => true
17
+
18
+ has n, :pages, :through => Resource
19
+ end # PageMeta
20
+ end # UzuUzu
@@ -18,6 +18,8 @@ module UzuUzu
18
18
  property :email, String,
19
19
  :length => 255
20
20
  property :web, Text
21
+ property :admin, Boolean,
22
+ :default => false
21
23
  timestamps :at
22
24
 
23
25
  end #User
@@ -0,0 +1,6 @@
1
+ # coding: utf-8
2
+
3
+ module UzuUzu
4
+ class Application
5
+ end # Application
6
+ end # UzuUzu
@@ -2,9 +2,9 @@
2
2
 
3
3
  module UzuUzu
4
4
  module Controller
5
- autoload(:Admin, 'uzuuzu-cms/controller/admin')
6
5
  autoload(:Contents, 'uzuuzu-cms/controller/contents')
7
6
  autoload(:Crud, 'uzuuzu-cms/controller/crud')
7
+ autoload(:Error, 'uzuuzu-cms/controller/error')
8
8
  autoload(:Index, 'uzuuzu-cms/controller/index')
9
9
  autoload(:Initialize, 'uzuuzu-cms/controller/initialize')
10
10
  autoload(:Oauth, 'uzuuzu-cms/controller/oauth')
@@ -12,5 +12,21 @@ module UzuUzu
12
12
  autoload(:Page, 'uzuuzu-cms/controller/page')
13
13
  autoload(:Plugin, 'uzuuzu-cms/controller/plugin')
14
14
  autoload(:User, 'uzuuzu-cms/controller/user')
15
+ module Admin
16
+ autoload(:Index, 'uzuuzu-cms/controller/admin/index')
17
+ end
18
+ module Blog
19
+ autoload(:Index, 'uzuuzu-cms/controller/admin/index')
20
+ end
21
+ module Ec
22
+ autoload(:Index, 'uzuuzu-cms/controller/admin/index')
23
+ end
24
+ module Wiki
25
+ autoload(:Index, 'uzuuzu-cms/controller/admin/index')
26
+ end
27
+
28
+ def info
29
+ @_info ||= ::UzuUzu::Info.uniq
30
+ end
15
31
  end
16
32
  end
@@ -0,0 +1,6 @@
1
+ # coding: utf-8
2
+
3
+ require 'uzuuzu-cms/helper/page'
4
+
5
+ ::UzuUzu::Application.dicons << ::UzuUzu::Helper::Page
6
+ ::UzuUzu::Application.helpers << ::UzuUzu::Helper::Page
@@ -7,27 +7,18 @@ update: 更新
7
7
  delete: 削除
8
8
 
9
9
  login: ログイン
10
+ to_admin_page: 管理画面へ
11
+ to_top_page: トップページへ
10
12
 
11
13
  # error
12
14
  not_found: お探しのページが見つかりません。
13
15
  server_error: エラーが発生しました。
14
16
 
15
17
  # openid
16
- openid_messege: ログイン方法を選択してください
18
+ openid_message: 以下よりログインするOpenIDサービスを選択してください
17
19
  openid_url: その他OpenId
18
20
 
19
- # user entry
20
- user_entry: ユーザー情報を登録してください
21
- user_entry_name: 表示するユーザー名
22
- user_entry_email: メールアドレス
23
- user_entry_web: ホームページアドレス
24
-
25
- # user entry error
26
- user_name_empty: ユーザー名の入力は必須です。
27
-
28
21
  # initialize
29
22
  initialize_title: 初期設定
30
- step1: 管理者を登録します。下記よりログインしてください。
31
- step2: 管理者情報を入力してください。
32
- step3: サイト情報を入力してください。
33
-
23
+ step1: 管理者を設定します。
24
+ step2: 初期設定が完了しました。管理画面にて構築を行ってください。
@@ -13,7 +13,7 @@ module UzuUzu
13
13
  autoload(:Info, 'uzuuzu-cms/model/info')
14
14
  autoload(:Layout, 'uzuuzu-cms/model/layout')
15
15
  autoload(:Movie, 'uzuuzu-cms/model/movie')
16
- autoload(:PageBody, 'uzuuzu-cms/model/page_body')
16
+ autoload(:PageMeta, 'uzuuzu-cms/model/page')
17
17
  autoload(:Page, 'uzuuzu-cms/model/page')
18
18
  autoload(:Javascript, 'uzuuzu-cms/model/javascript')
19
19
  autoload(:User, 'uzuuzu-cms/model/user')
@@ -0,0 +1,10 @@
1
+ # coding: utf-8
2
+
3
+ module UzuUzu
4
+ #
5
+ #
6
+ #
7
+ def self.info
8
+ UzuUzu::Controller.current.info
9
+ end # info
10
+ end # UzuUzu
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{uzuuzu-cms}
8
- s.version = "0.0.1"
8
+ s.version = "0.0.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Takuya Kondo"]
12
- s.date = %q{2011-08-23}
12
+ s.date = %q{2011-09-08}
13
13
  s.description = %q{cms on uzuuzu}
14
14
  s.email = %q{takuya.v3v@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -28,18 +28,18 @@ Gem::Specification.new do |s|
28
28
  "VERSION",
29
29
  "lib/uzuuzu-cms.rb",
30
30
  "lib/uzuuzu-cms/controller/admin/index.rb",
31
+ "lib/uzuuzu-cms/controller/admin/view/index.rhtml",
31
32
  "lib/uzuuzu-cms/controller/blog/index.rb",
32
33
  "lib/uzuuzu-cms/controller/contents.rb",
33
34
  "lib/uzuuzu-cms/controller/crud.rb",
34
35
  "lib/uzuuzu-cms/controller/ec/index.rb",
36
+ "lib/uzuuzu-cms/controller/error.rb",
35
37
  "lib/uzuuzu-cms/controller/index.rb",
36
38
  "lib/uzuuzu-cms/controller/initialize.rb",
37
39
  "lib/uzuuzu-cms/controller/oauth.rb",
38
40
  "lib/uzuuzu-cms/controller/openid.rb",
39
41
  "lib/uzuuzu-cms/controller/page.rb",
40
- "lib/uzuuzu-cms/controller/plugin.rb",
41
42
  "lib/uzuuzu-cms/controller/user.rb",
42
- "lib/uzuuzu-cms/controller/view/admin/index.rhtml",
43
43
  "lib/uzuuzu-cms/controller/view/crud/destroy.rhtml",
44
44
  "lib/uzuuzu-cms/controller/view/crud/edit.rhtml",
45
45
  "lib/uzuuzu-cms/controller/view/crud/index.rhtml",
@@ -49,11 +49,12 @@ Gem::Specification.new do |s|
49
49
  "lib/uzuuzu-cms/controller/view/error/500.rhtml",
50
50
  "lib/uzuuzu-cms/controller/view/initialize/step1.rhtml",
51
51
  "lib/uzuuzu-cms/controller/view/initialize/step2.rhtml",
52
- "lib/uzuuzu-cms/controller/view/initialize/step3.rhtml",
53
- "lib/uzuuzu-cms/controller/view/layout.rhtml",
54
52
  "lib/uzuuzu-cms/controller/view/openid/index.rhtml",
55
53
  "lib/uzuuzu-cms/controller/view/user/entry.rhtml",
56
54
  "lib/uzuuzu-cms/controller/wiki/index.rb",
55
+ "lib/uzuuzu-cms/helper/page.rb",
56
+ "lib/uzuuzu-cms/model/authority.rb",
57
+ "lib/uzuuzu-cms/model/authority_group.rb",
57
58
  "lib/uzuuzu-cms/model/blog.rb",
58
59
  "lib/uzuuzu-cms/model/blog_category.rb",
59
60
  "lib/uzuuzu-cms/model/blog_comment.rb",
@@ -67,17 +68,20 @@ Gem::Specification.new do |s|
67
68
  "lib/uzuuzu-cms/model/layout.rb",
68
69
  "lib/uzuuzu-cms/model/movie.rb",
69
70
  "lib/uzuuzu-cms/model/page.rb",
70
- "lib/uzuuzu-cms/model/page_body.rb",
71
+ "lib/uzuuzu-cms/model/page_meta.rb",
71
72
  "lib/uzuuzu-cms/model/user.rb",
72
73
  "lib/uzuuzu-cms/model/wiki.rb",
73
74
  "lib/uzuuzu-cms/model/wiki_attache.rb",
74
75
  "lib/uzuuzu-cms/model/wiki_entry.rb",
75
76
  "lib/uzuuzu-cms/model/wiki_layout.rb",
77
+ "lib/uzuuzu-cms/wrapper/application.rb",
76
78
  "lib/uzuuzu-cms/wrapper/controller.rb",
77
79
  "lib/uzuuzu-cms/wrapper/environments.rb",
80
+ "lib/uzuuzu-cms/wrapper/helper.rb",
78
81
  "lib/uzuuzu-cms/wrapper/lang/en.yaml",
79
82
  "lib/uzuuzu-cms/wrapper/lang/ja.yaml",
80
83
  "lib/uzuuzu-cms/wrapper/model.rb",
84
+ "lib/uzuuzu-cms/wrapper/uzuuzu.rb",
81
85
  "spec/spec_helper.rb",
82
86
  "spec/uzuuzu-cms_spec.rb",
83
87
  "template/app.rb",
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: uzuuzu-cms
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Takuya Kondo
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-23 00:00:00 +09:00
13
+ date: 2011-09-08 00:00:00 +09:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -89,18 +89,18 @@ files:
89
89
  - VERSION
90
90
  - lib/uzuuzu-cms.rb
91
91
  - lib/uzuuzu-cms/controller/admin/index.rb
92
+ - lib/uzuuzu-cms/controller/admin/view/index.rhtml
92
93
  - lib/uzuuzu-cms/controller/blog/index.rb
93
94
  - lib/uzuuzu-cms/controller/contents.rb
94
95
  - lib/uzuuzu-cms/controller/crud.rb
95
96
  - lib/uzuuzu-cms/controller/ec/index.rb
97
+ - lib/uzuuzu-cms/controller/error.rb
96
98
  - lib/uzuuzu-cms/controller/index.rb
97
99
  - lib/uzuuzu-cms/controller/initialize.rb
98
100
  - lib/uzuuzu-cms/controller/oauth.rb
99
101
  - lib/uzuuzu-cms/controller/openid.rb
100
102
  - lib/uzuuzu-cms/controller/page.rb
101
- - lib/uzuuzu-cms/controller/plugin.rb
102
103
  - lib/uzuuzu-cms/controller/user.rb
103
- - lib/uzuuzu-cms/controller/view/admin/index.rhtml
104
104
  - lib/uzuuzu-cms/controller/view/crud/destroy.rhtml
105
105
  - lib/uzuuzu-cms/controller/view/crud/edit.rhtml
106
106
  - lib/uzuuzu-cms/controller/view/crud/index.rhtml
@@ -110,11 +110,12 @@ files:
110
110
  - lib/uzuuzu-cms/controller/view/error/500.rhtml
111
111
  - lib/uzuuzu-cms/controller/view/initialize/step1.rhtml
112
112
  - lib/uzuuzu-cms/controller/view/initialize/step2.rhtml
113
- - lib/uzuuzu-cms/controller/view/initialize/step3.rhtml
114
- - lib/uzuuzu-cms/controller/view/layout.rhtml
115
113
  - lib/uzuuzu-cms/controller/view/openid/index.rhtml
116
114
  - lib/uzuuzu-cms/controller/view/user/entry.rhtml
117
115
  - lib/uzuuzu-cms/controller/wiki/index.rb
116
+ - lib/uzuuzu-cms/helper/page.rb
117
+ - lib/uzuuzu-cms/model/authority.rb
118
+ - lib/uzuuzu-cms/model/authority_group.rb
118
119
  - lib/uzuuzu-cms/model/blog.rb
119
120
  - lib/uzuuzu-cms/model/blog_category.rb
120
121
  - lib/uzuuzu-cms/model/blog_comment.rb
@@ -128,17 +129,20 @@ files:
128
129
  - lib/uzuuzu-cms/model/layout.rb
129
130
  - lib/uzuuzu-cms/model/movie.rb
130
131
  - lib/uzuuzu-cms/model/page.rb
131
- - lib/uzuuzu-cms/model/page_body.rb
132
+ - lib/uzuuzu-cms/model/page_meta.rb
132
133
  - lib/uzuuzu-cms/model/user.rb
133
134
  - lib/uzuuzu-cms/model/wiki.rb
134
135
  - lib/uzuuzu-cms/model/wiki_attache.rb
135
136
  - lib/uzuuzu-cms/model/wiki_entry.rb
136
137
  - lib/uzuuzu-cms/model/wiki_layout.rb
138
+ - lib/uzuuzu-cms/wrapper/application.rb
137
139
  - lib/uzuuzu-cms/wrapper/controller.rb
138
140
  - lib/uzuuzu-cms/wrapper/environments.rb
141
+ - lib/uzuuzu-cms/wrapper/helper.rb
139
142
  - lib/uzuuzu-cms/wrapper/lang/en.yaml
140
143
  - lib/uzuuzu-cms/wrapper/lang/ja.yaml
141
144
  - lib/uzuuzu-cms/wrapper/model.rb
145
+ - lib/uzuuzu-cms/wrapper/uzuuzu.rb
142
146
  - spec/spec_helper.rb
143
147
  - spec/uzuuzu-cms_spec.rb
144
148
  - template/app.rb
@@ -201,7 +205,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
201
205
  requirements:
202
206
  - - ">="
203
207
  - !ruby/object:Gem::Version
204
- hash: 880284361759703514
208
+ hash: -1973875796380053779
205
209
  segments:
206
210
  - 0
207
211
  version: "0"
@@ -1,16 +0,0 @@
1
- # coding: utf-8
2
-
3
- module UzuUzu
4
- module Controller
5
- class Plugin
6
-
7
- def before
8
- redirect(rf(Initialize)) unless info.initialize?
9
- end
10
-
11
- def index
12
- ''
13
- end
14
- end # Plugin
15
- end # Controller
16
- end # UzuUzu
@@ -1,24 +0,0 @@
1
-
2
- <div id="step3">
3
- <p>
4
- <%= fix_localize(:step3) %>
5
- </p>
6
- <form method="post">
7
- <p class='error_detail'><%= @error %></p>
8
- <p>
9
- <%= fix_localize(:info_title) %>:
10
- <input type="text" name="title" />
11
- </p>
12
- <p>
13
- <%= fix_localize(:user_entry_email) %>:
14
- <input type="text" name="email" />
15
- </p>
16
- <p>
17
- <%= fix_localize(:user_entry_web) %>:
18
- <input type="text" name="web" />
19
- </p>
20
- <p>
21
- <input type="submit" value="<%= fix_localize(:entry) %>"/>
22
- </p>
23
- </form>
24
- </div>
@@ -1,25 +0,0 @@
1
- <?xml version="1.0" ?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml">
5
- <head>
6
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
7
- <meta http-equiv="Content-Style-Type" content="text/css" />
8
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
- <meta http-equiv="expires" content="-1" />
10
- <link rel="apple-touch-icon" href="/favicon.png">
11
- <% unless @meta.blank?
12
- @meta.each do |meta|
13
- %>
14
- <meta name="<%= h key %>" content="<%= h value %>">
15
- <% end
16
- end
17
- %>
18
- <title><%= h "#{@title} - " unless @title.blank? %><%= h info.title if info %></title>
19
- <%= css_for @css unless @css.blank? %>
20
- <%= js_for @js unless @js.blank? %>
21
- </head>
22
- <body >
23
- <%= @contents %>
24
- </body>
25
- </html>
@@ -1,37 +0,0 @@
1
- # coding: utf-8
2
- require 'uzuuzu-cms/model/contents'
3
-
4
- module UzuUzu
5
-
6
- class ContentsPageBody
7
- include DataMapper::Resource
8
-
9
- belongs_to :page_body, :key => true
10
- belongs_to :contents, 'UzuUzu::Contents', :key => true
11
- end
12
-
13
- class Contents
14
- has n, :page_bodies, :through => Resource, :via => :page_body
15
- end
16
-
17
- class PageBody
18
- include DataMapper::Resource
19
-
20
- property :id, Serial
21
-
22
- has n, :contents, 'UzuUzu::Contents', :through => Resource, :via => :contents
23
-
24
- def render(instance=nil, options={})
25
- self.contents.map do |c|
26
- c.render(instance=nil, options={})
27
- end.join('\n')
28
- end
29
- end # PageBody
30
-
31
- if auto_upgrade?
32
- repository do
33
- PageBody.auto_upgrade!
34
- ContentsPageBody.auto_upgrade!
35
- end
36
- end
37
- end # UzuUzu