iqvoc 3.5.6 → 3.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +9 -0
- data/Gemfile +3 -2
- data/Gemfile.lock +71 -65
- data/README.md +5 -4
- data/app/assets/javascripts/framework.js +1 -1
- data/app/assets/javascripts/iqvoc/entityselect.js.erb +20 -19
- data/app/assets/javascripts/iqvoc/entityselect_qualified.js.erb +45 -0
- data/app/assets/javascripts/iqvoc/iqvoc.js +2 -2
- data/app/assets/javascripts/iqvoc/manifest.js +1 -0
- data/app/assets/stylesheets/framework.css +1 -1
- data/app/assets/stylesheets/iqvoc/iqvoc.css.erb +28 -22
- data/app/controllers/collections/hierarchical_controller.rb +2 -2
- data/app/controllers/collections_controller.rb +0 -1
- data/app/controllers/concepts/alphabetical_controller.rb +0 -1
- data/app/controllers/concepts/hierarchical_controller.rb +0 -1
- data/app/controllers/concepts/untranslated_controller.rb +0 -1
- data/app/controllers/concepts_controller.rb +0 -1
- data/app/controllers/instance_configuration_controller.rb +2 -2
- data/app/controllers/pages_controller.rb +0 -1
- data/app/controllers/rdf_controller.rb +0 -2
- data/app/controllers/search_results_controller.rb +0 -1
- data/app/controllers/user_sessions_controller.rb +5 -4
- data/app/helpers/application_helper.rb +8 -4
- data/app/helpers/widget_helper.rb +39 -0
- data/app/models/collection/base.rb +4 -0
- data/app/models/concept/base.rb +59 -10
- data/app/models/concept/relation/base.rb +20 -0
- data/app/models/concept/relation/reverse_relation_extension.rb +4 -3
- data/app/models/concept/skos/base.rb +1 -1
- data/app/views/collections/_collection.html.erb +5 -0
- data/app/views/concepts/_visualization.html.erb +1 -1
- data/app/views/errors/access_denied.html.erb +6 -2
- data/app/views/layouts/_controls.html.erb +1 -1
- data/app/views/layouts/application.html.erb +2 -3
- data/app/views/pages/about.html.erb +2 -0
- data/app/views/partials/concept/relation/_base.html.erb +1 -1
- data/app/views/partials/concept/relation/_edit_base.html.erb +2 -5
- data/app/views/partials/concept/relation/_edit_ranked.html.erb +13 -0
- data/app/views/partials/concept/relation/_ranked.html.erb +12 -0
- data/app/views/partials/concept/relation/skos/broader/_mono.html.erb +1 -1
- data/app/views/partials/note/_base.html.erb +1 -1
- data/app/views/user_sessions/_form.html.erb +10 -0
- data/app/views/user_sessions/new.html.erb +1 -9
- data/config/application.rb +4 -1
- data/config/database.yml +8 -0
- data/config/initializers/heroku.rb +24 -0
- data/config/initializers/iqvoc.rb +2 -2
- data/config/locales/activerecord.en.yml +1 -1
- data/config/locales/de.yml +1 -3
- data/config/locales/en.yml +1 -3
- data/db/migrate/20101208103531_add_type_to_collection_contents.rb +0 -2
- data/db/migrate/20120326102037_add_rank_to_concept_relations.rb +5 -0
- data/db/schema.rb +12 -1
- data/lib/iqvoc/ability.rb +3 -1
- data/lib/iqvoc/controller_extensions.rb +12 -29
- data/lib/iqvoc/environments/production.rb +2 -0
- data/lib/iqvoc/environments/test.rb +0 -3
- data/lib/iqvoc/{data_helper.rb → inline_data_helper.rb} +1 -3
- data/lib/iqvoc/maker.rb +2 -1
- data/lib/iqvoc/origin.rb +23 -24
- data/lib/iqvoc/rankable.rb +34 -0
- data/lib/iqvoc/version.rb +1 -1
- data/test/factories.rb +1 -1
- data/test/integration/alphabetical_test.rb +2 -1
- data/test/integration/authentication_test.rb +1 -1
- data/test/integration/browse_concepts_and_labels_test.rb +2 -1
- data/test/integration/concept_scheme_test.rb +1 -1
- data/test/integration/edit_concepts_test.rb +1 -1
- data/test/integration/instance_configuration_test.rb +1 -1
- data/test/integration/search_test.rb +6 -5
- data/test/integration/tree_test.rb +1 -1
- data/test/integration/untranslated_test.rb +2 -1
- data/test/integration_test_helper.rb +0 -29
- data/test/unit/concept_test.rb +17 -6
- data/test/unit/hygiene_test.rb +15 -5
- data/test/unit/origin_test.rb +7 -4
- data/vendor/assets/javascripts/{jquery-ui-1.8.16.custom.js → jquery-ui-1.8.20.custom.js} +146 -71
- data/vendor/assets/stylesheets/{jquery-ui-1.8.16.custom.css → jquery-ui-1.8.20.custom.css} +16 -19
- metadata +32 -27
- data/app/views/errors/multiple_choices.html.erb +0 -11
- data/lib/iqvoc/rdf_helper.rb +0 -67
- data/lib/ojdbc14.jar +0 -0
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 3.5.7 (2012-05-24)
|
|
2
|
+
|
|
3
|
+
* Rankable (weighted) relations
|
|
4
|
+
* Counting concept members in collection hierarchy view
|
|
5
|
+
* Improved heroku support
|
|
6
|
+
* Bugfixes
|
|
7
|
+
|
|
8
|
+
Please note that this is the last tiny release before we hit 4.0.0.
|
|
9
|
+
|
|
1
10
|
## 3.5.6 (2012-03-07)
|
|
2
11
|
|
|
3
12
|
* Refactored origin (URI slug) generation<br>
|
data/Gemfile
CHANGED
|
@@ -19,7 +19,7 @@ source 'http://rubygems.org'
|
|
|
19
19
|
# TODO: The following dependencies could be included by the "gemspec" command.
|
|
20
20
|
# There is only one problem: gemspec puts the dependencies automatically to a
|
|
21
21
|
# group (:development by default). This is not what we need.
|
|
22
|
-
gem 'rails', '3.2.
|
|
22
|
+
gem 'rails', '3.2.3'
|
|
23
23
|
|
|
24
24
|
group :assets do
|
|
25
25
|
gem 'uglifier', '>= 1.0.3'
|
|
@@ -55,7 +55,6 @@ group :development, :test do
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
group :test do
|
|
58
|
-
gem 'test-unit'
|
|
59
58
|
gem 'nokogiri', '~> 1.5.0'
|
|
60
59
|
gem 'capybara'
|
|
61
60
|
gem 'capybara-webkit'
|
|
@@ -63,6 +62,8 @@ group :test do
|
|
|
63
62
|
gem 'factory_girl_rails'
|
|
64
63
|
gem 'spork'
|
|
65
64
|
gem 'spork-testunit'
|
|
65
|
+
gem 'turn'
|
|
66
|
+
gem 'minitest'
|
|
66
67
|
end
|
|
67
68
|
|
|
68
69
|
group :production do
|
data/Gemfile.lock
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
GEM
|
|
2
2
|
remote: http://rubygems.org/
|
|
3
3
|
specs:
|
|
4
|
-
actionmailer (3.2.
|
|
5
|
-
actionpack (= 3.2.
|
|
6
|
-
mail (~> 2.4.
|
|
7
|
-
actionpack (3.2.
|
|
8
|
-
activemodel (= 3.2.
|
|
9
|
-
activesupport (= 3.2.
|
|
4
|
+
actionmailer (3.2.3)
|
|
5
|
+
actionpack (= 3.2.3)
|
|
6
|
+
mail (~> 2.4.4)
|
|
7
|
+
actionpack (3.2.3)
|
|
8
|
+
activemodel (= 3.2.3)
|
|
9
|
+
activesupport (= 3.2.3)
|
|
10
10
|
builder (~> 3.0.0)
|
|
11
11
|
erubis (~> 2.7.0)
|
|
12
12
|
journey (~> 1.0.1)
|
|
13
13
|
rack (~> 1.4.0)
|
|
14
|
-
rack-cache (~> 1.
|
|
14
|
+
rack-cache (~> 1.2)
|
|
15
15
|
rack-test (~> 0.6.1)
|
|
16
16
|
sprockets (~> 2.1.2)
|
|
17
|
-
activemodel (3.2.
|
|
18
|
-
activesupport (= 3.2.
|
|
17
|
+
activemodel (3.2.3)
|
|
18
|
+
activesupport (= 3.2.3)
|
|
19
19
|
builder (~> 3.0.0)
|
|
20
|
-
activerecord (3.2.
|
|
21
|
-
activemodel (= 3.2.
|
|
22
|
-
activesupport (= 3.2.
|
|
20
|
+
activerecord (3.2.3)
|
|
21
|
+
activemodel (= 3.2.3)
|
|
22
|
+
activesupport (= 3.2.3)
|
|
23
23
|
arel (~> 3.0.2)
|
|
24
24
|
tzinfo (~> 0.3.29)
|
|
25
25
|
activerecord-jdbc-adapter (1.2.2)
|
|
@@ -30,13 +30,14 @@ GEM
|
|
|
30
30
|
activerecord-jdbc-adapter (~> 1.2.2)
|
|
31
31
|
jdbc-sqlite3 (~> 3.7.2)
|
|
32
32
|
activerecord-oracle_enhanced-adapter (1.4.1)
|
|
33
|
-
activeresource (3.2.
|
|
34
|
-
activemodel (= 3.2.
|
|
35
|
-
activesupport (= 3.2.
|
|
36
|
-
activesupport (3.2.
|
|
33
|
+
activeresource (3.2.3)
|
|
34
|
+
activemodel (= 3.2.3)
|
|
35
|
+
activesupport (= 3.2.3)
|
|
36
|
+
activesupport (3.2.3)
|
|
37
37
|
i18n (~> 0.6)
|
|
38
38
|
multi_json (~> 1.0)
|
|
39
|
-
addressable (2.2.
|
|
39
|
+
addressable (2.2.8)
|
|
40
|
+
ansi (1.4.2)
|
|
40
41
|
arel (3.0.2)
|
|
41
42
|
authlogic (3.1.0)
|
|
42
43
|
activerecord (>= 3.0.7)
|
|
@@ -52,28 +53,28 @@ GEM
|
|
|
52
53
|
rack-test (>= 0.5.4)
|
|
53
54
|
selenium-webdriver (~> 2.0)
|
|
54
55
|
xpath (~> 0.1.4)
|
|
55
|
-
capybara-webkit (0.
|
|
56
|
+
capybara-webkit (0.12.0)
|
|
56
57
|
capybara (>= 1.0.0, < 1.2)
|
|
57
58
|
json
|
|
58
|
-
childprocess (0.3.
|
|
59
|
+
childprocess (0.3.2)
|
|
59
60
|
ffi (~> 1.0.6)
|
|
60
|
-
database_cleaner (0.7.
|
|
61
|
+
database_cleaner (0.7.2)
|
|
61
62
|
erubis (2.7.0)
|
|
62
|
-
execjs (1.
|
|
63
|
+
execjs (1.4.0)
|
|
63
64
|
multi_json (~> 1.0)
|
|
64
|
-
factory_girl (
|
|
65
|
-
activesupport (>=
|
|
66
|
-
factory_girl_rails (
|
|
67
|
-
factory_girl (~>
|
|
65
|
+
factory_girl (3.3.0)
|
|
66
|
+
activesupport (>= 3.0.0)
|
|
67
|
+
factory_girl_rails (3.3.0)
|
|
68
|
+
factory_girl (~> 3.3.0)
|
|
68
69
|
railties (>= 3.0.0)
|
|
69
|
-
fastercsv (1.5.
|
|
70
|
+
fastercsv (1.5.5)
|
|
70
71
|
ffi (1.0.11)
|
|
71
72
|
ffi (1.0.11-java)
|
|
72
|
-
heroku (2.
|
|
73
|
+
heroku (2.25.0)
|
|
73
74
|
launchy (>= 0.3.2)
|
|
75
|
+
netrc (~> 0.7.1)
|
|
74
76
|
rest-client (~> 1.6.1)
|
|
75
77
|
rubyzip
|
|
76
|
-
term-ansicolor (~> 1.0.5)
|
|
77
78
|
hike (1.2.1)
|
|
78
79
|
i18n (0.6.0)
|
|
79
80
|
iq_rdf (0.1.5)
|
|
@@ -84,51 +85,54 @@ GEM
|
|
|
84
85
|
journey (1.0.3)
|
|
85
86
|
jruby-openssl (0.7.6.1)
|
|
86
87
|
bouncy-castle-java (>= 1.5.0146.1)
|
|
87
|
-
json (1.
|
|
88
|
-
json (1.
|
|
89
|
-
json_pure (1.6.5)
|
|
88
|
+
json (1.7.3)
|
|
89
|
+
json (1.7.3-java)
|
|
90
90
|
kaminari (0.13.0)
|
|
91
91
|
actionpack (>= 3.0.0)
|
|
92
92
|
activesupport (>= 3.0.0)
|
|
93
93
|
railties (>= 3.0.0)
|
|
94
|
-
launchy (2.0
|
|
94
|
+
launchy (2.1.0)
|
|
95
95
|
addressable (~> 2.2.6)
|
|
96
|
-
launchy (2.0
|
|
96
|
+
launchy (2.1.0-java)
|
|
97
97
|
addressable (~> 2.2.6)
|
|
98
98
|
ffi (~> 1.0.9)
|
|
99
99
|
spoon (~> 0.0.1)
|
|
100
100
|
libv8 (3.3.10.4)
|
|
101
|
-
|
|
101
|
+
libwebsocket (0.1.3)
|
|
102
|
+
addressable
|
|
103
|
+
mail (2.4.4)
|
|
102
104
|
i18n (>= 0.4.0)
|
|
103
105
|
mime-types (~> 1.16)
|
|
104
106
|
treetop (~> 1.4.8)
|
|
105
|
-
mime-types (1.
|
|
106
|
-
|
|
107
|
+
mime-types (1.18)
|
|
108
|
+
minitest (3.0.0)
|
|
109
|
+
multi_json (1.3.5)
|
|
107
110
|
mysql2 (0.3.11)
|
|
108
|
-
|
|
109
|
-
nokogiri (1.5.
|
|
111
|
+
netrc (0.7.1)
|
|
112
|
+
nokogiri (1.5.2)
|
|
113
|
+
nokogiri (1.5.2-java)
|
|
110
114
|
pg (0.13.2)
|
|
111
115
|
polyglot (0.3.3)
|
|
112
116
|
rack (1.4.1)
|
|
113
|
-
rack-cache (1.
|
|
117
|
+
rack-cache (1.2)
|
|
114
118
|
rack (>= 0.4)
|
|
115
119
|
rack-ssl (1.3.2)
|
|
116
120
|
rack
|
|
117
121
|
rack-test (0.6.1)
|
|
118
122
|
rack (>= 1.0)
|
|
119
|
-
rails (3.2.
|
|
120
|
-
actionmailer (= 3.2.
|
|
121
|
-
actionpack (= 3.2.
|
|
122
|
-
activerecord (= 3.2.
|
|
123
|
-
activeresource (= 3.2.
|
|
124
|
-
activesupport (= 3.2.
|
|
123
|
+
rails (3.2.3)
|
|
124
|
+
actionmailer (= 3.2.3)
|
|
125
|
+
actionpack (= 3.2.3)
|
|
126
|
+
activerecord (= 3.2.3)
|
|
127
|
+
activeresource (= 3.2.3)
|
|
128
|
+
activesupport (= 3.2.3)
|
|
125
129
|
bundler (~> 1.0)
|
|
126
|
-
railties (= 3.2.
|
|
127
|
-
rails_autolink (1.0.
|
|
130
|
+
railties (= 3.2.3)
|
|
131
|
+
rails_autolink (1.0.7)
|
|
128
132
|
rails (~> 3.1)
|
|
129
|
-
railties (3.2.
|
|
130
|
-
actionpack (= 3.2.
|
|
131
|
-
activesupport (= 3.2.
|
|
133
|
+
railties (3.2.3)
|
|
134
|
+
actionpack (= 3.2.3)
|
|
135
|
+
activesupport (= 3.2.3)
|
|
132
136
|
rack-ssl (~> 1.3.2)
|
|
133
137
|
rake (>= 0.8.7)
|
|
134
138
|
rdoc (~> 3.4)
|
|
@@ -138,32 +142,33 @@ GEM
|
|
|
138
142
|
json (~> 1.4)
|
|
139
143
|
rest-client (1.6.7)
|
|
140
144
|
mime-types (>= 1.16)
|
|
141
|
-
rubyzip (0.9.
|
|
142
|
-
selenium-webdriver (2.
|
|
143
|
-
childprocess (>= 0.2.
|
|
144
|
-
ffi (~> 1.0
|
|
145
|
-
|
|
145
|
+
rubyzip (0.9.8)
|
|
146
|
+
selenium-webdriver (2.21.2)
|
|
147
|
+
childprocess (>= 0.2.5)
|
|
148
|
+
ffi (~> 1.0)
|
|
149
|
+
libwebsocket (~> 0.1.3)
|
|
150
|
+
multi_json (~> 1.0)
|
|
146
151
|
rubyzip
|
|
147
152
|
spoon (0.0.1)
|
|
148
|
-
spork (0.9.
|
|
153
|
+
spork (0.9.2)
|
|
149
154
|
spork-testunit (0.0.8)
|
|
150
155
|
spork (>= 0.6.0)
|
|
151
|
-
sprockets (2.1.
|
|
156
|
+
sprockets (2.1.3)
|
|
152
157
|
hike (~> 1.2)
|
|
153
158
|
rack (~> 1.0)
|
|
154
159
|
tilt (~> 1.1, != 1.3.0)
|
|
155
|
-
sqlite3 (1.3.
|
|
156
|
-
|
|
157
|
-
test-unit (2.4.7)
|
|
158
|
-
therubyracer (0.9.10)
|
|
160
|
+
sqlite3 (1.3.6)
|
|
161
|
+
therubyracer (0.10.1)
|
|
159
162
|
libv8 (~> 3.3.10)
|
|
160
163
|
thor (0.14.6)
|
|
161
164
|
tilt (1.3.3)
|
|
162
165
|
treetop (1.4.10)
|
|
163
166
|
polyglot
|
|
164
167
|
polyglot (>= 0.3.1)
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
turn (0.9.5)
|
|
169
|
+
ansi
|
|
170
|
+
tzinfo (0.3.33)
|
|
171
|
+
uglifier (1.2.4)
|
|
167
172
|
execjs (>= 0.3.0)
|
|
168
173
|
multi_json (>= 1.0.2)
|
|
169
174
|
view_marker (1.0.0)
|
|
@@ -192,15 +197,16 @@ DEPENDENCIES
|
|
|
192
197
|
jruby-openssl
|
|
193
198
|
json
|
|
194
199
|
kaminari
|
|
200
|
+
minitest
|
|
195
201
|
mysql2
|
|
196
202
|
nokogiri (~> 1.5.0)
|
|
197
203
|
pg
|
|
198
|
-
rails (= 3.2.
|
|
204
|
+
rails (= 3.2.3)
|
|
199
205
|
rails_autolink
|
|
200
206
|
spork
|
|
201
207
|
spork-testunit
|
|
202
208
|
sqlite3
|
|
203
|
-
test-unit
|
|
204
209
|
therubyracer
|
|
210
|
+
turn
|
|
205
211
|
uglifier (>= 1.0.3)
|
|
206
212
|
view_marker
|
data/README.md
CHANGED
|
@@ -30,12 +30,12 @@ To run iQvoc on heroku do the following:
|
|
|
30
30
|
|
|
31
31
|
```
|
|
32
32
|
bundle install
|
|
33
|
-
heroku create
|
|
33
|
+
bundle exec heroku create --stack bamboo
|
|
34
34
|
bundle exec rake heroku:config
|
|
35
35
|
git push heroku master
|
|
36
|
-
heroku rake db:migrate
|
|
37
|
-
heroku rake db:seed
|
|
38
|
-
heroku restart
|
|
36
|
+
bundle exec heroku rake db:migrate
|
|
37
|
+
bundle exec heroku rake db:seed
|
|
38
|
+
bundle exec heroku restart
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
`heroku open` opens your app in the browser.
|
|
@@ -95,4 +95,5 @@ iQvoc was originally created and is being maintained by [innoQ Deutschland GmbH]
|
|
|
95
95
|
## License
|
|
96
96
|
|
|
97
97
|
Copyright 2011 innoQ Deutschland GmbH
|
|
98
|
+
|
|
98
99
|
Licensed under the Apache License, Version 2.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*jslint vars: true, unparam: true */
|
|
1
|
+
/*jslint vars: true, unparam: true, white: true */
|
|
2
2
|
/*global jQuery, IQVOC */
|
|
3
3
|
|
|
4
4
|
IQVOC.EntitySelector = (function($) {
|
|
@@ -6,8 +6,8 @@ IQVOC.EntitySelector = (function($) {
|
|
|
6
6
|
"use strict";
|
|
7
7
|
|
|
8
8
|
var EntitySelector = function(node) {
|
|
9
|
-
if(
|
|
10
|
-
return
|
|
9
|
+
if(arguments.length === 0) { // subclassing; skip initialization
|
|
10
|
+
return;
|
|
11
11
|
}
|
|
12
12
|
this.el = $(node).hide(); // XXX: rename
|
|
13
13
|
this.container = $('<div class="entity_select" />').data("widget", this);
|
|
@@ -23,15 +23,16 @@ var EntitySelector = function(node) {
|
|
|
23
23
|
});
|
|
24
24
|
selection = $('<ul class="entity_list" />').append(selection);
|
|
25
25
|
|
|
26
|
-
var exclude = this.el.data("exclude") || null
|
|
27
|
-
|
|
26
|
+
var exclude = this.el.data("exclude") || null,
|
|
27
|
+
img = $('<img class="hidden" />').
|
|
28
|
+
attr("src", "<%= asset_path('spinner.gif') %>");
|
|
28
29
|
this.input = $("<input />").autocomplete({
|
|
29
30
|
minLength: 3,
|
|
30
31
|
source: function(req, callback) {
|
|
31
32
|
var uri = self.el.data("query-url");
|
|
32
33
|
$.getJSON(uri, { query: req.term }, function(data, status, xhr) { // TODO: error handling
|
|
33
|
-
var excludes = self.getSelection()
|
|
34
|
-
|
|
34
|
+
var excludes = self.getSelection().
|
|
35
|
+
concat(exclude ? [exclude] : []);
|
|
35
36
|
data = $.map(data, function(entity, i) {
|
|
36
37
|
return $.inArray(entity.id, excludes) !== -1 ? null :
|
|
37
38
|
{ value: entity.id, label: entity.name };
|
|
@@ -46,8 +47,8 @@ var EntitySelector = function(node) {
|
|
|
46
47
|
select: this.onSelect
|
|
47
48
|
});
|
|
48
49
|
|
|
49
|
-
this.container.append(this.input).append(img).append(selection)
|
|
50
|
-
|
|
50
|
+
this.container.append(this.input).append(img).append(selection).
|
|
51
|
+
insertAfter(node).prepend(node);
|
|
51
52
|
|
|
52
53
|
if(this.singular && this.entities.length) {
|
|
53
54
|
this.input.hide();
|
|
@@ -55,11 +56,11 @@ var EntitySelector = function(node) {
|
|
|
55
56
|
};
|
|
56
57
|
$.extend(EntitySelector.prototype, {
|
|
57
58
|
onSelect: function(ev, ui) {
|
|
58
|
-
var el = $(this).val("")
|
|
59
|
-
|
|
59
|
+
var el = $(this).val(""),
|
|
60
|
+
widget = el.closest(".entity_select").data("widget");
|
|
60
61
|
if(widget.add(ui.item.value)) {
|
|
61
|
-
var entity = widget
|
|
62
|
-
|
|
62
|
+
var entity = widget.
|
|
63
|
+
createEntity({ id: ui.item.value, name: ui.item.label });
|
|
63
64
|
widget.container.find("ul").append(entity);
|
|
64
65
|
if(widget.singular) {
|
|
65
66
|
widget.input.hide();
|
|
@@ -68,9 +69,9 @@ $.extend(EntitySelector.prototype, {
|
|
|
68
69
|
return false;
|
|
69
70
|
},
|
|
70
71
|
onDelete: function(ev) {
|
|
71
|
-
var el = $(this)
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
var el = $(this),
|
|
73
|
+
entity = el.closest("li"),
|
|
74
|
+
widget = el.closest(".entity_select").data("widget");
|
|
74
75
|
widget.remove(entity.data("id"));
|
|
75
76
|
entity.remove();
|
|
76
77
|
if(widget.singular && !widget.entities.length) {
|
|
@@ -86,9 +87,9 @@ $.extend(EntitySelector.prototype, {
|
|
|
86
87
|
} else {
|
|
87
88
|
el = $('<span />').text(entity.name);
|
|
88
89
|
}
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
return $("<li />").data("id", entity.id).append(el).append(
|
|
90
|
+
var delBtn = $('<a href="javascript:;" class="btn">x</a>'). // "btn" to avoid fancy "button" class -- XXX: hacky workaround!?
|
|
91
|
+
click(this.onDelete);
|
|
92
|
+
return $("<li />").data("id", entity.id).append(el).append(delBtn)[0];
|
|
92
93
|
},
|
|
93
94
|
add: function(entity) {
|
|
94
95
|
if($.inArray(entity, this.entities) === -1) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// EntitySelector extension for qualified entities
|
|
2
|
+
|
|
3
|
+
/*jslint vars: true, unparam: true, white: true */
|
|
4
|
+
/*global jQuery, IQVOC */
|
|
5
|
+
|
|
6
|
+
IQVOC.QualifiedEntitySelector = (function($) {
|
|
7
|
+
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
var QES = function(args) {
|
|
11
|
+
var res = IQVOC.EntitySelector.apply(this, arguments);
|
|
12
|
+
if(this.qualified()) {
|
|
13
|
+
this.container.on("change", "input.qualified", this.onQualify);
|
|
14
|
+
}
|
|
15
|
+
return res;
|
|
16
|
+
};
|
|
17
|
+
QES.prototype = new IQVOC.EntitySelector();
|
|
18
|
+
|
|
19
|
+
QES.prototype.qualified = function() { // TODO: document (NB: doubles as i18n)
|
|
20
|
+
return this.el.data("qualified") || false;
|
|
21
|
+
};
|
|
22
|
+
QES.prototype.onQualify = function(ev) {
|
|
23
|
+
var el = $(this),
|
|
24
|
+
entity = el.closest("li"),
|
|
25
|
+
widget = el.closest(".entity_select").data("widget"),
|
|
26
|
+
id = entity.data("id"),
|
|
27
|
+
value = id + ":" + el.val();
|
|
28
|
+
widget.remove(id);
|
|
29
|
+
widget.add(value);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
QES.prototype.createEntity = function(entity) {
|
|
33
|
+
var node = IQVOC.EntitySelector.prototype.createEntity.apply(this, arguments),
|
|
34
|
+
qualified = this.qualified();
|
|
35
|
+
if(qualified) {
|
|
36
|
+
var el = $(node);
|
|
37
|
+
$('<input class="qualified" />').attr("placeholder", qualified).
|
|
38
|
+
val(entity[qualified]).insertAfter(el.children(":first"));
|
|
39
|
+
}
|
|
40
|
+
return node;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return QES;
|
|
44
|
+
|
|
45
|
+
}(jQuery));
|
|
@@ -123,7 +123,7 @@ return {
|
|
|
123
123
|
jQuery(document).ready(function($) {
|
|
124
124
|
"use strict";
|
|
125
125
|
|
|
126
|
-
var locale =
|
|
126
|
+
var locale = document.documentElement.getAttribute("lang");
|
|
127
127
|
|
|
128
128
|
IQVOC.enhancedDropdown(".menu");
|
|
129
129
|
IQVOC.dynamicAuth("#auth_controls");
|
|
@@ -188,7 +188,7 @@ jQuery(document).ready(function($) {
|
|
|
188
188
|
|
|
189
189
|
// entity selection (edit mode)
|
|
190
190
|
$("input.entity_select").each(function(i, node) {
|
|
191
|
-
IQVOC.
|
|
191
|
+
new IQVOC.QualifiedEntitySelector(node);
|
|
192
192
|
});
|
|
193
193
|
|
|
194
194
|
// hide broader relations for top terms (mutually exclusive in mono hierarchies)
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
#header h1 {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
color: #000;
|
|
12
|
+
font-weight: bold;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
ul#navi_main {
|
|
@@ -82,40 +82,41 @@ ul.letter_selector { width: 100%; overflow: auto; margin: 0 0 10px; padding: 0;
|
|
|
82
82
|
/* visualizations */
|
|
83
83
|
|
|
84
84
|
.sections {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
overflow: hidden; /* block formatting context */
|
|
86
|
+
zoom: 1; /* hasLayout */
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
.infovis,
|
|
89
90
|
#infovis {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
float: right;
|
|
92
|
+
width: 300px;
|
|
93
|
+
height: 300px;
|
|
94
|
+
overflow: hidden;
|
|
95
|
+
margin: 0 0 10px 10px;
|
|
96
|
+
border: 1px solid #EEE;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
#infovis .button {
|
|
99
|
-
|
|
100
|
+
float: right;
|
|
100
101
|
}
|
|
101
102
|
|
|
102
103
|
#infovis .concept a {
|
|
103
|
-
|
|
104
|
+
color: #000;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
#infovis.filtered .concept {
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
overflow: visible;
|
|
109
|
+
color: #111;
|
|
109
110
|
}
|
|
110
111
|
|
|
111
112
|
#infovis .label {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
padding: 0 2px;
|
|
114
|
+
color: #111;
|
|
115
|
+
background-color: #EEE;
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
#infovis-label .label {
|
|
118
|
-
|
|
119
|
+
font-size: 0.8em;
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
/* ######################################## */
|
|
@@ -142,7 +143,7 @@ ul.letter_selector { width: 100%; overflow: auto; margin: 0 0 10px; padding: 0;
|
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
#controls a {
|
|
145
|
-
|
|
146
|
+
color: #EEE;
|
|
146
147
|
}
|
|
147
148
|
|
|
148
149
|
#controls ul {
|
|
@@ -155,7 +156,7 @@ ul.letter_selector { width: 100%; overflow: auto; margin: 0 0 10px; padding: 0;
|
|
|
155
156
|
|
|
156
157
|
#controls ul a {
|
|
157
158
|
display: inline;
|
|
158
|
-
|
|
159
|
+
color: #000;
|
|
159
160
|
}
|
|
160
161
|
|
|
161
162
|
#controls h3 {
|
|
@@ -330,8 +331,8 @@ input[type=submit]:active, button:active, a.button:active {
|
|
|
330
331
|
}
|
|
331
332
|
|
|
332
333
|
#abstract_uri img {
|
|
333
|
-
|
|
334
|
-
|
|
334
|
+
vertical-align: middle;
|
|
335
|
+
border: none;
|
|
335
336
|
}
|
|
336
337
|
|
|
337
338
|
#untranslated {
|
|
@@ -454,6 +455,11 @@ fieldset .note_annotations {
|
|
|
454
455
|
margin-left: -20px; /* move into adjacent INPUT */
|
|
455
456
|
}
|
|
456
457
|
|
|
458
|
+
.entity_select input.qualified {
|
|
459
|
+
width: 5em;
|
|
460
|
+
margin-left: 0.5em;
|
|
461
|
+
}
|
|
462
|
+
|
|
457
463
|
tr.hover {
|
|
458
464
|
cursor: pointer;
|
|
459
465
|
background-color: #C0FAB4;
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
17
|
class Collections::HierarchicalController < CollectionsController
|
|
18
|
-
skip_before_filter :require_user # This is public for everyone
|
|
19
18
|
|
|
20
19
|
def index
|
|
21
20
|
authorize! :read, Iqvoc::Collection.base_class
|
|
@@ -33,7 +32,8 @@ class Collections::HierarchicalController < CollectionsController
|
|
|
33
32
|
:id => collection.id,
|
|
34
33
|
:url => collection_path(:id => collection, :format => :html),
|
|
35
34
|
:text => CGI.escapeHTML(collection.pref_label.to_s),
|
|
36
|
-
:hasChildren => collection.subcollections.any
|
|
35
|
+
:hasChildren => collection.subcollections.any?,
|
|
36
|
+
:additionalText => " (#{collection.additional_info})"
|
|
37
37
|
}
|
|
38
38
|
end
|
|
39
39
|
render :json => children.to_json
|
|
@@ -79,10 +79,10 @@ class InstanceConfigurationController < ApplicationController
|
|
|
79
79
|
unless default_value.is_a? Array
|
|
80
80
|
return convert_value(str, default_value.class)
|
|
81
81
|
else
|
|
82
|
-
return str.blank? ? [] : str.parse_csv.map
|
|
82
|
+
return str.blank? ? [] : str.parse_csv.map do |item|
|
|
83
83
|
item.strip!
|
|
84
84
|
convert_value(item, default_value[0].class)
|
|
85
|
-
|
|
85
|
+
end
|
|
86
86
|
end
|
|
87
87
|
end
|
|
88
88
|
|