uzuuzu-core 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -2
- data/Gemfile.lock +2 -4
- data/VERSION +1 -1
- data/lib/uzuuzu/helper/fixture.rb +1 -0
- data/lib/uzuuzu/helper/form.rb +9 -0
- data/lib/uzuuzu/{controller/view/admin/index.xhtml → helper/jquery.rb} +0 -0
- data/lib/uzuuzu/helper/localize.rb +1 -1
- data/lib/uzuuzu/helper/renderer.rb +39 -37
- data/lib/uzuuzu/helper/route.rb +19 -36
- data/lib/uzuuzu/uzuuzu-core.rb +1 -0
- data/lib/uzuuzu/wrapper/application.rb +79 -56
- data/lib/uzuuzu/wrapper/controller.rb +0 -14
- data/lib/uzuuzu/wrapper/environments.rb +19 -9
- data/lib/uzuuzu/wrapper/helper.rb +2 -1
- data/lib/uzuuzu/wrapper/lang/en.yaml +4 -0
- data/lib/uzuuzu/wrapper/lang/ja.yaml +5 -0
- data/lib/uzuuzu/wrapper/logger.rb +14 -11
- data/lib/uzuuzu/wrapper/request.rb +18 -10
- data/lib/uzuuzu/wrapper/tilt.rb +31 -0
- data/lib/uzuuzu/wrapper/uzuuzu.rb +22 -0
- data/uzuuzu-core.gemspec +8 -40
- metadata +13 -53
- data/.redcar/tags +0 -145
- data/lib/uzuuzu/.DS_Store +0 -0
- data/lib/uzuuzu/controller/admin.rb +0 -11
- data/lib/uzuuzu/controller/contents.rb +0 -11
- data/lib/uzuuzu/controller/crud.rb +0 -235
- data/lib/uzuuzu/controller/css.rb +0 -11
- data/lib/uzuuzu/controller/error.rb +0 -11
- data/lib/uzuuzu/controller/index.rb +0 -25
- data/lib/uzuuzu/controller/initialize.rb +0 -52
- data/lib/uzuuzu/controller/javascript.rb +0 -11
- data/lib/uzuuzu/controller/oauth.rb +0 -10
- data/lib/uzuuzu/controller/openid.rb +0 -40
- data/lib/uzuuzu/controller/page.rb +0 -14
- data/lib/uzuuzu/controller/plugin.rb +0 -11
- data/lib/uzuuzu/controller/user.rb +0 -22
- data/lib/uzuuzu/controller/view/crud/destroy.rhtml +0 -28
- data/lib/uzuuzu/controller/view/crud/edit.rhtml +0 -52
- data/lib/uzuuzu/controller/view/crud/index.rhtml +0 -45
- data/lib/uzuuzu/controller/view/crud/new.rhtml +0 -48
- data/lib/uzuuzu/controller/view/crud/show.rhtml +0 -47
- data/lib/uzuuzu/controller/view/error/404.tenjin +0 -0
- data/lib/uzuuzu/controller/view/initialize/step1.xhtml +0 -30
- data/lib/uzuuzu/controller/view/initialize/step2.xhtml +0 -1
- data/lib/uzuuzu/controller/view/initialize/step3.xhtml +0 -0
- data/lib/uzuuzu/controller/view/openid/index.xhtml +0 -14
- data/lib/uzuuzu/controller/view/page.xhtml +0 -17
- data/lib/uzuuzu/controller/view/user/entry.xhtml +0 -13
- data/lib/uzuuzu/fixture/layout.yaml +0 -110
- data/lib/uzuuzu/helper/uzuuzu_page.rb +0 -61
- data/lib/uzuuzu/model/.DS_Store +0 -0
- data/lib/uzuuzu/model/remote_user.rb +0 -70
@@ -1,52 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
module UzuUzu
|
4
|
-
module Controller
|
5
|
-
class Initialize
|
6
|
-
def index
|
7
|
-
UzuUzu.repository do
|
8
|
-
@info = Info.uniq
|
9
|
-
if @info.nil?
|
10
|
-
@info = Info.new
|
11
|
-
@info.step = 1
|
12
|
-
@info.save!
|
13
|
-
end
|
14
|
-
end
|
15
|
-
if request.post? and @info.step < 4
|
16
|
-
self.send("step#{@info.step}", [])
|
17
|
-
end
|
18
|
-
case(@info.step)
|
19
|
-
when 1
|
20
|
-
respond(render_file(__DIR__('view/initialize/step1.xhtml')))
|
21
|
-
when 2
|
22
|
-
respond(render_file(__DIR__('view/initialize/step2.xhtml')))
|
23
|
-
when 3
|
24
|
-
respond(render_file(__DIR__('view/initialize/step3.xhtml')))
|
25
|
-
when 4
|
26
|
-
redirect UzuUzu::IndexController.r
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
private
|
31
|
-
|
32
|
-
def setp1
|
33
|
-
unless session[:openid_identity].nil?
|
34
|
-
UzuUzu.repository do
|
35
|
-
@user = UzuUzu::User.new
|
36
|
-
@user.user_id = session[:openid_identity]
|
37
|
-
@info.step = 2
|
38
|
-
@info.admin = @user
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def step2
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
def step3
|
48
|
-
|
49
|
-
end
|
50
|
-
end # Initialize
|
51
|
-
end # Controller
|
52
|
-
end # UzuUzu
|
@@ -1,40 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
require 'openid/store/memcache'
|
3
|
-
|
4
|
-
module UzuUzu
|
5
|
-
module Controller
|
6
|
-
class Openid
|
7
|
-
def index
|
8
|
-
if session[:openid_identity]
|
9
|
-
referer = session[:referer]
|
10
|
-
session.delete(:referer)
|
11
|
-
login_remote_user
|
12
|
-
redirect referer || IndexController.r
|
13
|
-
end
|
14
|
-
session[:referer] = request.referrer
|
15
|
-
respond(render_file __DIR__('view/openid/index.xhtml'))
|
16
|
-
end
|
17
|
-
|
18
|
-
def logout
|
19
|
-
session.delete(:openid_identity)
|
20
|
-
end
|
21
|
-
|
22
|
-
private
|
23
|
-
|
24
|
-
#logined
|
25
|
-
def login_remote_user
|
26
|
-
remote_user = User.first(:user_id => session[:openid_identity])
|
27
|
-
if remote_user.nil?
|
28
|
-
#remote_user = User.new(:user_id => session[:openid_identity])
|
29
|
-
#remote_user.save!
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
# use memcache
|
34
|
-
def openid_consumer
|
35
|
-
memcache = OpenID::Store::Memcache.new(UzuUzu.memcache)
|
36
|
-
OpenID::Consumer.new(session, memcache)
|
37
|
-
end
|
38
|
-
end # Openid
|
39
|
-
end # Controller
|
40
|
-
end # UzuUzu
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
module UzuUzu
|
4
|
-
module Controller
|
5
|
-
class User
|
6
|
-
def entry(id)
|
7
|
-
saved = false
|
8
|
-
UzuUzu.transaction do |tr|
|
9
|
-
@user = User.first(:id => id)
|
10
|
-
if request.post?
|
11
|
-
@user.name = request.params['username']
|
12
|
-
tr.commit do
|
13
|
-
saved = @user.save
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
view_value = render_file(__DIR__("view/user/entry.xhtml"))
|
18
|
-
respond(view_value)
|
19
|
-
end
|
20
|
-
end # User
|
21
|
-
end # Controller
|
22
|
-
end # UzuUzu
|
@@ -1,28 +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
|
-
<%= 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>
|
@@ -1,52 +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
|
-
<%= 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
|
-
<%= property.name %>
|
30
|
-
</label>
|
31
|
-
<% if property.kind_of?(DataMapper::Property::Text) %>
|
32
|
-
<textarea name="<%= property.name}" id="<%= property.name %>"><%= h @resource[property.name] %></textarea>
|
33
|
-
<% else %>
|
34
|
-
<input type="text" name="<%= property.name %>"
|
35
|
-
id="<%= property.name}" value="<%= h @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>
|
@@ -1,45 +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
|
-
<%= 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>
|
@@ -1,48 +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
|
-
<%= 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
|
-
<%= property.name %>
|
29
|
-
</label>
|
30
|
-
<% if property.kind_of?(DataMapper::Property::Text) %>
|
31
|
-
<textarea name="<%= property.name %>" id="<%= property.name %>"><%= h @resource[property.name] %></textarea>
|
32
|
-
<% else %>
|
33
|
-
<input type="text" name="<%= property.name %>"
|
34
|
-
id="<%= property.name %>" value="<%= h @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>
|
@@ -1,47 +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="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
|
-
<%= property.name %>
|
29
|
-
</label>
|
30
|
-
<% if property.kind_of?(DataMapper::Property::Text) %>
|
31
|
-
<textarea name="<%= property.name %>" id="<%= property.name %>" disabled="true"><%= h @resource[property.name] %></textarea>
|
32
|
-
<% else %>
|
33
|
-
<input type="text" name="<%= property.name %>"
|
34
|
-
id="<%= property.name %>" value="<%= h @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>
|
File without changes
|
@@ -1,30 +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="expires" content="-1" />
|
9
|
-
<title>初期設定 - UzuUzu</title>
|
10
|
-
#{css_for 'jquery-ui'}
|
11
|
-
#{js_for 'jquery', 'jquery-ui'}
|
12
|
-
</head>
|
13
|
-
<body>
|
14
|
-
<div id="openid_index">
|
15
|
-
<p>
|
16
|
-
#{uzuuzu_string(:openid_message)}
|
17
|
-
</p>
|
18
|
-
<form method="post" action="#{UzuUzu::OpenidController.r(:openid_begin)}">
|
19
|
-
<p>
|
20
|
-
#{uzuuzu_string(:openid_url)}:
|
21
|
-
<input type="text" name="url" />
|
22
|
-
</p>
|
23
|
-
<p>
|
24
|
-
<input type="submit" value="#{uzuuzu_string(:login)}"/>
|
25
|
-
</p>
|
26
|
-
</form>
|
27
|
-
</div>
|
28
|
-
</body>
|
29
|
-
</html>
|
30
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
|
File without changes
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<div id="openid_index">
|
2
|
-
<p>
|
3
|
-
#{uzuuzu_string(:openid_message)}
|
4
|
-
</p>
|
5
|
-
<form method="post" action="#{rs(:openid_begin)}">
|
6
|
-
<p>
|
7
|
-
#{uzuuzu_string(:openid_url)}:
|
8
|
-
<input type="text" name="url" />
|
9
|
-
</p>
|
10
|
-
<p>
|
11
|
-
<input type="submit" value="#{uzuuzu_string(:login)}"/>
|
12
|
-
</p>
|
13
|
-
</form>
|
14
|
-
</div>
|