• R/O
  • SSH
  • HTTPS

tenarai: 提交


Commit MetaInfo

修訂58 (tree)
時間2008-03-11 20:00:17
作者junkikuchi

Log Message

updated.

Change Summary

差異

--- trunk/Rakefile (revision 57)
+++ trunk/Rakefile (revision 58)
@@ -302,7 +302,7 @@
302302 :relation => {'view' => 'view:resource.admin.user'},
303303 },
304304 {
305- :name => 'session.user.content.view.html.admin.bd.list',
305+ :name => 'session.user.content.view.html.admin.bd.user.list',
306306 :class => 'Widget::User::List',
307307 :row => {},
308308 :relation => {'view' => 'view:resource.admin.user'},
--- trunk/webapp/User.rb (revision 57)
+++ trunk/webapp/User.rb (revision 58)
@@ -31,7 +31,6 @@
3131 end
3232
3333 def auth(password)
34- p [name, self.active]
3534 active && self._password == self.class.digest(password)
3635 end
3736 end
--- trunk/webapp/Service.rb (revision 57)
+++ trunk/webapp/Service.rb (revision 58)
@@ -73,17 +73,17 @@
7373 end
7474 end
7575
76- widget.view.widget.load
76+ widget.view.widget.load(self)
7777
7878 widget.path.each do |r|
7979 if param.empty?
8080 if rs.key?(r.id)
81- r.init(self, *rs.delete(r.id).split(','))
81+ r.init(*rs.delete(r.id).split(','))
8282 else
83- r.init(self)
83+ r.init
8484 end
8585 else
86- r.init(self, *(param.shift || '').split(','))
86+ r.init(*(param.shift || '').split(','))
8787 end
8888 end
8989
@@ -97,7 +97,7 @@
9797 query = val.split(',').map do |v|
9898 Tenarai::CGI.decode(v)
9999 end
100- w.init(self, *query)
100+ w.init(*query)
101101 end
102102
103103 ws.each do |wid, query|
--- trunk/webapp/Widget/User.rb (revision 57)
+++ trunk/webapp/Widget/User.rb (revision 58)
@@ -50,7 +50,7 @@
5050 @service.model['user'].each(&block)
5151 end
5252
53- def init(service, id=nil)
53+ def init(id=nil)
5454 super
5555
5656 resource.content.user = default_user if resource.content.user.nil?
--- trunk/webapp/Widget/Session.rb (revision 57)
+++ trunk/webapp/Widget/Session.rb (revision 58)
@@ -19,7 +19,7 @@
1919 end
2020 end
2121
22- def init(service, *param)
22+ def init(*param)
2323 super
2424
2525 session_name = preference.preference.session.session_id.value
--- trunk/webapp/Widget/Widget.rb (revision 57)
+++ trunk/webapp/Widget/Widget.rb (revision 58)
@@ -11,7 +11,7 @@
1111
1212 resource 'Widget::View'
1313
14- def init(service, id=nil)
14+ def init(id=nil)
1515 super
1616
1717 @content = resource.content.widget.root if @content.nil?
@@ -18,7 +18,6 @@
1818
1919 unless resource.content.include?(@content.view)
2020 @content = resource.content.widget.root
21- #raise Service::Redirect.new(url(resource.content.view.id))
2221 end unless resource.content.nil?
2322 end
2423
--- trunk/webapp/Widget/HTML.rb (revision 57)
+++ trunk/webapp/Widget/HTML.rb (revision 58)
@@ -9,9 +9,10 @@
99 extend Tenarai::ClassLoader
1010
1111 resource 'Widget::View'
12+
1213 preference_css 'box'
1314
14- def init(service, markup='html')
15+ def init(markup='html')
1516 case markup
1617 when 'html'
1718 @markup = markup
--- trunk/webapp/Widget/Content.rb (revision 57)
+++ trunk/webapp/Widget/Content.rb (revision 58)
@@ -10,7 +10,7 @@
1010
1111 resource 'Widget::User'
1212
13- def init(service, id=nil)
13+ def init(id=nil)
1414 super
1515 unless resource.content.content.include?(@content)
1616 @content = resource.content.content
--- trunk/webapp/Widget/View.rb (revision 57)
+++ trunk/webapp/Widget/View.rb (revision 58)
@@ -10,11 +10,12 @@
1010
1111 resource 'Widget::Content'
1212
13- def init(service, id=nil)
13+ def init(id=nil)
1414 super
15+
1516 unless resource.content.view.include?(@content)
1617 @content = resource.content.view
17- #raise Service::Redirect.new(url(resource.content.view.id))
18+ @content.widget.load(@service)
1819 end unless resource.content.nil?
1920 end
2021 end
--- trunk/webapp/Widget/User/List.rb (revision 57)
+++ trunk/webapp/Widget/User/List.rb (revision 58)
@@ -15,7 +15,7 @@
1515 xml.tag('ul', 'id' => html_id) do |ul|
1616 resource.each do |val|
1717 ul.tag('li') do |li|
18- li.text(val.name)
18+ li.tag('a', 'href' => url(val.id)).text(val.name)
1919 end
2020 end
2121 end
--- trunk/webapp/Widget.rb (revision 57)
+++ trunk/webapp/Widget.rb (revision 58)
@@ -132,6 +132,8 @@
132132 end
133133 end
134134
135+ attr_accessor :service
136+
135137 column Tenarai::DB::Reference.new('view')
136138 column Tenarai::DB::Preference.new('preference')
137139
@@ -143,8 +145,7 @@
143145 resource.url(*param, &block)
144146 end
145147
146- def init(service, *param)
147- @service = service
148+ def init(*param)
148149 end
149150
150151 def get(service, query={})
--- trunk/webapp/Resource.rb (revision 57)
+++ trunk/webapp/Resource.rb (revision 58)
@@ -9,8 +9,7 @@
99
1010 attr_reader :content
1111
12- def init(service, id=nil)
13- @service = service
12+ def init(id=nil)
1413 @content = service.model[self.class.name.split('::').pop.downcase].fetch(id)
1514 end
1615
@@ -31,7 +30,6 @@
3130
3231 if view.path.size == 1
3332 _resource.unshift(_param)
34- #_query[html_id] = _param
3533 else
3634 _query[html_id] = _param
3735 end
--- trunk/webapp/View.rb (revision 57)
+++ trunk/webapp/View.rb (revision 58)
@@ -31,18 +31,15 @@
3131 (['?'] * vars.size).join(', ')
3232 ]
3333
34- if block_given?
35- @link.dst_table.each(cond, *vars) do |widget|
36- block.call(widget)
37- end
38- else
39- @link.dst_table.each(cond, *vars) do |widget|
40- end
41- end
34+ @link.dst_table.each(cond, *vars) do |widget|
35+ block.call(widget)
36+ end if block_given?
4237 end
4338
44- def load
45- each
39+ def load(service)
40+ each do |val|
41+ val.service = service
42+ end
4643 end
4744 end
4845
Show on old repository browser