wontomedia 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +5 -1
- data/VERSION.yml +1 -1
- data/app/controllers/admin_controller.rb +2 -2
- data/app/controllers/items_controller.rb +22 -0
- data/app/views/items/_form_fields.html.erb +13 -5
- data/app/views/layouts/_master_help.html.erb +2 -2
- data/app/views/layouts/_search_box.html.erb +28 -19
- data/app/views/layouts/base.html.erb +10 -0
- data/config/initializers/extensions.rb +24 -0
- data/default-custom/public/stylesheets/wm.css +3 -1
- data/doc/gemlist.txt +42 -0
- data/public/javascripts/forItemsForms.js +1 -1
- data/public/javascripts/itemCreatePopup.js +25 -3
- data/public/javascripts/itemTitleToName.js +3 -1
- metadata +29 -10
data/Rakefile
CHANGED
@@ -72,7 +72,11 @@ ENDOSTRING
|
|
72
72
|
# log pkg tmp
|
73
73
|
# aren't included because developers are expected to pull from Git
|
74
74
|
|
75
|
-
s.
|
75
|
+
s.required_ruby_version = '~>1.8.7'
|
76
|
+
s.add_dependency 'rake', '~>0.8.7'
|
77
|
+
s.add_dependency 'rails', '~>2.3.5'
|
78
|
+
# can't run w/o a database interface gem, but don't want to specify
|
79
|
+
# a 'mysql' dependency in case we're being used with something else
|
76
80
|
end
|
77
81
|
|
78
82
|
task :build => :gemspec # don't build a gem from a stale spec
|
data/VERSION.yml
CHANGED
@@ -196,7 +196,7 @@ PLAIN_XML
|
|
196
196
|
Item.all.each do |item|
|
197
197
|
result_text += " <url>\n"
|
198
198
|
result_text += " <loc>#{item_by_name_url(item.name)}</loc>\n"
|
199
|
-
result_text += " <lastmod>#{item.updated_at.to_s(:
|
199
|
+
result_text += " <lastmod>#{item.updated_at.to_s(:w3c) }</lastmod>\n"
|
200
200
|
result_text += " <changefreq>monthly</changefreq>\n"
|
201
201
|
priority = (item.flags & Item::DATA_IS_UNALTERABLE)==0 ? '1.0' : '0.1'
|
202
202
|
result_text += " <priority>#{priority}</priority>\n"
|
@@ -207,7 +207,7 @@ PLAIN_XML
|
|
207
207
|
result_text += " <url>\n"
|
208
208
|
result_text += " <loc>#{connection_url(connection)}</loc>\n"
|
209
209
|
result_text += " <lastmod>" +
|
210
|
-
"#{connection.updated_at.to_s(:
|
210
|
+
"#{connection.updated_at.to_s(:w3c)}</lastmod>\n"
|
211
211
|
result_text += " <changefreq>monthly</changefreq>\n"
|
212
212
|
priority = (connection.flags & Connection::DATA_IS_UNALTERABLE)==0 ?
|
213
213
|
'0.5' : '0.1'
|
@@ -102,6 +102,7 @@ class ItemsController < ApplicationController
|
|
102
102
|
params[:item].delete :sti_type # don't mass-assign protected blah, blah
|
103
103
|
|
104
104
|
@item = ItemHelper.new_typed_item(type_string, params[:item])
|
105
|
+
@example = get_an_example_of @item
|
105
106
|
@popup_flag = true if params[:popup_flag]
|
106
107
|
|
107
108
|
if @item.nil?
|
@@ -564,7 +565,28 @@ private
|
|
564
565
|
class_to_item_map
|
565
566
|
end
|
566
567
|
|
568
|
+
def get_an_example_of( proto_item )
|
569
|
+
if proto_item && proto_item.class_item_id
|
570
|
+
connections_to_instances = Connection.all( :conditions => [
|
571
|
+
"(flags & #{Connection::DATA_IS_UNALTERABLE}) = 0 AND " +
|
572
|
+
"predicate_id = ? AND obj_id = ?",
|
573
|
+
Item.find_by_name('is_instance_of'), proto_item.class_item_id ] )
|
574
|
+
|
575
|
+
# TODO: replace with .choice when we migrate to Ruby 1.9
|
576
|
+
len = connections_to_instances.length
|
577
|
+
connection = connections_to_instances[ rand(len) ]
|
578
|
+
if connection
|
579
|
+
return Item.find_by_id connection.subject_id
|
580
|
+
end
|
581
|
+
end
|
582
|
+
|
583
|
+
item = Item.last( :conditions => [
|
584
|
+
"(flags & #{Item::DATA_IS_UNALTERABLE}) = 0" ])
|
585
|
+
return item ? item : Item.last() # make sure an empty install still works
|
586
|
+
end
|
587
|
+
|
567
588
|
def setup_for_form
|
589
|
+
@example = get_an_example_of @item
|
568
590
|
@class_list = all_class_items
|
569
591
|
@class_to_item_map = map_of_item_types_for_class_items @class_list
|
570
592
|
@this_is_non_information_page = true
|
@@ -18,11 +18,15 @@
|
|
18
18
|
%>
|
19
19
|
|
20
20
|
|
21
|
-
<p class="inputpara">
|
22
|
-
|
21
|
+
<p class="inputpara" style="position: relative;">
|
22
|
+
<span style="font-size: 120%; font-weight: bold;"><%=
|
23
|
+
f.label :title -%></span>
|
23
24
|
<%= popup_help_icon "Help for title", "Help:Popup/ItemTitle" %>
|
24
25
|
<%= image_tag "blank_error_icon.png", :id=>"title_error_icon", :alt=>"",
|
25
26
|
:size=>"16x16" -%>
|
27
|
+
<span style="position: absolute; left: 10em; top: 0.3ex; height: 1ex; white-space: nowrap;">
|
28
|
+
<i>for example:</i>"<%= h @example.title -%>"
|
29
|
+
</span>
|
26
30
|
<br />
|
27
31
|
<%= f.text_field :title, :tabindex => "120", :style => "width: 75%;" %>
|
28
32
|
</p><p class="directions">
|
@@ -34,13 +38,16 @@
|
|
34
38
|
in small spaces.
|
35
39
|
</p>
|
36
40
|
|
37
|
-
<p class="inputpara">
|
38
|
-
|
41
|
+
<p class="inputpara" style="position: relative;">
|
42
|
+
<span style="font-size: 120%; font-weight: bold;"><%= f.label :name %></span>
|
39
43
|
<%= popup_help_icon "Help for name", "Help:Popup/ItemName" %>
|
40
44
|
<%= image_tag "blank_error_icon.png", :id=>"name_error_icon", :alt=>"",
|
41
45
|
:size=>"16x16" %>
|
42
46
|
<%= image_tag "blank_status_icon.png", :id=>"name_status_icon", :alt=>"",
|
43
47
|
:size=>"32x16" %>
|
48
|
+
<span style="position: absolute; left: 10em; top: 0.3ex;">
|
49
|
+
<i>for example:</i>"<%= h @example.name -%>"
|
50
|
+
</span>
|
44
51
|
<br />
|
45
52
|
<%= f.text_field :name, :tabindex => "130", :style => "width: 55%;" %>
|
46
53
|
</p><p class="directions">
|
@@ -54,7 +61,8 @@
|
|
54
61
|
</p>
|
55
62
|
|
56
63
|
<p class="inputpara">
|
57
|
-
|
64
|
+
<span style="font-size: 120%; font-weight: bold;"><%=
|
65
|
+
f.label :description -%></span>
|
58
66
|
<%= popup_help_icon "Help for description", "Help:Popup/ItemDescription" %>
|
59
67
|
<%= image_tag "blank_error_icon.png", :id=>"description_error_icon", :alt=>"",
|
60
68
|
:size=>"16x16" %>
|
@@ -18,24 +18,33 @@
|
|
18
18
|
%>
|
19
19
|
|
20
20
|
|
21
|
-
<%
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
<
|
32
|
-
|
33
|
-
|
34
|
-
|
21
|
+
<% unless RAILS_ENV == 'test'
|
22
|
+
if WontoMedia.search.google_site_search and
|
23
|
+
WontoMedia.search.publisher_id and
|
24
|
+
WontoMedia.search.search_engine %>
|
25
|
+
<div id="block-search"></div>
|
26
|
+
<script>
|
27
|
+
addToDivsToMove('block-search');
|
28
|
+
</script>
|
29
|
+
|
30
|
+
<% content_for :last_bottom_page_js do %>
|
31
|
+
<div id="block-search-content" style="display: none;">
|
32
|
+
<form action="/w/search" id="cse-search-box">
|
33
|
+
<div>
|
34
|
+
<input type="hidden" name="cx"
|
35
|
+
value="<%=
|
36
|
+
WontoMedia.search.publisher_id + ':' +
|
37
|
+
WontoMedia.search.search_engine -%>" />
|
38
|
+
<input type="hidden" name="cof" value="FORID:10" />
|
39
|
+
<input type="hidden" name="ie" value="ISO-8859-1" />
|
40
|
+
<input type="text" name="q" size="20" />
|
41
|
+
<input type="submit" name="sa" value="Search" />
|
42
|
+
</div>
|
43
|
+
</form>
|
44
|
+
<script type="text/javascript"
|
45
|
+
src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"
|
46
|
+
></script>
|
35
47
|
</div>
|
36
|
-
|
37
|
-
|
38
|
-
src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"
|
39
|
-
></script>
|
40
|
-
</div>
|
48
|
+
<% end %>
|
49
|
+
<% end %>
|
41
50
|
<% end %>
|
@@ -51,6 +51,16 @@
|
|
51
51
|
<% else %>
|
52
52
|
<%= javascript_include_merged :top %>
|
53
53
|
<% end %>
|
54
|
+
<% unless RAILS_ENV == 'test'
|
55
|
+
if WontoMedia.analytics and
|
56
|
+
WontoMedia.analytics.google and
|
57
|
+
WontoMedia.analytics.google.profile_id %>
|
58
|
+
<script type="text/javascript">
|
59
|
+
window.google_analytics_uacct =
|
60
|
+
"<%= WontoMedia.analytics.google.profile_id -%>";
|
61
|
+
</script>
|
62
|
+
<% end
|
63
|
+
end %>
|
54
64
|
|
55
65
|
<%= yield :head %>
|
56
66
|
</head>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# WontoMedia - a wontology web application
|
2
|
+
# Copyright (C) 2010 - Glen E. Ivey
|
3
|
+
# www.wontology.com
|
4
|
+
#
|
5
|
+
# This program is free software: you can redistribute it and/or modify
|
6
|
+
# it under the terms of the GNU Affero General Public License version
|
7
|
+
# 3 as published by the Free Software Foundation.
|
8
|
+
#
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
# GNU Affero General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU Affero General Public License
|
15
|
+
# along with this program in the file COPYING and/or LICENSE. If not,
|
16
|
+
# see <http://www.gnu.org/licenses/>.
|
17
|
+
|
18
|
+
|
19
|
+
# allow us to convert to "W3C Datetime" format
|
20
|
+
# http://www.w3.org/TR/NOTE-datetime
|
21
|
+
Time::DATE_FORMATS[:w3c] =
|
22
|
+
lambda { |date| date.strftime( "%Y-%m-%dT%H:%M:%SZ" ) }
|
23
|
+
|
24
|
+
|
@@ -260,7 +260,9 @@ p + table { margin-bottom: 1.5em; }
|
|
260
260
|
border-style: none solid solid;
|
261
261
|
background: url("/images/transparent_ltblue_background.png") repeat;
|
262
262
|
padding: 0 0.3em;
|
263
|
-
height:
|
263
|
+
height: 5.8ex;
|
264
|
+
}
|
265
|
+
#block-help span {
|
264
266
|
font-size: 200%;
|
265
267
|
}
|
266
268
|
|
data/doc/gemlist.txt
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
The following are the gems installed the last time a full regression
|
2
|
+
test and exercise of the complete WontoMedia installation process was
|
3
|
+
conducted.
|
4
|
+
|
5
|
+
Note: there seems to be some incompatibility with json-1.2.3, but
|
6
|
+
otherwise all gems are the latest as of build time.
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
actionmailer (2.3.5)
|
11
|
+
actionpack (2.3.5)
|
12
|
+
activerecord (2.3.5)
|
13
|
+
activeresource (2.3.5)
|
14
|
+
activesupport (2.3.5)
|
15
|
+
builder (2.1.2)
|
16
|
+
cgi_multipart_eof_fix (2.5.0)
|
17
|
+
cucumber (0.6.3)
|
18
|
+
cucumber-rails (0.3.0)
|
19
|
+
daemons (1.0.10)
|
20
|
+
diff-lcs (1.1.2)
|
21
|
+
fastthread (1.0.7)
|
22
|
+
gem_plugin (0.2.3)
|
23
|
+
git (1.2.5)
|
24
|
+
json_pure (1.2.2)
|
25
|
+
migration_test_helper (1.3.3)
|
26
|
+
mongrel (1.1.5)
|
27
|
+
mysql (2.8.1)
|
28
|
+
nokogiri (1.4.1)
|
29
|
+
polyglot (0.3.0)
|
30
|
+
rack (1.0.1)
|
31
|
+
rack-test (0.5.3)
|
32
|
+
rails (2.3.5)
|
33
|
+
rake (0.8.7)
|
34
|
+
rspec (1.3.0)
|
35
|
+
rspec-rails (1.3.2)
|
36
|
+
rubyforge (2.0.4)
|
37
|
+
selenium-client (1.2.18)
|
38
|
+
technicalpickles-jeweler (1.2.1)
|
39
|
+
term-ansicolor (1.0.5)
|
40
|
+
treetop (1.4.4)
|
41
|
+
webrat (0.7.0)
|
42
|
+
ZenTest (4.2.1)
|
@@ -145,7 +145,7 @@ function plumbEventHandlersToItemCreationElements(customizationSelector){
|
|
145
145
|
checkFieldLength(b, indexTitle);
|
146
146
|
maybeClearIcon('title');
|
147
147
|
if (creatingNewItem){
|
148
|
-
var emptyToNotEmpty = generateFromTitle(b, c);
|
148
|
+
var emptyToNotEmpty = generateFromTitle(b, c, checkName);
|
149
149
|
if (emptyToNotEmpty){
|
150
150
|
itemFormErrors["item_name"] = false;
|
151
151
|
$('name_required').className = "";
|
@@ -82,6 +82,9 @@ function itemCreatePopup_Cancel(){
|
|
82
82
|
}
|
83
83
|
|
84
84
|
function itemCreatePopup_MakeSelection(){
|
85
|
+
// close Modalbox
|
86
|
+
Modalbox.hide();
|
87
|
+
|
85
88
|
if (!($('MB_content').innerHTML.match(
|
86
89
|
/Item\s+was\s+successfully\s+created/i))){
|
87
90
|
itemSelectElementHavingNewItemAdded.value =
|
@@ -108,6 +111,28 @@ function itemCreatePopup_MakeSelection(){
|
|
108
111
|
|
109
112
|
// make new item the selection in the operation-originating <select> control
|
110
113
|
itemSelectElementHavingNewItemAdded.value = idNo;
|
114
|
+
|
115
|
+
// kludge for Safari: WebKit (as-of Safari 4.0.4 3/2010) doesn't redisplay
|
116
|
+
// a <select> control when it's value is manipulated from JavaScript, even
|
117
|
+
// though the form will sumit correctly. So, to force a redisplay, we
|
118
|
+
// remove the DOM node for the alread-set select control from the page, and
|
119
|
+
// then put it back. Complexity arises from the fact it isn't the only
|
120
|
+
// element in its container; final "appendChild" is backup in case the
|
121
|
+
// complexity fails somehow.
|
122
|
+
var ourSelectControl = itemSelectElementHavingNewItemAdded;
|
123
|
+
var parent = ourSelectControl.parentNode;
|
124
|
+
var ourFollowingSibling = null;
|
125
|
+
for (var c=0; c < parent.childNodes.length; c++)
|
126
|
+
if (parent.childNodes[c] == ourSelectControl){
|
127
|
+
ourFollowingSibling = parent.childNodes[c+1]
|
128
|
+
break;
|
129
|
+
}
|
130
|
+
parent.removeChild(ourSelectControl);
|
131
|
+
if (ourFollowingSibling)
|
132
|
+
parent.insertBefore(ourSelectControl, ourFollowingSibling);
|
133
|
+
else
|
134
|
+
parent.appendChild(ourSelectControl);
|
135
|
+
|
111
136
|
itemSelectElementHavingNewItemAdded.simulate('change');
|
112
137
|
// Note: we're being lazy. Just setting the value will cause an Ajax
|
113
138
|
// fetch to the server for the item's description. However, we've
|
@@ -115,8 +140,5 @@ function itemCreatePopup_MakeSelection(){
|
|
115
140
|
// interrogating for idNo, name, and title. However, supressing this
|
116
141
|
// fetch would take several lines of code and establish a tight linkage
|
117
142
|
// between here and the on-change logic for <select> elements.
|
118
|
-
|
119
|
-
// close Modalbox
|
120
|
-
Modalbox.hide();
|
121
143
|
}
|
122
144
|
|
@@ -23,7 +23,7 @@
|
|
23
23
|
// the function 'getCurrentType()'
|
24
24
|
|
25
25
|
|
26
|
-
function generateFromTitle(titleInputElem, nameInputElem){
|
26
|
+
function generateFromTitle(titleInputElem, nameInputElem, checkNameFn){
|
27
27
|
var result = false;
|
28
28
|
if (genNameFromTitleOk && titleInputElem.value != null){
|
29
29
|
if (nameInputElem.value == null ||
|
@@ -32,6 +32,8 @@ function generateFromTitle(titleInputElem, nameInputElem){
|
|
32
32
|
|
33
33
|
nameInputElem.value = genNameValue(titleInputElem.value);
|
34
34
|
clearNameUniquenessIndicators();
|
35
|
+
if (checkNameFn)
|
36
|
+
checkNameFn();
|
35
37
|
}
|
36
38
|
return result;
|
37
39
|
}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 1
|
9
|
+
version: 1.0.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Glen E. Ivey
|
@@ -14,22 +14,37 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-28 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
21
|
+
name: rake
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
segments:
|
28
|
-
-
|
29
|
-
-
|
30
|
-
|
28
|
+
- 0
|
29
|
+
- 8
|
30
|
+
- 7
|
31
|
+
version: 0.8.7
|
31
32
|
type: :runtime
|
32
33
|
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: rails
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ~>
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 2
|
43
|
+
- 3
|
44
|
+
- 5
|
45
|
+
version: 2.3.5
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
33
48
|
description: " WontoMedia is a Ruby-on-Rails web app for community creation of\n an information classification scheme. WontoMedia is free\n software (licensed under the AGPL v3), and is being developed by\n a dispersed volunteer team using agile methods.\n"
|
34
49
|
email: gleneivey@wontology.org
|
35
50
|
executables: []
|
@@ -113,6 +128,7 @@ files:
|
|
113
128
|
- config/environments/development.rb
|
114
129
|
- config/environments/production.rb
|
115
130
|
- config/environments/test.rb
|
131
|
+
- config/initializers/extensions.rb
|
116
132
|
- config/initializers/inflections.rb
|
117
133
|
- config/initializers/mime_types.rb
|
118
134
|
- config/initializers/new_rails_defaults.rb
|
@@ -142,6 +158,7 @@ files:
|
|
142
158
|
- doc/README.markdown
|
143
159
|
- doc/README_FOR_APP
|
144
160
|
- doc/customization.markdown
|
161
|
+
- doc/gemlist.txt
|
145
162
|
- doc/scripts/rake-customize.markdown
|
146
163
|
- lib/helpers/connection_helper.rb
|
147
164
|
- lib/helpers/item_helper.rb
|
@@ -269,11 +286,13 @@ require_paths:
|
|
269
286
|
- lib
|
270
287
|
required_ruby_version: !ruby/object:Gem::Requirement
|
271
288
|
requirements:
|
272
|
-
- -
|
289
|
+
- - ~>
|
273
290
|
- !ruby/object:Gem::Version
|
274
291
|
segments:
|
275
|
-
-
|
276
|
-
|
292
|
+
- 1
|
293
|
+
- 8
|
294
|
+
- 7
|
295
|
+
version: 1.8.7
|
277
296
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
278
297
|
requirements:
|
279
298
|
- - ">="
|