wontomedia 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/Rakefile +9 -5
  2. data/VERSION.yml +2 -2
  3. data/app/controllers/admin_controller.rb +34 -11
  4. data/app/controllers/connections_controller.rb +8 -2
  5. data/app/controllers/items_controller.rb +213 -68
  6. data/app/helpers/format_helper.rb +22 -1
  7. data/app/helpers/items_helper.rb +43 -0
  8. data/app/models/connection.rb +128 -100
  9. data/app/models/item.rb +96 -0
  10. data/app/views/connections/_spo_select_controls.html.erb +65 -31
  11. data/app/views/connections/edit.html.erb +7 -2
  12. data/app/views/connections/index.html.erb +11 -4
  13. data/app/views/connections/show.html.erb +13 -5
  14. data/app/views/items/_class_select.html.erb +41 -0
  15. data/app/views/items/_content_examples.html.erb +21 -18
  16. data/app/views/items/_core_tasks.html.erb +40 -5
  17. data/app/views/items/_form_fields.html.erb +4 -4
  18. data/app/views/items/_inline_item_add_form.html.erb +48 -0
  19. data/app/views/items/_inline_scalar_add_form.html.erb +36 -0
  20. data/app/views/items/_most_populous_classes.html.erb +42 -0
  21. data/app/views/items/_type_select.html.erb +28 -26
  22. data/app/views/items/edit.html.erb +8 -2
  23. data/app/views/items/index.html.erb +5 -1
  24. data/app/views/items/new.html.erb +69 -54
  25. data/app/views/items/newpop.html.erb +18 -3
  26. data/app/views/items/show.html.erb +110 -7
  27. data/app/views/layouts/application.html.erb +2 -2
  28. data/app/views/layouts/base.html.erb +4 -2
  29. data/app/views/layouts/home.html.erb +2 -2
  30. data/assets/wontomedia-sample.rb +2 -0
  31. data/config/asset_packages.yml +1 -0
  32. data/config/cucumber.yml +11 -13
  33. data/db/fixtures/connections.yml +85 -4
  34. data/db/fixtures/items.yml +140 -8
  35. data/db/migrate/20100315135952_provide_scalar_objects.rb +32 -0
  36. data/db/migrate/20100321042343_add_timestamp_columns.rb +33 -0
  37. data/db/schema.rb +17 -11
  38. data/default-custom/app/views/items/home.html.erb +1 -1
  39. data/default-custom/public/stylesheets/wm.css +21 -4
  40. data/lib/helpers/connection_helper.rb +84 -1
  41. data/lib/helpers/item_helper.rb +16 -3
  42. data/lib/tasks/cucumber.rake +0 -2
  43. data/public/images/transparent_ltblue_background.png +0 -0
  44. data/public/images/{alert_background.png → transparent_white_background.png} +0 -0
  45. data/public/javascripts/forConnectionsForms.js +182 -41
  46. data/public/javascripts/forItemsForms.js +40 -5
  47. data/public/javascripts/forItemsShow.js +27 -0
  48. data/public/javascripts/itemCreatePopup.js +10 -3
  49. metadata +13 -5
@@ -0,0 +1,42 @@
1
+ <%
2
+ # WontoMedia - a wontology web application
3
+ # Copyright (C) 2010 - Glen E. Ivey
4
+ # www.wontology.com
5
+ #
6
+ # This program is free software: you can redistribute it and/or modify
7
+ # it under the terms of the GNU Affero General Public License version
8
+ # 3 as published by the Free Software Foundation.
9
+ #
10
+ # This program is distributed in the hope that it will be useful, but
11
+ # WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ # Affero General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU Affero General Public License
16
+ # along with this program in the file COPYING and/or LICENSE. If not,
17
+ # see "http://www.gnu.org/licenses/".
18
+ %>
19
+
20
+ <style>
21
+ #class-item-list {
22
+ padding-left: 1.3em;
23
+ font-size: 110%;
24
+ }
25
+ #class-item-list li {
26
+ color: yellow;
27
+ margin-bottom: 0.8ex;
28
+ }
29
+ #class-item-list li span {
30
+ color: black;
31
+ }
32
+ </style>
33
+
34
+ <h2 class="subheading">Most Used</h2>
35
+ <ul id="class-item-list"><%
36
+ @class_list.each do |item| %>
37
+ <li><span>
38
+ <%= link_to "#{h filter_parenthetical item.title}",
39
+ item_by_name_path(item.name) %>
40
+ </span></li><%
41
+ end %>
42
+ </ul>
@@ -18,30 +18,32 @@
18
18
  %>
