• R/O
  • SSH
  • HTTPS

tenarai: 提交


Commit MetaInfo

修訂52 (tree)
時間2008-02-25 22:18:25
作者junkikuchi

Log Message

updated.

Change Summary

差異

--- trunk/Rakefile (revision 51)
+++ trunk/Rakefile (revision 52)
@@ -285,6 +285,14 @@
285285 },
286286
287287 {
288+ :name => 'session.user.content.view.html.admin.user_list',
289+ :class => 'Widget::User::List',
290+ :row => {},
291+ :relation => {'view' => 'view:resource.admin'},
292+ :preference => {}
293+ },
294+
295+ {
288296 :name => 'session.user.content.view.html.admin.new_user',
289297 :class => 'Widget::User::Form',
290298 :row => {},
--- trunk/webapp/Widget/User.rb (revision 51)
+++ trunk/webapp/Widget/User.rb (revision 52)
@@ -39,6 +39,17 @@
3939 raise Service::Redirect.new(url(resource.content.user.id))
4040 end
4141
42+ def new(row)
43+ u = ::User.new(@service.model['user'])
44+ u.name = row['name']
45+ u.password = row['password']
46+ u.save
47+ end
48+
49+ def each(&block)
50+ @service.model['user'].each(&block)
51+ end
52+
4253 def init(service, id=nil)
4354 super
4455
--- trunk/webapp/Widget/User/List.rb (nonexistent)
+++ trunk/webapp/Widget/User/List.rb (revision 52)
@@ -0,0 +1,25 @@
1+#
2+# Copyright (C) 2008 Jun Kikuchi <kikuchi@bonnou.com>
3+#
4+
5+Tenarai::ClassLoader.load_class('Widget::User')
6+
7+class Widget
8+ class User
9+ class List < ::Widget
10+ extend Tenarai::ClassLoader
11+
12+ preference_css 'box'
13+
14+ def render_html(xml, builder, content=nil)
15+ xml.tag('ul', 'id' => html_id) do |ul|
16+ resource.each do |val|
17+ ul.tag('li') do |li|
18+ li.text(val.name)
19+ end
20+ end
21+ end
22+ end
23+ end
24+ end
25+end
Show on old repository browser