• R/O
  • SSH
  • HTTPS

tenarai: 提交


Commit MetaInfo

修訂73 (tree)
時間2008-04-02 22:17:45
作者junkikuchi

Log Message

updated.

Change Summary

差異

--- trunk/init_model.rb (revision 72)
+++ trunk/init_model.rb (revision 73)
@@ -31,7 +31,7 @@
3131 'title' => 'index',
3232 'body' => '',
3333 },
34- :relation => {'view' => 'view:resource.index'},
34+ :relation => {'view' => 'view:resource.index.view'},
3535 },
3636 ],
3737
@@ -46,6 +46,21 @@
4646 :class => 'View',
4747 :row => {'name' => 'index'},
4848 },
49+ {
50+ :name => 'resource.index.view',
51+ :class => 'View',
52+ :row => {'name' => 'view'},
53+ },
54+ {
55+ :name => 'resource.index.new',
56+ :class => 'View',
57+ :row => {'name' => 'new'},
58+ },
59+ {
60+ :name => 'resource.index.edit',
61+ :class => 'View',
62+ :row => {'name' => 'edit'},
63+ },
4964 ],
5065
5166 'widget' => [
@@ -84,6 +99,13 @@
8499 :preference => {}
85100 },
86101 {
102+ :name => 'session.user.content.view.html.menu',
103+ :class => 'Widget::View::List',
104+ :row => {},
105+ :relation => {'view' => 'view:resource.index'},
106+ :preference => {}
107+ },
108+ {
87109 :name => 'session.user.content.view.html.title',
88110 :class => 'Widget::Content::Header',
89111 :row => {},
@@ -90,5 +112,44 @@
90112 :relation => {'view' => 'view:resource.index'},
91113 :preference => {}
92114 },
115+ {
116+ :name => 'session.user.content.view.html.path',
117+ :class => 'Widget::Content::Path',
118+ :row => {},
119+ :relation => {'view' => 'view:resource.index'},
120+ :preference => {}
121+ },
122+ {
123+ :name => 'session.user.content.view.html.list',
124+ :class => 'Widget::Content::List',
125+ :row => {},
126+ :relation => {'view' => 'view:resource.index'},
127+ :preference => {}
128+ },
129+ {
130+ :name => 'session.user.content.view.html.view',
131+ :class => 'Widget::Content::Wiki',
132+ :row => {},
133+ :relation => {'view' => 'view:resource.index.view'},
134+ :preference => {}
135+ },
136+ {
137+ :name => 'session.user.content.view.html.new',
138+ :class => 'Widget::Content::Form',
139+ :row => {},
140+ :relation => {'view' => 'view:resource.index.new'},
141+ :preference => {
142+ 'form.form.type' => 'new'
143+ }
144+ },
145+ {
146+ :name => 'session.user.content.view.html.edit',
147+ :class => 'Widget::Content::Form',
148+ :row => {},
149+ :relation => {'view' => 'view:resource.index.edit'},
150+ :preference => {
151+ 'form.form.type' => 'edit'
152+ }
153+ },
93154 ],
94155 }
--- trunk/webapp/Widget/Content/Form.rb (revision 72)
+++ trunk/webapp/Widget/Content/Form.rb (revision 73)
@@ -16,7 +16,7 @@
1616 preference_css 'content', 'textarea'
1717 preference_css 'submit', 'input[type="submit"]'
1818
19- preference 'preference' do |pref|
19+ preference 'form' do |pref|
2020 pref.group('form') do |form|
2121 form.edit 'type' do |type|
2222 type.value = 'new'
@@ -25,7 +25,7 @@
2525 end
2626
2727 def form_type
28- if preference.preference.form.type.value == 'edit'
28+ if preference.form.form.type.value == 'edit'
2929 :edit
3030 else
3131 :new
--- trunk/webapp/Widget/Content/Wiki.rb (nonexistent)
+++ trunk/webapp/Widget/Content/Wiki.rb (revision 73)
@@ -0,0 +1,21 @@
1+#
2+# Copyright (C) 2007, 2008 Jun Kikuchi <kikuchi@bonnou.com>
3+#
4+
5+Tenarai::ClassLoader.load_class('Widget::Content')
6+
7+require 'tenarai/wiki'
8+
9+class Widget
10+ class Content
11+ class Wiki < ::Widget
12+ extend Tenarai::ClassLoader
13+
14+ def render_html(xml, builder)
15+ xml.tag('div', 'id' => html_id) do |div|
16+ div << Tenarai::Wiki.new(resource.content.body)
17+ end
18+ end
19+ end
20+ end
21+end
--- trunk/webapp/Widget/View.rb (revision 72)
+++ trunk/webapp/Widget/View.rb (revision 73)
@@ -13,9 +13,17 @@
1313 def init(id=nil)
1414 super
1515
16- unless resource.content.view.include?(@content)
17- @content = resource.content.view
18- end unless resource.content.nil?
16+ if @content.nil?
17+ @content = resource.content.view
18+ else
19+ unless resource.content.view.parent.include?(@content)
20+ raise Service::Redirect.new(uri(resource.content.view.id))
21+ else
22+ if resource.content.view.parent.eql?(@content)
23+ raise Service::Redirect.new(uri(resource.content.view.id))
24+ end
25+ end
26+ end
1927
2028 @content.widget.load(@service)
2129 end
--- trunk/webapp/Widget/Content.rb (revision 72)
+++ trunk/webapp/Widget/Content.rb (revision 73)
@@ -12,9 +12,14 @@
1212
1313 def init(id=nil)
1414 super
15- unless resource.content.content.include?(@content)
15+
16+ if @content.nil?
1617 @content = resource.content.content
17- end unless resource.content.nil?
18+ else
19+ unless resource.content.content.include?(@content)
20+ raise Service::Redirect.new(uri(resource.content.content.id))
21+ end
22+ end
1823 end
1924
2025 def new(row)
--- trunk/webapp/TrackLog.rb (revision 72)
+++ trunk/webapp/TrackLog.rb (revision 73)
@@ -11,7 +11,7 @@
1111 end
1212 end
1313
14- column Tenarai::DB::Date.new('log_date')
14+ column Tenarai::DB::Date.new('date')
1515 column Tenarai::DB::Float.new('lat', :precision => 10, :scale => 6)
1616 column Tenarai::DB::Float.new('lng', :precision => 10, :scale => 6)
1717 column Tenarai::DB::Reference.new('content')
Show on old repository browser