19
19
 
20
20
 
21
- <p class="inputpara">
22
- <%= f.label :sti_type, "Type" %>
23
- <%= popup_help_icon "Help for type", "Help:Popup/ItemType" %>
24
- <%= if @type == "verb"
25
- selections = [ [ "Property", "PropertyItem" ] ]
26
- @item.sti_type = "PropertyItem"
27
- else
28
- selections = [
29
- [ "- type of item -", "" ],
30
- [ "Category", "CategoryItem" ],
31
- [ "Individual", "IndividualItem" ],
32
- [ "Property", "PropertyItem" ] ]
33
- end
21
+ <% if @item.sti_type.nil? %>
22
+ <p class="inputpara">
23
+ <%= f.label :sti_type, "Type" %>
24
+ <%= popup_help_icon "Help for type", "Help:Popup/ItemType" %>
25
+ <%= if @popup_type == "verb"
26
+ selections = [ [ "Property", "PropertyItem" ] ]
27
+ @item.sti_type = "PropertyItem"
28
+ else
29
+ selections = [
30
+ [ "- type of item -", "" ],
31
+ [ "Category", "CategoryItem" ],
32
+ [ "Individual", "IndividualItem" ],
33
+ [ "Property", "PropertyItem" ] ]
34
+ end
34
35
 
35
- select_tag "item[sti_type]",
36
- options_for_select( selections,
37
- @item.sti_type.nil? ? "" : @item.sti_type ),
38
- :tabindex => "1"
39
- %>
40
- <%= image_tag "blank_error_icon.png", :id=>"sti_type_error_icon",
41
- :alt=>"", :size=>"16x16" %>
42
- </p><p class="directions">
43
- <span id="sti_type_required">Selection of a type is required.</span>
44
- </p>
45
- <script type="text/javascript">
46
- $('item_sti_type').focus();
47
- </script>
36
+ select_tag "item[sti_type]",
37
+ options_for_select( selections,
38
+ @item.sti_type.nil? ? "" : @item.sti_type ),
39
+ :tabindex => "110"
40
+ %>
41
+ <%= image_tag "blank_error_icon.png", :id=>"sti_type_error_icon",
42
+ :alt=>"", :size=>"16x16" %>
43
+ </p><p class="directions">
44
+ <span id="sti_type_required">Selection of a type is required.</span>
45
+ </p>
46
+ <% else %>
47
+ <%= hidden_field_tag 'item_sti_type', @item.sti_type,
48
+ :name => 'item[sti_type]' %>
49
+ <% end %>
@@ -24,6 +24,7 @@
24
24
  <% end
25
25
 
26
26
  @title_text = filter_parenthetical h @item.title
27
+ @window_title_addendum = " (Edit)"
27
28
 
28
29
  # initialize array to define "Glossary Help" box of links:
