• R/O
  • SSH
  • HTTPS

tenarai: 提交


Commit MetaInfo

修訂96 (tree)
時間2008-05-31 13:09:10
作者junkikuchi

Log Message

updated.

Change Summary

差異

--- trunk/init_model.rb (revision 95)
+++ trunk/init_model.rb (revision 96)
@@ -200,12 +200,12 @@
200200 :row => {},
201201 :relation => {'view' => 'view:resource'},
202202 :preference => {
203- 'body.text.text_align' => 'left',
203+ 'body.text.text_align' => 'left',
204204 'a.text.text_decoration' => 'none',
205- 'a_link.text.color' => '#0000cc',
206- 'a_visited.text.color' => '#0000cc',
207- 'a_hover.text.color' => '#0000cc',
208- 'a_active.text.color' => '#0000cc',
205+ 'a_link.text.color' => '#0000cc',
206+ 'a_visited.text.color' => '#0000cc',
207+ 'a_hover.text.color' => '#0000cc',
208+ 'a_active.text.color' => '#0000cc',
209209 }
210210 },
211211 =begin
@@ -243,12 +243,10 @@
243243 {
244244 :name => 'session.user.content.view.html.admin.content',
245245 :class => 'Widget::Content',
246- #:class => 'Widget',
247246 :row => {},
248247 :relation => {'view' => 'view:resource.admin.content'},
249248 :preference => {}
250249 },
251-=begin
252250 {
253251 :name => 'session.user.content.view.html.admin.content.menu',
254252 :class => 'Widget::View::List',
@@ -256,7 +254,6 @@
256254 :relation => {'view' => 'view:resource.admin.content'},
257255 :preference => {}
258256 },
259-=end
260257 {
261258 :name => 'session.user.content.view.html.admin.content.tree',
262259 :class => 'Widget::Content::Tree',
@@ -293,12 +290,10 @@
293290 {
294291 :name => 'session.user.content.view.html.admin.view',
295292 :class => 'Widget::View',
296- #:class => 'Widget',
297293 :row => {},
298294 :relation => {'view' => 'view:resource.admin.view'},
299295 :preference => {}
300296 },
301-=begin
302297 {
303298 :name => 'session.user.content.view.html.admin.view.menu',
304299 :class => 'Widget::View::List',
@@ -306,7 +301,6 @@
306301 :relation => {'view' => 'view:resource.admin.view'},
307302 :preference => {}
308303 },
309-=end
310304 {
311305 :name => 'session.user.content.view.html.admin.view.tree',
312306 :class => 'Widget::View::Tree',
--- trunk/webapp/Widget/View/List.rb (revision 95)
+++ trunk/webapp/Widget/View/List.rb (revision 96)
@@ -12,10 +12,26 @@
1212 preference_css 'box'
1313 preference_list
1414
15- #def uri(*param, &block)
16- # build_uri(*param, &block)
17- #end
15+ def build_uri(param, query)
16+ service.build_uri(
17+ path.inject([]) do |ret, val|
18+ if val.equal?(resource)
19+ val.widget_uri(ret, query, param)
20+ else
21+ val.widget_uri(ret, query)
22+ end
23+ ret
24+ end,
25+ query
26+ )
27+ end
1828
29+ def uri(*param, &block)
30+ query = Tenarai::CGI::Query.new
31+ block.call(query) if block_given?
32+ build_uri(param, query)
33+ end
34+
1935 def render_html(xml, builder, content=nil)
2036 content = resource.content.parent if content.nil?
2137
--- trunk/webapp/Widget/View.rb (revision 95)
+++ trunk/webapp/Widget/View.rb (revision 96)
@@ -30,12 +30,12 @@
3030
3131 def build(query)
3232 ws, rs = {}, {}
33- ws.default = Tenarai::CGI::Query.new
3433
3534 query.each do |key, val|
3635 case key
3736 when /id(\d+):(.+)/
3837 if w = service.model['widget'].fetch($1)
38+ ws[w] ||= Tenarai::CGI::Query.new
3939 ws[w][$2] = val
4040 end
4141 when /id(\d+)/
@@ -49,11 +49,9 @@
4949 val.init(service, *rs[val]) if val.view.path.size != 1
5050 end
5151
52- ws.each do |wid, q|
53- if w = service.model['widget'].fetch(wid)
54- w.init(service)
55- w.__send__(method, self, q)
56- end
52+ ws.each do |w, q|
53+ w.init(service)
54+ w.__send__(service.request.method, self, q)
5755 end
5856 end
5957 end
--- trunk/webapp/Widget.rb (revision 95)
+++ trunk/webapp/Widget.rb (revision 96)
@@ -164,9 +164,7 @@
164164 def widget_uri(path, query, param=[])
165165 end
166166
167- def build_uri(param=[], &block)
168- query = Tenarai::CGI::Query.new
169- block.call(query) if block_given?
167+ def build_uri(param, query)
170168 service.build_uri(
171169 path.inject([]) do |ret, val|
172170 if val.equal?(self)
--- trunk/webapp/Resource.rb (revision 95)
+++ trunk/webapp/Resource.rb (revision 96)
@@ -26,6 +26,8 @@
2626 end
2727
2828 def uri(*param, &block)
29- build_uri(param, &block)
29+ query = Tenarai::CGI::Query.new
30+ block.call(query) if block_given?
31+ build_uri(param, query)
3032 end
3133 end
Show on old repository browser