uzuuzu-cms 0.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.project +17 -0
- data/.rspec +1 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +99 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +19 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/lib/uzuuzu-cms/controller/admin.rb +16 -0
- data/lib/uzuuzu-cms/controller/contents.rb +16 -0
- data/lib/uzuuzu-cms/controller/crud.rb +245 -0
- data/lib/uzuuzu-cms/controller/index.rb +108 -0
- data/lib/uzuuzu-cms/controller/initialize.rb +53 -0
- data/lib/uzuuzu-cms/controller/oauth.rb +10 -0
- data/lib/uzuuzu-cms/controller/openid.rb +105 -0
- data/lib/uzuuzu-cms/controller/page.rb +20 -0
- data/lib/uzuuzu-cms/controller/plugin.rb +16 -0
- data/lib/uzuuzu-cms/controller/user.rb +27 -0
- data/lib/uzuuzu-cms/controller/view/admin/index.rhtml +0 -0
- data/lib/uzuuzu-cms/controller/view/crud/destroy.rhtml +28 -0
- data/lib/uzuuzu-cms/controller/view/crud/edit.rhtml +52 -0
- data/lib/uzuuzu-cms/controller/view/crud/index.rhtml +45 -0
- data/lib/uzuuzu-cms/controller/view/crud/new.rhtml +48 -0
- data/lib/uzuuzu-cms/controller/view/crud/show.rhtml +47 -0
- data/lib/uzuuzu-cms/controller/view/error/404.rhtml +2 -0
- data/lib/uzuuzu-cms/controller/view/error/500.rhtml +2 -0
- data/lib/uzuuzu-cms/controller/view/initialize/step1.rhtml +15 -0
- data/lib/uzuuzu-cms/controller/view/initialize/step2.rhtml +1 -0
- data/lib/uzuuzu-cms/controller/view/initialize/step3.rhtml +0 -0
- data/lib/uzuuzu-cms/controller/view/layout.rhtml +25 -0
- data/lib/uzuuzu-cms/controller/view/openid/index.rhtml +14 -0
- data/lib/uzuuzu-cms/controller/view/user/entry.rhtml +13 -0
- data/lib/uzuuzu-cms/controller.rb +16 -0
- data/lib/uzuuzu-cms/fixture/layout.yaml +110 -0
- data/lib/uzuuzu-cms/model/blog.rb +40 -0
- data/lib/uzuuzu-cms/model/blog_category.rb +15 -0
- data/lib/uzuuzu-cms/model/blog_comment.rb +29 -0
- data/lib/uzuuzu-cms/model/blog_entry.rb +24 -0
- data/lib/uzuuzu-cms/model/contents.rb +43 -0
- data/lib/uzuuzu-cms/model/css.rb +22 -0
- data/lib/uzuuzu-cms/model/file.rb +41 -0
- data/lib/uzuuzu-cms/model/image.rb +41 -0
- data/lib/uzuuzu-cms/model/info.rb +127 -0
- data/lib/uzuuzu-cms/model/javascript.rb +22 -0
- data/lib/uzuuzu-cms/model/layout.rb +22 -0
- data/lib/uzuuzu-cms/model/movie.rb +39 -0
- data/lib/uzuuzu-cms/model/page.rb +167 -0
- data/lib/uzuuzu-cms/model/page_body.rb +28 -0
- data/lib/uzuuzu-cms/model/user.rb +30 -0
- data/lib/uzuuzu-cms/model/wiki.rb +43 -0
- data/lib/uzuuzu-cms/model/wiki_attache.rb +26 -0
- data/lib/uzuuzu-cms/model/wiki_entry.rb +21 -0
- data/lib/uzuuzu-cms/model/wiki_layout.rb +13 -0
- data/lib/uzuuzu-cms/model.rb +24 -0
- data/lib/uzuuzu-cms.rb +5 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/uzuuzu-cms_spec.rb +7 -0
- data/template/app.rb +3 -0
- data/template/config.ru +15 -0
- data/template/public/css/images/ajax-loader.png +0 -0
- data/template/public/css/images/icon-search-black.png +0 -0
- data/template/public/css/images/icons-18-black.png +0 -0
- data/template/public/css/images/icons-18-white.png +0 -0
- data/template/public/css/images/icons-36-black.png +0 -0
- data/template/public/css/images/icons-36-white.png +0 -0
- data/template/public/css/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/template/public/css/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/template/public/css/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/template/public/css/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/template/public/css/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/template/public/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/template/public/css/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/template/public/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/template/public/css/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/template/public/css/images/ui-icons_222222_256x240.png +0 -0
- data/template/public/css/images/ui-icons_228ef1_256x240.png +0 -0
- data/template/public/css/images/ui-icons_ef8c08_256x240.png +0 -0
- data/template/public/css/images/ui-icons_ffd27a_256x240.png +0 -0
- data/template/public/css/images/ui-icons_ffffff_256x240.png +0 -0
- data/template/public/css/index.css +146 -0
- data/template/public/css/jquery-ui.css +578 -0
- data/template/public/css/jquery.mobile.css +16 -0
- data/template/public/css/screen.css +30 -0
- data/template/public/dispatch.fcgi +27 -0
- data/template/public/js/jquery-ui.js +784 -0
- data/template/public/js/jquery.js +16 -0
- data/template/public/js/jquery.mobile.js +134 -0
- data/template/public/js/uzuuzu-ui.js +0 -0
- data/template/public/js/uzuuzu.js +0 -0
- data/template/public/js/uzuuzu.mobile.js +0 -0
- data/template/start.rb +29 -0
- data/template/uzuuzu.yaml +43 -0
- data/uzuuzu-cms.gemspec +145 -0
- metadata +207 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
require 'openid'
|
4
|
+
require 'openid/store/filesystem'
|
5
|
+
require 'openid/extensions/pape'
|
6
|
+
require 'openid/extensions/sreg'
|
7
|
+
require 'openid/store/memcache'
|
8
|
+
|
9
|
+
module UzuUzu
|
10
|
+
module Controller
|
11
|
+
class Openid
|
12
|
+
|
13
|
+
def index
|
14
|
+
|
15
|
+
p request.domain
|
16
|
+
if session[:openid] and session[:openid][:identity]
|
17
|
+
referer = session[:referer]
|
18
|
+
session.delete(:referer)
|
19
|
+
login_remote_user
|
20
|
+
redirect referer || rf(Index)
|
21
|
+
end
|
22
|
+
session[:referer] = request.referrer
|
23
|
+
if info.initialize?
|
24
|
+
|
25
|
+
else
|
26
|
+
respond(info.render(render_file(__DIR__('view/openid/index.rhtml')),
|
27
|
+
:layout => __DIR__('view/layout.rhtml')))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def logout
|
32
|
+
session.delete(:openid)
|
33
|
+
end
|
34
|
+
|
35
|
+
def openid_begin
|
36
|
+
url = request['url']
|
37
|
+
redirect_referrer if url.to_s.empty?
|
38
|
+
session[:openid] ||= {}
|
39
|
+
session[:openid][:entry] = request.referrer
|
40
|
+
|
41
|
+
openid_request = openid_consumer.begin(url)
|
42
|
+
|
43
|
+
papereq = OpenID::PAPE::Request.new
|
44
|
+
papereq.add_policy_uri(OpenID::PAPE::AUTH_PHISHING_RESISTANT)
|
45
|
+
papereq.max_auth_age = 2*60*60
|
46
|
+
openid_request.add_extension(papereq)
|
47
|
+
|
48
|
+
sregreq = OpenID::SReg::Request.new
|
49
|
+
sregreq.request_fields(['fullname', 'nickname', 'dob', 'email',
|
50
|
+
'gender', 'postcode', 'country', 'language',
|
51
|
+
'timezone'])
|
52
|
+
openid_request.add_extension(sregreq)
|
53
|
+
openid_request.return_to_args['did_pape'] = 'y'
|
54
|
+
|
55
|
+
root = request.domain
|
56
|
+
p request.domain
|
57
|
+
return_to = request.domain(r(:openid_complete))
|
58
|
+
immediate = false
|
59
|
+
|
60
|
+
if openid_request.send_redirect?(root, return_to, immediate)
|
61
|
+
redirect_url =
|
62
|
+
openid_request.redirect_url(root, return_to, immediate)
|
63
|
+
redirect redirect_url
|
64
|
+
else
|
65
|
+
# what the hell is @form_text ?
|
66
|
+
end
|
67
|
+
|
68
|
+
rescue OpenID::OpenIDError => ex
|
69
|
+
flash[:error] = "Discovery failed for #{url}: #{ex}"
|
70
|
+
redirect r
|
71
|
+
end
|
72
|
+
|
73
|
+
def openid_complete
|
74
|
+
openid_response = openid_consumer.complete(request.params, request.url)
|
75
|
+
|
76
|
+
case openid_response.status
|
77
|
+
when OpenID::Consumer::FAILURE
|
78
|
+
when OpenID::Consumer::SUCCESS
|
79
|
+
# Backwards compatibility
|
80
|
+
session[:openid][:identity] = openid_response.identity_url
|
81
|
+
session[:openid][:sreg] = OpenID::SReg::Response.from_success_response(openid_response)
|
82
|
+
end
|
83
|
+
redirect session[:openid][:entry]
|
84
|
+
end
|
85
|
+
|
86
|
+
|
87
|
+
private
|
88
|
+
|
89
|
+
#logined
|
90
|
+
def login_remote_user
|
91
|
+
remote_user = User.first(:user_id => session[:openid][:identity])
|
92
|
+
if remote_user.nil?
|
93
|
+
#remote_user = User.new(:user_id => session[:openid_identity])
|
94
|
+
#remote_user.save!
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# use memcache
|
99
|
+
def openid_consumer
|
100
|
+
memcache = OpenID::Store::Memcache.new(UzuUzu.memcache)
|
101
|
+
OpenID::Consumer.new(session, memcache)
|
102
|
+
end
|
103
|
+
end # Openid
|
104
|
+
end # Controller
|
105
|
+
end # UzuUzu
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module UzuUzu
|
4
|
+
module Controller
|
5
|
+
class Page
|
6
|
+
|
7
|
+
def before
|
8
|
+
redirect(rf(Initialize)) unless info.initialize?
|
9
|
+
end
|
10
|
+
|
11
|
+
def index(page, *args)
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
def top_page
|
16
|
+
""
|
17
|
+
end
|
18
|
+
end # Page
|
19
|
+
end # Controller
|
20
|
+
end # UzuUzu
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module UzuUzu
|
4
|
+
module Controller
|
5
|
+
class User
|
6
|
+
|
7
|
+
def before
|
8
|
+
redirect(rf(Initialize)) unless info.initialize?
|
9
|
+
end
|
10
|
+
|
11
|
+
def entry(id)
|
12
|
+
saved = false
|
13
|
+
UzuUzu.transaction do |tr|
|
14
|
+
@user = User.first(:id => id)
|
15
|
+
if request.post?
|
16
|
+
@user.name = request.params['username']
|
17
|
+
tr.commit do
|
18
|
+
saved = @user.save
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
view_value = render_file(__DIR__("view/user/entry.xhtml"))
|
23
|
+
respond(view_value)
|
24
|
+
end
|
25
|
+
end # User
|
26
|
+
end # Controller
|
27
|
+
end # UzuUzu
|
File without changes
|
@@ -0,0 +1,28 @@
|
|
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
|
+
<%= css 'jquery.mobile' %>
|
11
|
+
<%= js_for 'jquery', 'jquery.mobile' %>
|
12
|
+
</head>
|
13
|
+
<body >
|
14
|
+
<div data-role="page" id="confirm">
|
15
|
+
<div data-role="header">
|
16
|
+
<h1><%= h @model_name.camel_case %> Confirm</h1>
|
17
|
+
</div>
|
18
|
+
<div data-role="content">
|
19
|
+
<h1>Delete?</h1>
|
20
|
+
<a href="<%= r(:destroy, @model_name, @resource.id) %>" data-ajax="false"
|
21
|
+
data-role="button" data-icon="delete">Delete</a>
|
22
|
+
<a href="#"
|
23
|
+
data-role="button" data-icon="back" data-rel="back"
|
24
|
+
data-transition="pop">Cansel</a>
|
25
|
+
</div>
|
26
|
+
</div>
|
27
|
+
</body>
|
28
|
+
</html>
|
@@ -0,0 +1,52 @@
|
|
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
|
+
<%= css 'jquery.mobile' %>
|
11
|
+
<%= js_for 'jquery', 'jquery.mobile' %>
|
12
|
+
</head>
|
13
|
+
<body >
|
14
|
+
<div data-role="page" id="top">
|
15
|
+
<div data-role="header">
|
16
|
+
<a href="<%= r(@model_name) %>" data-role="button" data-icon="back"
|
17
|
+
data-ajax="false" data-direction="reverse">List</a>
|
18
|
+
<h1><%= h @model_name.camel_case %> Edit</h1>
|
19
|
+
</div>
|
20
|
+
<div data-role="content">
|
21
|
+
<form action="<%= r(:edit, @model_name, @resource.id) %>"
|
22
|
+
method="post" id="form" name="form" data-ajax="false">
|
23
|
+
<% @resource.class.properties.each do |property| %>
|
24
|
+
<p style="color: #FF0000;">
|
25
|
+
<%= @resource.errors[property.name].join(',') %>
|
26
|
+
</p>
|
27
|
+
<p>
|
28
|
+
<label for="<%= property.name %>">
|
29
|
+
<%= h property.name %>
|
30
|
+
</label>
|
31
|
+
<% if property.kind_of?(DataMapper::Property::Text) %>
|
32
|
+
<textarea name="<%= property.name %>" id="<%= property.name %>"><%= @resource[property.name] %></textarea>
|
33
|
+
<% else %>
|
34
|
+
<input type="text" name="<%= property.name %>"
|
35
|
+
id="<%= property.name %>" value="<%= @resource[property.name] %>">
|
36
|
+
</input>
|
37
|
+
<% end %>
|
38
|
+
</p>
|
39
|
+
<% end unless @resource.nil? %>
|
40
|
+
</form>
|
41
|
+
</div>
|
42
|
+
<div id="footer" data-role="footer" class="ui-bar" data-position="fixed" data-id="persist">
|
43
|
+
<a href="#"
|
44
|
+
data-role="button" data-icon="forward" data-ajax="false"
|
45
|
+
onclick="$('#form').submit(); return false;">Update</a>
|
46
|
+
<a href="<%= r(:destroy, @model_name, @resource.id, 'confirm') %>"
|
47
|
+
data-rel="dialog" data-transition="pop"
|
48
|
+
data-role="button" data-icon="delete">Destroy</a>
|
49
|
+
</div>
|
50
|
+
</div>
|
51
|
+
</body>
|
52
|
+
</html>
|
@@ -0,0 +1,45 @@
|
|
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
|
+
<%= css 'jquery.mobile' %>
|
11
|
+
<%= js_for 'jquery', 'jquery.mobile' %>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<div data-role="page" id="top">
|
15
|
+
<div data-role="header">
|
16
|
+
<h1><%= h @model_name.camel_case %></h1>
|
17
|
+
<a href="<%= r(:new, @model_name) %>" class="ui-btn-right"
|
18
|
+
data-role="button" data-icon="plus" data-ajax="false">Add</a>
|
19
|
+
</div>
|
20
|
+
<div data-role="content">
|
21
|
+
<ul data-role="listview" id="list" class="ui-li-has-thumb">
|
22
|
+
<% @list.each do |resource| %>
|
23
|
+
<li>
|
24
|
+
<a href="<%= r(:edit, @model_name, resource.id) %>" data-ajax="false">
|
25
|
+
<% resource.class.properties.each_with_index do |property, i| %>
|
26
|
+
<% unless i == 0 %>
|
27
|
+
<span>,</span><% end %>
|
28
|
+
<span><%= h property.name %>:<%= h resource[property.name].to_s[0..9] %>
|
29
|
+
<% if resource[property.name].to_s.size > 10 %>...<% end %></span>
|
30
|
+
<% end %>
|
31
|
+
</a>
|
32
|
+
</li>
|
33
|
+
<% end unless @list.nil? %>
|
34
|
+
</ul>
|
35
|
+
</div>
|
36
|
+
<div data-role="footer" data-position="fixed">
|
37
|
+
<form id="search" method="post" action="<%= r(@model_name) %>" data-ajax="false">
|
38
|
+
<input type="search" id="query" name="query" value="<%= @query %>"/>
|
39
|
+
<a href="#" data-role="button" data-icon="search"
|
40
|
+
onclick="$('#search').submit(); return false;">Search</a>
|
41
|
+
</form>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
</body>
|
45
|
+
</html>
|
@@ -0,0 +1,48 @@
|
|
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
|
+
<%= css 'jquery.mobile' %>
|
11
|
+
<%= js_for 'jquery', 'jquery.mobile' %>
|
12
|
+
</head>
|
13
|
+
<body >
|
14
|
+
<div data-role="page" id="top">
|
15
|
+
<div data-role="header">
|
16
|
+
<a href="<%= r(@model_name) %>" data-role="button" data-icon="back"
|
17
|
+
data-ajax="false" data-direction="reverse">List</a>
|
18
|
+
<h1><%= h @model_name.camel_case %> New</h1>
|
19
|
+
</div>
|
20
|
+
<div data-role="content">
|
21
|
+
<form action="<%= r(:new, @model_name) %>" method="post" id="form" name="form" data-ajax="false">
|
22
|
+
<% @resource.class.properties.each do |property| %>
|
23
|
+
<p style="color: #FF0000;">
|
24
|
+
<%= @resource.errors[property.name].join(',') %>
|
25
|
+
</p>
|
26
|
+
<p>
|
27
|
+
<label for="<%= property.name %>">
|
28
|
+
<%= h property.name %>
|
29
|
+
</label>
|
30
|
+
<% if property.kind_of?(DataMapper::Property::Text) %>
|
31
|
+
<textarea name="<%= property.name %>" id="<%= property.name %>"><%= @resource[property.name] %></textarea>
|
32
|
+
<% else %>
|
33
|
+
<input type="text" name="<%= property.name %>"
|
34
|
+
id="<%= property.name %>" value="<%= @resource[property.name] %>">
|
35
|
+
</input>
|
36
|
+
<% end %>
|
37
|
+
</p>
|
38
|
+
<% end %>
|
39
|
+
</form>
|
40
|
+
</div>
|
41
|
+
<div id="footer" data-role="footer" class="ui-bar" data-position="fixed" data-id="persist">
|
42
|
+
<a href="#"
|
43
|
+
data-role="button" data-icon="plus"
|
44
|
+
onclick="$('#form').submit(); return false;">Insert</a>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
</body>
|
48
|
+
</html>
|
@@ -0,0 +1,47 @@
|
|
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="0" />
|
10
|
+
<%= css 'jquery.mobile' %>
|
11
|
+
<%= js_for 'jquery', 'jquery.mobile' %>
|
12
|
+
</head>
|
13
|
+
<body >
|
14
|
+
<div data-role="page" id="top">
|
15
|
+
<div data-role="header">
|
16
|
+
<a href="<%= r(@model_name) %>" data-role="button" data-icon="back"
|
17
|
+
data-ajax="false" data-direction="reverse">List</a>
|
18
|
+
<h1><%= h @model_name.camel_case %> Show</h1>
|
19
|
+
</div>
|
20
|
+
<div data-role="content">
|
21
|
+
<form action="<%= r(:show, @model_name, @resource.id) %>" method="post" id="form" name="form" data-ajax="false">
|
22
|
+
<% @resource.class.properties.each do |property| %>
|
23
|
+
<p style="color: #FF0000;">
|
24
|
+
<%= @resource.errors[property.name].join(',') %>
|
25
|
+
</p>
|
26
|
+
<p>
|
27
|
+
<label for="<%= property.name %>">
|
28
|
+
<%= h property.name %>
|
29
|
+
</label>
|
30
|
+
<% if property.kind_of?(DataMapper::Property::Text) %>
|
31
|
+
<textarea name="<%= property.name %>" id="<%= property.name %>" disabled="true"><%= @resource[property.name] %></textarea>
|
32
|
+
<% else %>
|
33
|
+
<input type="text" name="<%= property.name %>"
|
34
|
+
id="<%= property.name %>" value="<%= @resource[property.name] %>" disabled="true">
|
35
|
+
</input>
|
36
|
+
<% end %>
|
37
|
+
</p>
|
38
|
+
<% end unless @resource.nil? %>
|
39
|
+
</form>
|
40
|
+
</div>
|
41
|
+
<div id="footer" data-role="footer" class="ui-bar" data-position="fixed" data-id="persist">
|
42
|
+
<a href="/crud/edit/<%= @model_name %>/<%= @resource.id %>" data-ajax="false"
|
43
|
+
data-role="button" data-icon="refresh">Edit</a>
|
44
|
+
</div>
|
45
|
+
</div>
|
46
|
+
</body>
|
47
|
+
</html>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
<div id="openid_index">
|
3
|
+
<p>
|
4
|
+
<%= fix_localize(:openid_message) %>
|
5
|
+
</p>
|
6
|
+
<form method="post" action="<%= rf(UzuUzu::Controller::Openid, :openid_begin) %>">
|
7
|
+
<p>
|
8
|
+
<%= fix_localize(:openid_url) %>:
|
9
|
+
<input type="text" name="url" />
|
10
|
+
</p>
|
11
|
+
<p>
|
12
|
+
<input type="submit" value="<%= fix_localize(:login) %>"/>
|
13
|
+
</p>
|
14
|
+
</form>
|
15
|
+
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
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>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div id="openid_index">
|
2
|
+
<p>
|
3
|
+
<%= fix_localize(:openid_message) %>
|
4
|
+
</p>
|
5
|
+
<form method="post" action="<%= r(:openid_begin) %>">
|
6
|
+
<p>
|
7
|
+
<%= fix_localize(:openid_url) %>:
|
8
|
+
<input type="text" name="url" />
|
9
|
+
</p>
|
10
|
+
<p>
|
11
|
+
<input type="submit" value="<%= fix_localize(:login) %>"/>
|
12
|
+
</p>
|
13
|
+
</form>
|
14
|
+
</div>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
<div id="user_entry">
|
3
|
+
<p>#{uzuuzu_string(:user_entry)}"</p>
|
4
|
+
<form method="post" action="#{rs(:entry, @user.id)}">
|
5
|
+
<p>
|
6
|
+
#{uzuuzu_string(:user_entry_name)}:
|
7
|
+
<input id="username" name="username" type="text" />
|
8
|
+
</p>
|
9
|
+
<p>
|
10
|
+
<input type="submit" value="#{uzuuzu_string(:entry)}"/>
|
11
|
+
</p>
|
12
|
+
</form>
|
13
|
+
</div>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module UzuUzu
|
4
|
+
module Controller
|
5
|
+
autoload(:Admin, 'uzuuzu/controller/admin')
|
6
|
+
autoload(:Contents, 'uzuuzu/controller/contents')
|
7
|
+
autoload(:Crud, 'uzuuzu/controller/crud')
|
8
|
+
autoload(:Index, 'uzuuzu/controller/index')
|
9
|
+
autoload(:Initialize, 'uzuuzu/controller/initialize')
|
10
|
+
autoload(:Oauth, 'uzuuzu/controller/oauth')
|
11
|
+
autoload(:Openid, 'uzuuzu/controller/openid')
|
12
|
+
autoload(:Page, 'uzuuzu/controller/page')
|
13
|
+
autoload(:Plugin, 'uzuuzu/controller/plugin')
|
14
|
+
autoload(:User, 'uzuuzu/controller/user')
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
---
|
2
|
+
- :id: 1
|
3
|
+
:name: contents_only
|
4
|
+
:format: erb
|
5
|
+
:body: |-
|
6
|
+
<div id="contents">
|
7
|
+
#{@uzuuzu_contents}
|
8
|
+
</div>
|
9
|
+
- :id: 2
|
10
|
+
:name: noside
|
11
|
+
:format: erb
|
12
|
+
:body: |-
|
13
|
+
<div id="contents">
|
14
|
+
#{@uzuuzu_contents}
|
15
|
+
</div>
|
16
|
+
<div id="header">
|
17
|
+
#{@uzuuzu_header}
|
18
|
+
</div>
|
19
|
+
<div id="footer">
|
20
|
+
#{@uzuuzu_footer}
|
21
|
+
</div>
|
22
|
+
- :id: 3
|
23
|
+
:name: left
|
24
|
+
:format: erb
|
25
|
+
:body: |-
|
26
|
+
<div id="contents">
|
27
|
+
#{@uzuuzu_contents}
|
28
|
+
</div>
|
29
|
+
<div id="left">
|
30
|
+
#{@uzuuzu_left}
|
31
|
+
</div>
|
32
|
+
<div id="header">
|
33
|
+
#{@uzuuzu_header}
|
34
|
+
</div>
|
35
|
+
<div id="footer">
|
36
|
+
#{@uzuuzu_footer}
|
37
|
+
</div>
|
38
|
+
- :id: 4
|
39
|
+
:name: right
|
40
|
+
:format: erb
|
41
|
+
:body: |-
|
42
|
+
<div id="contents">
|
43
|
+
#{@uzuuzu_contents}
|
44
|
+
</div>
|
45
|
+
<div id="right">
|
46
|
+
#{@uzuuzu_right}
|
47
|
+
</div>
|
48
|
+
<div id="header">
|
49
|
+
#{@uzuuzu_header}
|
50
|
+
</div>
|
51
|
+
<div id="footer">
|
52
|
+
#{@uzuuzu_footer}
|
53
|
+
</div>
|
54
|
+
- :id: 5
|
55
|
+
:name: side
|
56
|
+
:format: erb
|
57
|
+
:body: |-
|
58
|
+
<div id="contents">
|
59
|
+
#{@uzuuzu_contents}
|
60
|
+
</div>
|
61
|
+
<div id="left">
|
62
|
+
#{@uzuuzu_left}
|
63
|
+
</div>
|
64
|
+
<div id="right">
|
65
|
+
#{@uzuuzu_right}
|
66
|
+
</div>
|
67
|
+
<div id="header">
|
68
|
+
#{@uzuuzu_header}
|
69
|
+
</div>
|
70
|
+
<div id="footer">
|
71
|
+
#{@uzuuzu_footer}
|
72
|
+
</div>
|
73
|
+
- :id: 6
|
74
|
+
:name: left2
|
75
|
+
:format: erb
|
76
|
+
:body: |-
|
77
|
+
<div id="contents">
|
78
|
+
#{@uzuuzu_contents}
|
79
|
+
</div>
|
80
|
+
<div id="left">
|
81
|
+
#{@uzuuzu_left}
|
82
|
+
</div>
|
83
|
+
<div id="left2">
|
84
|
+
#{@uzuuzu_right}
|
85
|
+
</div>
|
86
|
+
<div id="header">
|
87
|
+
#{@uzuuzu_header}
|
88
|
+
</div>
|
89
|
+
<div id="footer">
|
90
|
+
#{@uzuuzu_footer}
|
91
|
+
</div>
|
92
|
+
- :id: 7
|
93
|
+
:name: right2
|
94
|
+
:format: erb
|
95
|
+
:body: |-
|
96
|
+
<div id="contents">
|
97
|
+
#{@uzuuzu_contents}
|
98
|
+
</div>
|
99
|
+
<div id="right">
|
100
|
+
#{@uzuuzu_left}
|
101
|
+
</div>
|
102
|
+
<div id="right2">
|
103
|
+
#{@uzuuzu_right}
|
104
|
+
</div>
|
105
|
+
<div id="header">
|
106
|
+
#{@uzuuzu_header}
|
107
|
+
</div>
|
108
|
+
<div id="footer">
|
109
|
+
#{@uzuuzu_footer}
|
110
|
+
</div>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
require 'uzuuzu/adapter/datamapper/model/user'
|
3
|
+
require 'uzuuzu/adapter/datamapper/model/blog_category'
|
4
|
+
require 'uzuuzu/adapter/datamapper/model/blog_comment'
|
5
|
+
require 'uzuuzu/adapter/datamapper/model/blog_entry'
|
6
|
+
|
7
|
+
module UzuUzu
|
8
|
+
class User
|
9
|
+
has n, :blogs
|
10
|
+
has n, :blog_comments
|
11
|
+
end
|
12
|
+
|
13
|
+
#
|
14
|
+
#
|
15
|
+
#
|
16
|
+
class Blog
|
17
|
+
include DataMapper::Resource
|
18
|
+
|
19
|
+
property :id, Serial
|
20
|
+
property :title, String,
|
21
|
+
:required => true,
|
22
|
+
:length => 255
|
23
|
+
|
24
|
+
has n, :blog_entries
|
25
|
+
has n, :blog_categories
|
26
|
+
|
27
|
+
belongs_to :user
|
28
|
+
end #Blog
|
29
|
+
|
30
|
+
if auto_upgrade?
|
31
|
+
repository do
|
32
|
+
Blog.auto_upgrade!
|
33
|
+
BlogCategory.auto_upgrade!
|
34
|
+
BlogEntry.auto_upgrade!
|
35
|
+
BlogComment.auto_upgrade!
|
36
|
+
BlogCategoryBlogEntry.auto_upgrade!
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end #UzuUzu
|
40
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module UzuUzu
|
4
|
+
class BlogCategory
|
5
|
+
include DataMapper::Resource
|
6
|
+
|
7
|
+
property :id, Serial
|
8
|
+
property :title, String,
|
9
|
+
:required => true,
|
10
|
+
:length => 255
|
11
|
+
|
12
|
+
belongs_to :blog
|
13
|
+
has n, :blog_entries, :through => Resource
|
14
|
+
end #BlogCategory
|
15
|
+
end #UzuUzu
|