29
30
  @glossary_help_entries = [
@@ -38,8 +39,10 @@
38
39
 
39
40
  <% form_for(@item, :url => item_path(@item)) do |f| %>
40
41
  <%= f.error_messages %>
41
- <%= render :partial => "form_fields", :locals => { :f => f } %>
42
- <p><%= f.submit "Update", :tabindex => "10" %></p>
42
+ <%= render :partial => "class_select",
43
+ :locals => { :f => f, :show_class_control => true } %>
44
+ <%= render :partial => "form_fields", :locals => { :f => f } %>
45
+ <p><%= f.submit "Update", :tabindex => "150" %></p>
43
46
  <% end %>
44
47
 
45
48
  <div class="horizontal-link-list"><ul>
@@ -49,6 +52,9 @@
49
52
  :rel => 'nofollow' -%></li>
50
53
  </ul></div>
51
54
 
55
+
56
+ <%= ruby_hash_to_javascript 'class_to_type', @class_to_item_map %>
57
+
52
58
  <% content_for :first_bottom_page_js do %>
53
59
  <script type="text/javascript">
54
60
  inAnItemsForm = true;
@@ -62,7 +62,11 @@
62
62
  <tr>
63
63
  <td colspan="3" class="secondrow" style="padding-left: 2.2em;">
64
64
  <span style="font-size: 70%">
65
- <%=h ItemHelper::ITEM_SUBTYPES_TO_HUMAN[item.sti_type] %>:</span>
65
+ <%= ItemHelper::ITEM_SUBTYPES_TO_HUMAN[item.sti_type] %>:
66
+ <% if item.class_item %>
67
+ <%=h item.class_item.name %>:
68
+ <% end %>
69
+ </span>
66
70
  <%=h item.description %></td>
67
71
  </tr>
68
72
  <% end %>
@@ -25,7 +25,12 @@
25
25
 
26
26
  <%
27
27
  require Rails.root.join( 'lib', 'helpers', 'item_helper')
28
- @title_text = 'Make a new item'
28
+ show_class_control = @item.class_item_id.nil?
29
+ if show_class_control
30
+ @title_text = 'Make a new item'
31
+ else
32
+ @title_text = 'Enter a new ' + @item.class_item.name
33
+ end
29
34
 
30
35
  # initialize array to define "Glossary Help" box of links:
31
36
  @glossary_help_entries = [
@@ -41,15 +46,22 @@
41
46
  form_for(@item, options) do |f|
42
47
  %>
43
48
  <%= f.error_messages %>
44
- <div style="width: 36%; float: left;">
49
+ <% if @item.sti_type.nil? %><div style="width: 36%; float: left;"><% end %>
50
+ <%= render :partial => "class_select",
51
+ :locals => { :f => f, :show_class_control => show_class_control } %>
45
52
  <%= render :partial => "type_select", :locals => { :f => f } %>
46
53
  <%= render :partial => "form_fields", :locals => { :f => f } %>
47
54
  <script type="text/javascript">
55
+ <% if @item.sti_type.nil? %>
56
+ $('item_sti_type').focus();
57
+ <% else %>
58
+ $('item_title').focus();
59
+ <% end %>
48
60
  genNameFromTitleOk = true;
49
61
  </script>
50
62
 
51
63
  <p id="create_button_container" style="text-align: center">
52
- <%= f.submit "Create", :tabindex => "10" %>
64
+ <%= f.submit "Create", :tabindex => "150" %>
53
65
  </p>
54
66
 
55
67
  <div class="horizontal-link-list"><ul>
@@ -58,58 +70,61 @@
58
70
  <li><%= link_to 'Cancel,&nbsp;show&nbsp;connection&nbsp;list',
59
71
  connections_path, :rel => 'nofollow' -%></li>
60
72
  </ul></div>
61
- </div>
62
-
63
- <div class="noncontent" style="width: 60%; float: right; margin-left: 0;">
64
- <dl><dt id="category_title">Category</dt><dd id="category_desc">
65
-
66
- "Category" is for groups of things, for concepts, and for the
67
- upper levels of <%=
68
- popup_help_icon 'Definition of hierarchies in a wontology',
69
- 'Help:GlossaryAtoO#anchor_Hierarchy', 'hierarchies' -%>.
70
- (Though a hierarchy made up entirely of concepts could be all
71
- Categories.) Categories can "contain" other categories and/or
72
- individuals.
73
-
74
- </dd><dt id="individual_title">Individual</dt><dd id="individual_desc">
75
-
76
- "Individual" is for specific, concrete things. Individuals can
77
- "contain" other individuals, but cannot contain categories.
78
- ("Ford Model-T" might be an individual, but could still contain
79
- parts that are also individuals, like "Windshield" and "Tire".)
80
-
81
- </dd><dt id="property_title">Property</dt><dd id="property_desc">
82
-
83
- "Property" is used to define <%=
84
- popup_help_icon 'Definition of relationships in a wontology',
85
- 'Help:GlossaryPtoZ#anchor_Relationship', 'relationships' -%>
86
- between other items. Once you create a new Property <%=
87
- popup_help_icon 'Definition of Item',
88
- 'Help:GlossaryAtoO#anchor_Item', 'item' -%>,
89
- you should create one or more <%=
90
- popup_help_icon 'Definition of Connection',
91
- 'Help:GlossaryAtoO#anchor_Connection', 'connections' -%>
92
- that relate that property to other existing properties. In
93
- general, you will use the "sub_property_of" property in order to
94
- create these connections. For example, if you were creating a
95
- description of famillial relations between people, you might
96
- create a new property named "spouseOf". To define what the
97
- creation of connections using this new property <em>means</em>, you
98
- can create the connection "<code>spouseOf sub_property_of
99
- symmetric_relationship</code>". This example will cause
100
- "spouseOf" to be treated as a "peer" <%=
101
- popup_help_icon 'Peer relationships in a wontology',
102
- 'Help:GlossaryPtoZ#anchor_Peer', 'relationship' -%>
103
- (rather than a hierarchical one), and as a symmetric <%=
104
- popup_help_icon 'Symmetric relationships in a wontology',
105
- 'Help:GlossaryPtoZ#anchor_Symmetric', 'relationship' -%>,
106
- so that creating a "spouseOf" connection from one item to another
107
- implies an connection going the other direction even if it is not
108
- defined explicitly.
109
-
110
- </dd></dl>
111
- </div>
73
+ <% if @item.sti_type.nil? %>
74
+ </div>
75
+
76
+ <div class="noncontent" style="width: 60%; float: right; margin-left: 0;">
77
+ <dl><dt id="category_title">Category</dt><dd id="category_desc">
78
+
79
+ "Category" is for groups of things, for concepts, and for the
80
+ upper levels of <%=
81
+ popup_help_icon 'Definition of hierarchies in a wontology',
82
+ 'Help:GlossaryAtoO#anchor_Hierarchy', 'hierarchies' -%>.
83
+ (Though a hierarchy made up entirely of concepts could be all
84
+ Categories.) Categories can "contain" other categories and/or
85
+ individuals.
86
+
87
+ </dd><dt id="individual_title">Individual</dt><dd id="individual_desc">
88
+
89
+ "Individual" is for specific, concrete things. Individuals can
90
+ "contain" other individuals, but cannot contain categories.
91
+ ("Ford Model-T" might be an individual, but could still contain
92
+ parts that are also individuals, like "Windshield" and "Tire".)
93
+
94
+ </dd><dt id="property_title">Property</dt><dd id="property_desc">
95
+
96
+ "Property" is used to define <%=
97
+ popup_help_icon 'Definition of relationships in a wontology',
98
+ 'Help:GlossaryPtoZ#anchor_Relationship', 'relationships' -%>
99
+ between other items. Once you create a new Property <%=
100
+ popup_help_icon 'Definition of Item',
101
+ 'Help:GlossaryAtoO#anchor_Item', 'item' -%>,
102
+ you should create one or more <%=
103
+ popup_help_icon 'Definition of Connection',
104
+ 'Help:GlossaryAtoO#anchor_Connection', 'connections' -%>
105
+ that relate that property to other existing properties. In
106
+ general, you will use the "sub_property_of" property in order to
107
+ create these connections. For example, if you were creating a
108
+ description of famillial relations between people, you might
109
+ create a new property named "spouseOf". To define what the
110
+ creation of connections using this new property <em>means</em>, you
111
+ can create the connection "<code>spouseOf sub_property_of
112
+ symmetric_relationship</code>". This example will cause
113
+ "spouseOf" to be treated as a "peer" <%=
114
+ popup_help_icon 'Peer relationships in a wontology',
115
+ 'Help:GlossaryPtoZ#anchor_Peer', 'relationship' -%>
116
+ (rather than a hierarchical one), and as a symmetric <%=
117
+ popup_help_icon 'Symmetric relationships in a wontology',
118
+ 'Help:GlossaryPtoZ#anchor_Symmetric', 'relationship' -%>,
119
+ so that creating a "spouseOf" connection from one item to another
120
+ implies an connection going the other direction even if it is not
121
+ defined explicitly.
122
+
123
+ </dd></dl>
124
+ </div>
125
+ <% end %> <!-- instructions only if no .sti_type yet -->
112
126
  <% end %> <!-- of form_for -->
127
+ <%= ruby_hash_to_javascript 'class_to_type', @class_to_item_map %>
113
128
 
114
129
  <% content_for :first_bottom_page_js do %>
115
130
  <script type="text/javascript">
@@ -23,15 +23,24 @@
23
23
  <meta name="googlebot" content="noindex" />
24
24
  <% end %>
25
25
 
26
- <% require Rails.root.join( 'lib', 'helpers', 'item_helper') %>
26
+ <%
27
+ require Rails.root.join( 'lib', 'helpers', 'item_helper')
27
28
 
29
+ show_class_control = @item.class_item_id.nil?
30
+ if show_class_control %>
31
+ <h1>Make a new item</h1>
32
+ <% else %>
33
+ <h1>Enter a new <%= @item.class_item.name -%></h1>
34
+ <% end
35
+ %>
28
36
 
29
- <h1>Make a new item</h1>
30
37
 
31
38
  <% options = @item.sti_type.nil? ? {} : { :url => items_path() }
32
39
  form_for(@item, options) do |f|
33
40
  %>
34
41
  <%= f.error_messages %>
42
+ <%= render :partial => "class_select",
43
+ :locals => { :f => f, :show_class_control => show_class_control } %>
35
44
  <%= render :partial => "type_select", :locals => { :f => f } %>
36
45
  <%= render :partial => "form_fields", :locals => { :f => f } %>
37
46
  <%= hidden_field_tag 'popup_flag', 'yes' %>
@@ -39,7 +48,7 @@
39
48
  <p id="create_button_container" style="text-align: center">
40
49
  <%= button_to_function "Create",
41
50
  "if (okToSubmitItemForm()) itemCreatePopup_Submit(this)",
42
- :id => "item_submit", :tabindex => "10" %>
51
+ :id => "item_submit", :tabindex => "150" %>
43
52
  </p>
44
53
 
45
54
  <p style="text-align: center">
@@ -47,12 +56,18 @@
47
56
  'itemCreatePopup_Cancel()' %>
48
57
  </p>
49
58
  <% end %> <!-- of form_for -->
59
+ <%= ruby_hash_to_javascript 'class_to_type', @class_to_item_map %>
50
60
 
51
61
 
52
62
  <!-- forItemsForms.js should have already been loaded by page that
53
63
  popped us up. Call function to wire library functions to the form
54
64
  elements we've just loaded. -->
55
65
  <script type="text/javascript">
66
+ <% if @item.sti_type.nil? %>
67
+ $('item_sti_type').focus();
68
+ <% else %>
69
+ $('item_title').focus();
70
+ <% end %>
56
71
  genNameFromTitleOk = true;
57
72
  plumbEventHandlersToItemCreationElements("submitViaModalbox");
58
73
  </script>
@@ -19,6 +19,7 @@
19
19
 
20
20
 
21
21
  <%
22
+ require Rails.root.join( 'lib', 'helpers', 'item_helper')
22
23
  @title_text = h( filter_parenthetical( @item.title ) )
23
24
 
24
25
  # initialize array to define "Glossary Help" box of links:
@@ -49,6 +50,9 @@
49
50
 
50
51
  <% # populate top (title/name/desc) section of page
51
52
  %>
53
+ <div id="div-for-type-class"
54
+ style="float:right; text-align: right; font-size: 80%; font-weight: bold;">
55
+ </div>
52
56
  <p style="margin-bottom: 0; font-weight: bold;">
53
57
  <%= text_with_tooltip h( @item.title ),
54
58
  '&nbsp;<b>Title</b> of this <b>Item</b>&nbsp;', 'item_title' %>
@@ -71,6 +75,14 @@
71
75
 
72
76
 
73
77
 
78
+ <% if @item.is_class? %>
79
+ <div style="text-align: center;">
80
+ <%= link_to "Add a new <b>#{h @item.name}</b>",
81
+ new_item_path + "?class_item=" + @item.id.to_s %>
82
+ </div>
83
+ <% end %>
84
+
85
+
74
86
  <% # links to global pages/actions
75
87
  %>
76
88
  <p style="clear: right">
@@ -79,10 +91,58 @@
79
91
  <% end %>
80
92
  </p>
81
93
 
94
+
95
+ <style>
96
+ .instance-list {
97
+ padding-left: 0;
98
+ }
99
+ .instance-list li {
100
+ color: #ffff60;
101
+ margin-right: 1.5em;
102
+ display: inline;
103
+ }
104
+ .instance-list li:before {
105
+ display: marker;
106
+ content: ">>";
107
+ }
108
+ .instance-list li span {
109
+ color: black;
110
+ }
111
+ </style>
112
+
113
+ <% if @item.is_class? %>
114
+ <h2 class="subheading"><%= h filter_parenthetical @item.title -%></h2>
115
+ <ul class='instance-list'>
116
+ <%
117
+ # we know that all the connections where this item is the object are
118
+ # located in the last array within @connection_list. Search through
119
+ # it for all of the connections where 'is_instance_of' is the predicate
120
+
121
+ iio_item_id = nil
122
+ @connection_list[-1].each do |maybe_iio_connection|
123
+ unless iio_item_id
124
+ if @item_hash[maybe_iio_connection.predicate_id].
125
+ name == 'is_instance_of'
126
+ iio_item_id = maybe_iio_connection.predicate_id
127
+ end
128
+ end
129
+
130
+ if iio_item_id == maybe_iio_connection.predicate_id %>
131
+ <li><span>
132
+ <%= item = @item_hash[maybe_iio_connection.subject_id]
133
+ link_to (h item.name), item_by_name_path(item.name) %>
134
+ </span></li>
135
+ <% end %>
136
+ <% end %>
137
+ </ul>
138
+ <% end %>
139
+
140
+
141
+ <h3 class="subheading">This Class' Relationships</h3>
142
+
82
143
  <% # populate bottom (connections referencing this item) section of page
83
144
  unless @connection_list.empty? %>
84
145
 
85
-
86
146
  <% # track things to do only once:
87
147
  list_open_output = false
88
148
  last_predicate_id = nil
@@ -91,6 +151,8 @@
91
151
  @show_help_icon_used = false
92
152
  @edit_help_icon_used = false
93
153
  @delete_help_icon_used = false
154
+ @add_scalar_help_icon_used = false
155
+ @add_item_help_icon_used = false
94
156
 
95
157
  array_of_arrays_of_connections = @connection_list.to_enum
96
158
 
@@ -116,7 +178,7 @@
116
178
  </div>
117
179
  <% end %>
118
180
 
119
- <ul>
181
+ <ul style="padding-left: 0;">
120
182
  <%= text_with_tooltip (h filter_parenthetical @item.title),
121
183
  (h @item.name) %>
122
184
  <ul style="list-style-type: none;">
@@ -138,13 +200,31 @@
138
200
  <div style="float: right; font-size: 80%; margin-right: 6em;">
139
201
  <% if connection.id
140
202
  generate_connection_links(connection)
141
- else
203
+ elsif connection.obj_id
142
204
  generate_inverse_link(@inverses_map[connection])
143
205
  end %>
144
206
  </div>
145
- <%= item = @item_hash[connection.obj_id]
146
- link_with_tooltip (h filter_parenthetical item.title ),
147
- h( item.name ), item_by_name_path(item.name) %>
207
+
208
+ <% if connection.kind_of_obj == Connection::OBJECT_KIND_SCALAR &&
209
+ connection.scalar_obj.nil? %>
210
+ <%= render :partial => "inline_scalar_add_form",
211
+ :locals => { :con => connection } %>
212
+
213
+ <% elsif connection.kind_of_obj == Connection::OBJECT_KIND_ITEM &&
214
+ connection.obj_id.nil? %>
215
+ <%= items = @intances_of_type_item_classes[connection.type_item]
216
+ items = Item.all unless !items.nil?
217
+ render :partial => "inline_item_add_form",
218
+ :locals => { :con => connection, :items => items } %>
219
+
220
+ <% elsif connection.kind_of_obj == Connection::OBJECT_KIND_ITEM %>
221
+ <%= item = @item_hash[connection.obj_id]
222
+ link_with_tooltip (h filter_parenthetical item.title ),
223
+ h( item.name ), item_by_name_path(item.name) %>
224
+
225
+ <% else %>
226
+ <%= h connection.scalar_obj %>
227
+ <% end %>
148
228
  </li>
149
229
 
150
230
  <% last_predicate_id = connection.predicate_id
@@ -190,7 +270,11 @@
190
270
  </td><td class="connectioncolumn">
191
271
  <%= self_string_or_other_link(connection.predicate_id) %>
192
272
  </td><td>
193
- <%= self_string_or_other_link(connection.obj_id) %>
273
+ <% if connection.kind_of_obj == Connection::OBJECT_KIND_ITEM %>
274
+ <%= self_string_or_other_link(connection.obj_id) %>
275
+ <% else %>
276
+ <%= h connection.scalar_obj %>
277
+ <% end %>
194
278
  </td><td style="font-size: 80%">
195
279
  <% if connection.id
196
280
  generate_connection_links(connection)
@@ -212,3 +296,22 @@
212
296
  end
213
297
  end # unless @connection_list.empty?
214
298
  %>
299
+
300
+ <script type="text/javascript">
301
+ content = "<%= ItemHelper::ITEM_SUBTYPES_TO_HUMAN[@item.sti_type] -%>";
302
+ <% if @item.class_item %>
303
+ content += "<br /><%=h @item.class_item.name %>";
304
+ <% elsif superclass_item = @item.superclass_of %>
305
+ content += "<br />(<%=h superclass_item.name %>)";
306
+ <% elsif @item.is_class? %>
307
+ content += "<br />(is a class)";
308
+ <% end %>
309
+ $('div-for-type-class').innerHTML = content;
310
+ </script>
311
+
312
+ <% content_for :first_bottom_page_js do %>
313
+ <script type="text/javascript">
314
+ inAnItemsForm = false; // meant to indicate items/new or items/edit
315
+ creatingNewItem = true;
316
+ </script>
317
+ <% end %>