wontomedia 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +661 -0
- data/COPYING.DOCUMENTATION +450 -0
- data/LICENSE +661 -0
- data/README.markdown +56 -0
- data/Rakefile +185 -0
- data/VERSION.yml +4 -0
- data/app/controllers/admin_controller.rb +144 -0
- data/app/controllers/application_controller.rb +29 -0
- data/app/controllers/connections_controller.rb +150 -0
- data/app/controllers/items_controller.rb +365 -0
- data/app/helpers/connections_helper.rb +67 -0
- data/app/helpers/format_helper.rb +154 -0
- data/app/helpers/items_helper.rb +105 -0
- data/app/models/category_item.rb +23 -0
- data/app/models/connection.rb +210 -0
- data/app/models/individual_item.rb +23 -0
- data/app/models/item.rb +86 -0
- data/app/models/property_item.rb +23 -0
- data/app/models/qualified_item.rb +23 -0
- data/app/views/admin/index.html.erb +74 -0
- data/app/views/connections/_index_outbound_links.html.erb +48 -0
- data/app/views/connections/_spo_select_controls.html.erb +151 -0
- data/app/views/connections/edit.html.erb +70 -0
- data/app/views/connections/index.html.erb +84 -0
- data/app/views/connections/new.html.erb +61 -0
- data/app/views/connections/show.html.erb +110 -0
- data/app/views/items/_active_content.html.erb +26 -0
- data/app/views/items/_content_examples.html.erb +55 -0
- data/app/views/items/_core_tasks.html.erb +23 -0
- data/app/views/items/_form_fields.html.erb +69 -0
- data/app/views/items/_list_outbound_links.html.erb +58 -0
- data/app/views/items/_screen_select.html.erb +24 -0
- data/app/views/items/_show_outbound_links.html.erb +70 -0
- data/app/views/items/_topic_list.html.erb +26 -0
- data/app/views/items/_type_select.html.erb +47 -0
- data/app/views/items/edit.html.erb +63 -0
- data/app/views/items/index.html.erb +74 -0
- data/app/views/items/new.html.erb +124 -0
- data/app/views/items/newpop.html.erb +58 -0
- data/app/views/items/show.html.erb +209 -0
- data/app/views/layouts/_amazon_ads.html.erb +55 -0
- data/app/views/layouts/_glossary_help_box.html.erb +43 -0
- data/app/views/layouts/_google_ads.html.erb +40 -0
- data/app/views/layouts/_language_select.html.erb +24 -0
- data/app/views/layouts/_login_controls.html.erb +24 -0
- data/app/views/layouts/_master_help.html.erb +24 -0
- data/app/views/layouts/_navigation_menu.html.erb +39 -0
- data/app/views/layouts/_search_box.html.erb +27 -0
- data/app/views/layouts/_status_msgs.html.erb +25 -0
- data/app/views/layouts/application.html.erb +67 -0
- data/app/views/layouts/base.html.erb +93 -0
- data/app/views/layouts/home.html.erb +67 -0
- data/app/views/layouts/popup.html.erb +23 -0
- data/assets/wontomedia-sample.rb +47 -0
- data/config/asset_packages.yml +44 -0
- data/config/boot.rb +110 -0
- data/config/cucumber.yml +65 -0
- data/config/database-mysql-development.yml +47 -0
- data/config/database-mysql.yml +26 -0
- data/config/environment.rb +94 -0
- data/config/environments/cucumber.rb +29 -0
- data/config/environments/development.rb +26 -0
- data/config/environments/production.rb +33 -0
- data/config/environments/test.rb +31 -0
- data/config/initializers/inflections.rb +19 -0
- data/config/initializers/mime_types.rb +14 -0
- data/config/initializers/new_rails_defaults.rb +26 -0
- data/config/locales/en.yml +14 -0
- data/config/routes.rb +37 -0
- data/db/fixtures/connections.yml +96 -0
- data/db/fixtures/items.yml +277 -0
- data/db/migrate/20090312212805_create_items.rb +31 -0
- data/db/migrate/20090406221320_create_connections.rb +32 -0
- data/db/migrate/20090411014503_add_type_for_item_subclasses.rb +29 -0
- data/db/migrate/20090415142152_rename_item_type.rb +31 -0
- data/db/migrate/20090518022918_rename_object_and_self.rb +33 -0
- data/db/migrate/20090529171442_add_flags_to_items.rb +27 -0
- data/db/migrate/20090529171508_add_flags_to_connections.rb +27 -0
- data/db/migrate/20090605213800_flags_columns_not_null.rb +29 -0
- data/db/migrate/20090605215028_flags_columns_default_zero.rb +29 -0
- data/db/schema.rb +30 -0
- data/default-custom/app/views/items/_home_extern_list.html.erb +32 -0
- data/default-custom/app/views/items/_home_introductory_text.html.erb +70 -0
- data/default-custom/app/views/items/home.html.erb +77 -0
- data/default-custom/public/images/logo.png +0 -0
- data/default-custom/public/images/logo.svg +74 -0
- data/default-custom/public/stylesheets/wm.css +301 -0
- data/doc/README.markdown +44 -0
- data/doc/README_FOR_APP +82 -0
- data/doc/customization.markdown +93 -0
- data/doc/scripts/rake-customize.markdown +83 -0
- data/lib/helpers/connection_helper.rb +41 -0
- data/lib/helpers/item_helper.rb +141 -0
- data/lib/helpers/tripple_navigation.rb +158 -0
- data/lib/tasks/cucumber.rake +83 -0
- data/lib/tasks/customize.rake +70 -0
- data/lib/tasks/db.rake +65 -0
- data/lib/tasks/javascript_testing_tasks.rake +176 -0
- data/public/404.html +50 -0
- data/public/422.html +50 -0
- data/public/500.html +53 -0
- data/public/dispatch.cgi +20 -0
- data/public/dispatch.fcgi +34 -0
- data/public/dispatch.rb +20 -0
- data/public/favicon.ico +0 -0
- data/public/images/blank_error_icon.png +0 -0
- data/public/images/blank_status_icon.png +0 -0
- data/public/images/error_error_icon.png +0 -0
- data/public/images/error_status_icon.png +0 -0
- data/public/images/good_status_icon.png +0 -0
- data/public/images/help_icon.png +0 -0
- data/public/images/twitter_icon.png +0 -0
- data/public/images/warn_error_icon.png +0 -0
- data/public/images/working_status_icon.gif +0 -0
- data/public/javascripts/application.js +56 -0
- data/public/javascripts/controls.js +963 -0
- data/public/javascripts/dragdrop.js +973 -0
- data/public/javascripts/effects.js +1128 -0
- data/public/javascripts/event.simulate.js +64 -0
- data/public/javascripts/fancybox.js +43 -0
- data/public/javascripts/forConnectionsForms.js +218 -0
- data/public/javascripts/forItemsForms.js +511 -0
- data/public/javascripts/itemCreatePopup.js +115 -0
- data/public/javascripts/itemTitleToName.js +119 -0
- data/public/javascripts/jquery.js +4376 -0
- data/public/javascripts/modalbox.js +502 -0
- data/public/javascripts/prototype.js +4320 -0
- data/public/javascripts/reconcileJQueryAndPrototype.js +19 -0
- data/public/robots.txt +7 -0
- data/public/stylesheets/blank.gif +0 -0
- data/public/stylesheets/fancy_close.png +0 -0
- data/public/stylesheets/fancy_loading.png +0 -0
- data/public/stylesheets/fancy_nav_left.png +0 -0
- data/public/stylesheets/fancy_nav_right.png +0 -0
- data/public/stylesheets/fancy_shadow_e.png +0 -0
- data/public/stylesheets/fancy_shadow_n.png +0 -0
- data/public/stylesheets/fancy_shadow_ne.png +0 -0
- data/public/stylesheets/fancy_shadow_nw.png +0 -0
- data/public/stylesheets/fancy_shadow_s.png +0 -0
- data/public/stylesheets/fancy_shadow_se.png +0 -0
- data/public/stylesheets/fancy_shadow_sw.png +0 -0
- data/public/stylesheets/fancy_shadow_w.png +0 -0
- data/public/stylesheets/fancy_title_left.png +0 -0
- data/public/stylesheets/fancy_title_main.png +0 -0
- data/public/stylesheets/fancy_title_over.png +0 -0
- data/public/stylesheets/fancy_title_right.png +0 -0
- data/public/stylesheets/fancybox.css +333 -0
- data/public/stylesheets/modalbox.css +110 -0
- data/public/stylesheets/scaffold.css +36 -0
- data/public/stylesheets/spinner.gif +0 -0
- data/script/about +4 -0
- data/script/console +3 -0
- data/script/cucumber +10 -0
- data/script/dbconsole +3 -0
- data/script/destroy +3 -0
- data/script/generate +3 -0
- data/script/performance/benchmarker +3 -0
- data/script/performance/profiler +3 -0
- data/script/performance/request +3 -0
- data/script/plugin +3 -0
- data/script/process/inspector +3 -0
- data/script/process/reaper +3 -0
- data/script/process/spawner +3 -0
- data/script/runner +3 -0
- data/script/server +3 -0
- data/vendor/plugins/asset_packager/CHANGELOG +122 -0
- data/vendor/plugins/asset_packager/README +178 -0
- data/vendor/plugins/asset_packager/Rakefile +22 -0
- data/vendor/plugins/asset_packager/about.yml +8 -0
- data/vendor/plugins/asset_packager/init.rb +2 -0
- data/vendor/plugins/asset_packager/install.rb +1 -0
- data/vendor/plugins/asset_packager/lib/jsmin.rb +205 -0
- data/vendor/plugins/asset_packager/lib/synthesis/asset_package.rb +212 -0
- data/vendor/plugins/asset_packager/lib/synthesis/asset_package_helper.rb +39 -0
- data/vendor/plugins/asset_packager/tasks/asset_packager_tasks.rake +23 -0
- data/vendor/plugins/asset_packager/test/asset_package_helper_development_test.rb +100 -0
- data/vendor/plugins/asset_packager/test/asset_package_helper_production_test.rb +140 -0
- data/vendor/plugins/asset_packager/test/asset_packager_test.rb +92 -0
- data/vendor/plugins/asset_packager/test/asset_packages.yml +20 -0
- data/vendor/plugins/asset_packager/test/assets/javascripts/application.js +2 -0
- data/vendor/plugins/asset_packager/test/assets/javascripts/bar.js +4 -0
- data/vendor/plugins/asset_packager/test/assets/javascripts/controls.js +815 -0
- data/vendor/plugins/asset_packager/test/assets/javascripts/dragdrop.js +913 -0
- data/vendor/plugins/asset_packager/test/assets/javascripts/effects.js +958 -0
- data/vendor/plugins/asset_packager/test/assets/javascripts/foo.js +4 -0
- data/vendor/plugins/asset_packager/test/assets/javascripts/prototype.js +2006 -0
- data/vendor/plugins/asset_packager/test/assets/stylesheets/bar.css +16 -0
- data/vendor/plugins/asset_packager/test/assets/stylesheets/foo.css +16 -0
- data/vendor/plugins/asset_packager/test/assets/stylesheets/header.css +16 -0
- data/vendor/plugins/asset_packager/test/assets/stylesheets/screen.css +16 -0
- data/vendor/plugins/asset_packager/test/assets/stylesheets/subdir/bar.css +16 -0
- data/vendor/plugins/asset_packager/test/assets/stylesheets/subdir/foo.css +16 -0
- metadata +265 -0
@@ -0,0 +1,26 @@
|
|
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
|
+
|
21
|
+
<% if @display_unimplemented %>
|
22
|
+
<div id="block-topics" class="box">
|
23
|
+
<p class="unimplemented">[area to list all Topics in the
|
24
|
+
wontology, sorted by size/activity]</p>
|
25
|
+
</div>
|
26
|
+
<% end -%>
|
@@ -0,0 +1,47 @@
|
|
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
|
+
|
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
|
34
|
+
|
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>
|
@@ -0,0 +1,63 @@
|
|
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
|
+
|
21
|
+
<% content_for :head do %>
|
22
|
+
<meta name="robots" content="noindex" />
|
23
|
+
<meta name="googlebot" content="noindex" />
|
24
|
+
<% end
|
25
|
+
|
26
|
+
@title_text = filter_parenthetical h @item.title
|
27
|
+
|
28
|
+
# initialize array to define "Glossary Help" box of links:
|
29
|
+
@glossary_help_entries = [
|
30
|
+
[ 'Item', 'Help:GlossaryAtoO#anchor_Item' ]
|
31
|
+
]
|
32
|
+
%>
|
33
|
+
|
34
|
+
<div class="headline">Editing item<%=
|
35
|
+
popup_help_icon "Help item edit", "Help:Popup/HeaderItemEdit" %>
|
36
|
+
</div>
|
37
|
+
|
38
|
+
|
39
|
+
<% form_for(@item, :url => item_path(@item)) do |f| %>
|
40
|
+
<%= f.error_messages %>
|
41
|
+
<%= render :partial => "form_fields", :locals => { :f => f } %>
|
42
|
+
<p><%= f.submit "Update", :tabindex => "10" %></p>
|
43
|
+
<% end %>
|
44
|
+
|
45
|
+
<div class="horizontal-link-list"><ul>
|
46
|
+
<li><%= link_to 'Cancel, show item', item_path(@item),
|
47
|
+
:rel => 'nofollow' -%></li>
|
48
|
+
<li><%= link_to 'Cancel, show item list', items_path,
|
49
|
+
:rel => 'nofollow' -%></li>
|
50
|
+
</ul></div>
|
51
|
+
|
52
|
+
<% content_for :first_bottom_page_js do %>
|
53
|
+
<script type="text/javascript">
|
54
|
+
inAnItemsForm = true;
|
55
|
+
creatingNewItem = false;
|
56
|
+
</script>
|
57
|
+
<% end %>
|
58
|
+
<% content_for :last_bottom_page_js do %>
|
59
|
+
<script type="text/javascript">
|
60
|
+
plumbEventHandlersToItemCreationElements();
|
61
|
+
$(controlNamePrefix + 'item_title').focus();
|
62
|
+
</script>
|
63
|
+
<% end %>
|
@@ -0,0 +1,74 @@
|
|
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
|
+
|
21
|
+
<%
|
22
|
+
require Rails.root.join( 'lib', 'helpers', 'item_helper')
|
23
|
+
@title_text = 'All Items'
|
24
|
+
|
25
|
+
# initialize array to define "Glossary Help" box of links:
|
26
|
+
@glossary_help_entries = [
|
27
|
+
[ 'Name', 'Help:GlossaryAtoO#anchor_Name' ],
|
28
|
+
[ 'Title', 'Help:GlossaryPtoZ#anchor_Title' ],
|
29
|
+
[ 'Description', 'Help:GlossaryAtoO#anchor_Description' ],
|
30
|
+
[ 'Item', 'Help:GlossaryAtoO#anchor_Item' ],
|
31
|
+
[ 'Connection', 'Help:GlossaryAtoO#anchor_Connection' ]
|
32
|
+
]
|
33
|
+
%>
|
34
|
+
|
35
|
+
|
36
|
+
<div class="headline">
|
37
|
+
|
38
|
+
<%= popup_help_icon "Help, items list", "Help:Popup/HeaderItemsIndex"
|
39
|
+
-%>Listing all defined items
|
40
|
+
|
41
|
+
<div class="noncontent vertical-link-list"
|
42
|
+
style="float: left; margin-left: 2em;">
|
43
|
+
<%= render :partial => "list_outbound_links",
|
44
|
+
:locals => { :generating_index_page => true } %>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<table class="tight-table index-table" style="clear: both;">
|
49
|
+
<% @edit_help_icon_used = false
|
50
|
+
@delete_help_icon_used = false
|
51
|
+
|
52
|
+
@items.each do |item| %>
|
53
|
+
<% content_tag :tr, :id => h(item.name) do %>
|
54
|
+
<td class="firstrow"><%= wrap_item_name h item.name -%></td>
|
55
|
+
<td class="firstrow" style="font-weight: bold; width: 62%;">
|
56
|
+
<%= link_to filter_parenthetical(h item.title), item_path(item) -%></td>
|
57
|
+
<td class="firstrow" style="font-size: 80%;">
|
58
|
+
<% generate_item_links(item) %>
|
59
|
+
</td>
|
60
|
+
<% end %>
|
61
|
+
<tr>
|
62
|
+
<td colspan="3" class="secondrow" style="padding-left: 2.2em;">
|
63
|
+
<span style="font-size: 70%">
|
64
|
+
<%=h ItemHelper::ITEM_SUBTYPES_TO_HUMAN[item.sti_type] %>:</span>
|
65
|
+
<%=h item.description %></td>
|
66
|
+
</tr>
|
67
|
+
<% end %>
|
68
|
+
</table>
|
69
|
+
|
70
|
+
<div class="horizontal-link-list">
|
71
|
+
<%= render :partial => 'list_outbound_links',
|
72
|
+
:locals => { :generating_index_page => true } %>
|
73
|
+
</div>
|
74
|
+
|
@@ -0,0 +1,124 @@
|
|
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
|
+
|
21
|
+
<% content_for :head do %>
|
22
|
+
<meta name="robots" content="noindex" />
|
23
|
+
<meta name="googlebot" content="noindex" />
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<%
|
27
|
+
require Rails.root.join( 'lib', 'helpers', 'item_helper')
|
28
|
+
@title_text = 'Make a new item'
|
29
|
+
|
30
|
+
# initialize array to define "Glossary Help" box of links:
|
31
|
+
@glossary_help_entries = [
|
32
|
+
[ 'Category', 'Help:GlossaryAtoO#anchor_Category' ],
|
33
|
+
[ 'Individual', 'Help:GlossaryAtoO#anchor_Individual' ],
|
34
|
+
[ 'Property', 'Help:GlossaryAtoO#anchor_Property' ],
|
35
|
+
[ 'Item', 'Help:GlossaryAtoO#anchor_Item' ]
|
36
|
+
]
|
37
|
+
%>
|
38
|
+
|
39
|
+
|
40
|
+
<% options = @item.sti_type.nil? ? {} : { :url => items_path() }
|
41
|
+
form_for(@item, options) do |f|
|
42
|
+
%>
|
43
|
+
<%= f.error_messages %>
|
44
|
+
<div style="width: 36%; float: left;">
|
45
|
+
<%= render :partial => "type_select", :locals => { :f => f } %>
|
46
|
+
<%= render :partial => "form_fields", :locals => { :f => f } %>
|
47
|
+
<script type="text/javascript">
|
48
|
+
genNameFromTitleOk = true;
|
49
|
+
</script>
|
50
|
+
|
51
|
+
<p id="create_button_container" style="text-align: center">
|
52
|
+
<%= f.submit "Create", :tabindex => "10" %>
|
53
|
+
</p>
|
54
|
+
|
55
|
+
<div class="horizontal-link-list"><ul>
|
56
|
+
<li><%= link_to 'Cancel, show item list', items_path,
|
57
|
+
:rel => 'nofollow' -%></li>
|
58
|
+
<li><%= link_to 'Cancel, show connection list',
|
59
|
+
connections_path, :rel => 'nofollow' -%></li>
|
60
|
+
</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>
|
112
|
+
<% end %> <!-- of form_for -->
|
113
|
+
|
114
|
+
<% content_for :first_bottom_page_js do %>
|
115
|
+
<script type="text/javascript">
|
116
|
+
inAnItemsForm = true;
|
117
|
+
creatingNewItem = true;
|
118
|
+
</script>
|
119
|
+
<% end %>
|
120
|
+
<% content_for :last_bottom_page_js do %>
|
121
|
+
<script type="text/javascript">
|
122
|
+
plumbEventHandlersToItemCreationElements();
|
123
|
+
</script>
|
124
|
+
<% end %>
|
@@ -0,0 +1,58 @@
|
|
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
|
+
|
21
|
+
<% content_for :head do %>
|
22
|
+
<meta name="robots" content="noindex" />
|
23
|
+
<meta name="googlebot" content="noindex" />
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<% require Rails.root.join( 'lib', 'helpers', 'item_helper') %>
|
27
|
+
|
28
|
+
|
29
|
+
<h1>Make a new item</h1>
|
30
|
+
|
31
|
+
<% options = @item.sti_type.nil? ? {} : { :url => items_path() }
|
32
|
+
form_for(@item, options) do |f|
|
33
|
+
%>
|
34
|
+
<%= f.error_messages %>
|
35
|
+
<%= render :partial => "type_select", :locals => { :f => f } %>
|
36
|
+
<%= render :partial => "form_fields", :locals => { :f => f } %>
|
37
|
+
<%= hidden_field_tag 'popup_flag', 'yes' %>
|
38
|
+
|
39
|
+
<p id="create_button_container" style="text-align: center">
|
40
|
+
<%= button_to_function "Create",
|
41
|
+
"if (okToSubmitItemForm()) itemCreatePopup_Submit(this)",
|
42
|
+
:id => "item_submit", :tabindex => "10" %>
|
43
|
+
</p>
|
44
|
+
|
45
|
+
<p style="text-align: center">
|
46
|
+
<%= link_to_function 'Cancel item creation',
|
47
|
+
'itemCreatePopup_Cancel()' %>
|
48
|
+
</p>
|
49
|
+
<% end %> <!-- of form_for -->
|
50
|
+
|
51
|
+
|
52
|
+
<!-- forItemsForms.js should have already been loaded by page that
|
53
|
+
popped us up. Call function to wire library functions to the form
|
54
|
+
elements we've just loaded. -->
|
55
|
+
<script type="text/javascript">
|
56
|
+
genNameFromTitleOk = true;
|
57
|
+
plumbEventHandlersToItemCreationElements("submitViaModalbox");
|
58
|
+
</script>
|
@@ -0,0 +1,209 @@
|
|
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
|
+
|
21
|
+
<%
|
22
|
+
@title_text = h( filter_parenthetical( @item.title ) )
|
23
|
+
|
24
|
+
# initialize array to define "Glossary Help" box of links:
|
25
|
+
@glossary_help_entries = [
|
26
|
+
[ 'Name', 'Help:GlossaryAtoO#anchor_Name' ],
|
27
|
+
[ 'Title', 'Help:GlossaryPtoZ#anchor_Title' ],
|
28
|
+
[ 'Description', 'Help:GlossaryAtoO#anchor_Description' ],
|
29
|
+
[ 'Item', 'Help:GlossaryAtoO#anchor_Item' ]
|
30
|
+
]
|
31
|
+
%>
|
32
|
+
|
33
|
+
|
34
|
+
<style>
|
35
|
+
.margin-help-icon {
|
36
|
+
position: absolute;
|
37
|
+
left: 15.7%;
|
38
|
+
overflow: visible;
|
39
|
+
}
|
40
|
+
</style>
|
41
|
+
<% # question-icon for title/name/desc pop-up help
|
42
|
+
unless @popup_flag %>
|
43
|
+
<div style="height: 600px; float: left; padding-right: 1em;"> </div>
|
44
|
+
<div class="margin-help-icon">
|
45
|
+
<%= popup_help_icon "Help, item content", "Help:Popup/HeaderItem" %>
|
46
|
+
</div>
|
47
|
+
<% end %>
|
48
|
+
|
49
|
+
|
50
|
+
<% # populate top (title/name/desc) section of page
|
51
|
+
%>
|
52
|
+
<p style="margin-bottom: 0; font-weight: bold;">
|
53
|
+
<%= text_with_tooltip h( @item.title ),
|
54
|
+
' <b>Title</b> of this <b>Item</b> ', 'item_title' %>
|
55
|
+
</p>
|
56
|
+
|
57
|
+
<p id="item_name_para">
|
58
|
+
<%= text_with_tooltip h( @item.name ),
|
59
|
+
' <b>Name</b> of this <b>Item</b> ', 'item_name' %>
|
60
|
+
</p>
|
61
|
+
|
62
|
+
<p>
|
63
|
+
<%= text_with_tooltip h( @item.description ),
|
64
|
+
' <b>Description</b> of this <b>Item</b> ',
|
65
|
+
'item_description' %>
|
66
|
+
</p>
|
67
|
+
|
68
|
+
<% # embed this for testability and future JavaScript
|
69
|
+
%>
|
70
|
+
<div id="item_id" style="display: none"><%= h @item.id -%></div>
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
<% # links to global pages/actions
|
75
|
+
%>
|
76
|
+
<p style="clear: right">
|
77
|
+
<% unless @popup_flag %>
|
78
|
+
<%= render :partial => "show_outbound_links" -%>
|
79
|
+
<% end %>
|
80
|
+
</p>
|
81
|
+
|
82
|
+
<% # populate bottom (connections referencing this item) section of page
|
83
|
+
unless @connection_list.empty? %>
|
84
|
+
|
85
|
+
|
86
|
+
<% # track things to do only once:
|
87
|
+
list_open_output = false
|
88
|
+
last_predicate_id = nil
|
89
|
+
last_obj_id = nil
|
90
|
+
table_open_output = false
|
91
|
+
@show_help_icon_used = false
|
92
|
+
@edit_help_icon_used = false
|
93
|
+
@delete_help_icon_used = false
|
94
|
+
|
95
|
+
array_of_arrays_of_connections = @connection_list.to_enum
|
96
|
+
|
97
|
+
|
98
|
+
# first, put all connections w/ current item-is-subject into indented list
|
99
|
+
begin
|
100
|
+
while true do # exit via break or exception
|
101
|
+
|
102
|
+
connection_array = array_of_arrays_of_connections.next
|
103
|
+
|
104
|
+
# check ID of first connection's subject item against "this" item's ID
|
105
|
+
break if @connection_hash[connection_array[0]].subject_id != @item.id
|
106
|
+
|
107
|
+
connection_array.each do |connection_id|
|
108
|
+
e = @connection_hash[connection_id]
|
109
|
+
|
110
|
+
unless list_open_output
|
111
|
+
list_open_output = true
|
112
|
+
|
113
|
+
# question-icon for connections-list pop-up help
|
114
|
+
unless @popup_flag %>
|
115
|
+
<div class="margin-help-icon">
|
116
|
+
<%= popup_help_icon "Help, connections referencing a item",
|
117
|
+
"Help:Popup/HeaderItemConnectionList" %>
|
118
|
+
</div>
|
119
|
+
<% end %>
|
120
|
+
|
121
|
+
<ul>
|
122
|
+
<%= text_with_tooltip (h filter_parenthetical @item.title),
|
123
|
+
(h @item.name) %>
|
124
|
+
<ul style="list-style-type: none;">
|
125
|
+
<% end
|
126
|
+
|
127
|
+
if last_predicate_id != e.predicate_id
|
128
|
+
if last_predicate_id %>
|
129
|
+
</ul>
|
130
|
+
</li>
|
131
|
+
<% end %>
|
132
|
+
<li>
|
133
|
+
<%= n = @item_hash[e.predicate_id]
|
134
|
+
link_with_tooltip (h filter_parenthetical n.title ),
|
135
|
+
h( n.name ), item_path(n) %>
|
136
|
+
<ul style="list-style-type: circle;">
|
137
|
+
<% end %>
|
138
|
+
|
139
|
+
<li>
|
140
|
+
<div style="float: right; font-size: 80%; margin-right: 6em;">
|
141
|
+
<% generate_connection_links(e) %>
|
142
|
+
</div>
|
143
|
+
<%= n = @item_hash[e.obj_id]
|
144
|
+
link_with_tooltip (h filter_parenthetical n.title ),
|
145
|
+
h( n.name ), item_path(n) %>
|
146
|
+
</li>
|
147
|
+
|
148
|
+
<% last_predicate_id = e.predicate_id
|
149
|
+
|
150
|
+
end # .each over connection_array
|
151
|
+
end # while over array-of-connection_array's
|
152
|
+
rescue StopIteration # out of connections
|
153
|
+
connection_array = nil # none for table
|
154
|
+
end
|
155
|
+
|
156
|
+
|
157
|
+
if list_open_output %>
|
158
|
+
</ul>
|
159
|
+
</li>
|
160
|
+
</ul>
|
161
|
+
</ul>
|
162
|
+
<p style="line-height: 50%; font-size: 50%;"> </p>
|
163
|
+
<% end
|
164
|
+
|
165
|
+
# now put any remaining connections into a table
|
166
|
+
if connection_array
|
167
|
+
loop do # until exception on .next at loop's end
|
168
|
+
|
169
|
+
unless table_open_output
|
170
|
+
table_open_output = true
|
171
|
+
|
172
|
+
# question-icon for connections-table pop-up help
|
173
|
+
unless @popup_flag %>
|
174
|
+
<div class="margin-help-icon">
|
175
|
+
<%= popup_help_icon "Help, connections referencing a item",
|
176
|
+
"Help:Popup/HeaderItemConnectionTable" %>
|
177
|
+
</div>
|
178
|
+
<% end
|
179
|
+
|
180
|
+
output_table_open
|
181
|
+
end %>
|
182
|
+
|
183
|
+
<tbody>
|
184
|
+
<% connection_array.each do |connection_id| %>
|
185
|
+
<tr>
|
186
|
+
<td>
|
187
|
+
<%= e = @connection_hash[connection_id]
|
188
|
+
self_string_or_other_link(e.subject_id) %>
|
189
|
+
</td><td class="connectioncolumn">
|
190
|
+
<%= self_string_or_other_link(e.predicate_id) %>
|
191
|
+
</td><td>
|
192
|
+
<%= self_string_or_other_link(e.obj_id) %>
|
193
|
+
</td><td style="font-size: 80%">
|
194
|
+
<% generate_connection_links(e) %>
|
195
|
+
</td>
|
196
|
+
</tr>
|
197
|
+
<% end %>
|
198
|
+
</tbody>
|
199
|
+
<%
|
200
|
+
connection_array = array_of_arrays_of_connections.next
|
201
|
+
|
202
|
+
end # loop over ..._connections iterator
|
203
|
+
end # if any connections to put in table
|
204
|
+
|
205
|
+
if table_open_output
|
206
|
+
output_table_close
|
207
|
+
end
|
208
|
+
end # unless @connection_list.empty?
|
209
|
+
%>
|