iqvoc 3.5.3 → 3.5.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +11 -2
- data/Gemfile +4 -6
- data/Gemfile.lock +4 -31
- data/README.md +1 -1
- data/app/assets/javascripts/iqvoc/iqvoc.js +10 -2
- data/app/controllers/application_controller.rb +1 -1
- data/app/controllers/collections_controller.rb +5 -5
- data/app/controllers/concepts/versions_controller.rb +1 -1
- data/app/controllers/concepts_controller.rb +7 -8
- data/app/controllers/dashboard_controller.rb +1 -1
- data/app/controllers/instance_configuration_controller.rb +8 -2
- data/app/controllers/rdf_controller.rb +19 -9
- data/app/controllers/user_sessions_controller.rb +1 -1
- data/app/helpers/application_helper.rb +19 -0
- data/app/helpers/dashboard_helper.rb +2 -2
- data/app/helpers/rdf_helper.rb +3 -1
- data/app/helpers/search_results_helper.rb +1 -1
- data/app/models/collection/member/base.rb +1 -1
- data/app/models/concept/base.rb +32 -10
- data/app/models/concept/skos/scheme.rb +46 -0
- data/app/models/labeling/skos/base.rb +3 -3
- data/app/models/note/skos/base.rb +1 -1
- data/app/models/note/skos/change_note.rb +2 -2
- data/app/models/search_extension.rb +1 -1
- data/app/models/user.rb +1 -1
- data/app/views/concepts/_base_data.html.erb +8 -0
- data/app/views/concepts/index.iqrdf +5 -5
- data/app/views/layouts/application.html.erb +3 -1
- data/app/views/partials/concept/relation/_edit_base.html.erb +2 -2
- data/app/views/partials/concept/relation/skos/broader/_mono.html.erb +4 -1
- data/app/views/partials/concept/relation/skos/broader/_poly.html.erb +5 -1
- data/app/views/rdf/scheme.iqrdf +9 -0
- data/config/application.rb +1 -1
- data/config/engine.rb +4 -4
- data/config/initializers/secret_token_configurator.rb +2 -2
- data/config/locales/activerecord.de.yml +13 -0
- data/config/locales/activerecord.en.yml +13 -0
- data/config/locales/de.yml +3 -0
- data/config/locales/en.yml +3 -0
- data/config/routes.rb +3 -2
- data/db/migrate/20120201120736_add_top_term_to_concepts.rb +7 -0
- data/db/schema.rb +2 -1
- data/iqvoc.gemspec +1 -1
- data/lib/debug.rb +34 -8
- data/lib/iqvoc/ability.rb +1 -2
- data/lib/iqvoc/configuration/collection.rb +2 -2
- data/lib/iqvoc/configuration/concept.rb +10 -5
- data/lib/iqvoc/configuration/core.rb +45 -8
- data/lib/iqvoc/configuration/label.rb +1 -1
- data/lib/iqvoc/controller_extensions.rb +3 -2
- data/lib/iqvoc/version.rb +1 -1
- data/lib/iqvoc.rb +1 -1
- data/lib/tasks/heroku.rake +2 -2
- data/test/factories.rb +2 -1
- data/test/integration/concept_scheme_test.rb +38 -0
- data/test/integration/search_test.rb +4 -4
- data/test/integration/tree_test.rb +4 -2
- data/test/integration_test_helper.rb +7 -5
- data/test/unit/concept_test.rb +1 -1
- data/test/unit/instance_configuration_test.rb +7 -7
- data/test/unit/skos_import_test.rb +2 -2
- metadata +23 -185
- data/app/views/layouts/_navigation.html.erb +0 -32
- data/config/blazing.rb +0 -36
- data/public/assets/ajax-loader-5c1bf2208bffabddfb583013023b2b11.gif +0 -0
- data/public/assets/ajax-loader.gif +0 -0
- data/public/assets/arrow_down-e1f4aacd91274ce8d4db40d8b4ad781f.gif +0 -0
- data/public/assets/arrow_down.gif +0 -0
- data/public/assets/arrow_up-a48d7a55002e97f1b70e0e957edf3964.gif +0 -0
- data/public/assets/arrow_up.gif +0 -0
- data/public/assets/back-ffd41b7924770324ead91a4eb51604f6.png +0 -0
- data/public/assets/back.png +0 -0
- data/public/assets/blueprint/ie-d2ff4b1cc209dc6b08716b5e0098e106.css +0 -36
- data/public/assets/blueprint/ie-d2ff4b1cc209dc6b08716b5e0098e106.css.gz +0 -0
- data/public/assets/blueprint/ie.css +0 -36
- data/public/assets/blueprint/ie.css.gz +0 -0
- data/public/assets/blueprint/print-799a53ff649d9f14baf5f5fe643d04c4.css +0 -30
- data/public/assets/blueprint/print-799a53ff649d9f14baf5f5fe643d04c4.css.gz +0 -0
- data/public/assets/blueprint/print.css +0 -30
- data/public/assets/blueprint/print.css.gz +0 -0
- data/public/assets/blueprint/screen-d721f98ceac371a9294fc6f091ca1cb5.css +0 -259
- data/public/assets/blueprint/screen-d721f98ceac371a9294fc6f091ca1cb5.css.gz +0 -0
- data/public/assets/blueprint/screen.css +0 -259
- data/public/assets/blueprint/screen.css.gz +0 -0
- data/public/assets/branch-c950c8ac69ee2f753f86a75d944aa976.png +0 -0
- data/public/assets/branch.png +0 -0
- data/public/assets/categ-e1e1a5958017a5586456895785298c89.png +0 -0
- data/public/assets/categ.png +0 -0
- data/public/assets/categ_open-de616238db93a0645b4c4a2cdd4eece4.png +0 -0
- data/public/assets/categ_open.png +0 -0
- data/public/assets/excanvas-1f8c36f3578409126862b5c17e59b9bd.js +0 -14
- data/public/assets/excanvas-1f8c36f3578409126862b5c17e59b9bd.js.gz +0 -0
- data/public/assets/excanvas.js +0 -14
- data/public/assets/excanvas.js.gz +0 -0
- data/public/assets/file-48364459f087292aafa11168442bde71.gif +0 -0
- data/public/assets/file.gif +0 -0
- data/public/assets/folder-7e0f370ab3fcca5deab89784db42da4a.gif +0 -0
- data/public/assets/folder-closed-cb6c847cac4dea2cb59c98ecfc76b8ae.gif +0 -0
- data/public/assets/folder-closed.gif +0 -0
- data/public/assets/folder.gif +0 -0
- data/public/assets/footer-ea48e7e96122c8ab345da8ff67f29838.png +0 -0
- data/public/assets/footer.png +0 -0
- data/public/assets/go_there-ee7df641e73ef83e43180dbc07c40540.png +0 -0
- data/public/assets/go_there.png +0 -0
- data/public/assets/header_long-5c7970b5911f94433a696ae87918ecb0.png +0 -0
- data/public/assets/header_long.png +0 -0
- data/public/assets/iqvoc/ie_fixes-7797396e9cd2f32961f56af18bacd33a.css +0 -7
- data/public/assets/iqvoc/ie_fixes-7797396e9cd2f32961f56af18bacd33a.css.gz +0 -0
- data/public/assets/iqvoc/ie_fixes.css +0 -7
- data/public/assets/iqvoc/ie_fixes.css.gz +0 -0
- data/public/assets/iqvoc/visualization-49b198ac7d8bc15fa13eafc528e96081.js +0 -4
- data/public/assets/iqvoc/visualization-49b198ac7d8bc15fa13eafc528e96081.js.gz +0 -0
- data/public/assets/iqvoc/visualization.js +0 -4
- data/public/assets/iqvoc/visualization.js.gz +0 -0
- data/public/assets/iqvoc-ff2c5252d9877c38297164984d4a7a55.png +0 -0
- data/public/assets/iqvoc.png +0 -0
- data/public/assets/jit_rgraph-63bc6fa01820d73bb4076f2f62493e66.js +0 -25
- data/public/assets/jit_rgraph-63bc6fa01820d73bb4076f2f62493e66.js.gz +0 -0
- data/public/assets/jit_rgraph.js +0 -25
- data/public/assets/jit_rgraph.js.gz +0 -0
- data/public/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100-951e2a65945b93d3f69c1994e5672f39.png +0 -0
- data/public/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/public/assets/jquery-ui/ui-bg_flat_55_fbec88_40x100-befbc2de63b9556a093c0a5bb2e08a95.png +0 -0
- data/public/assets/jquery-ui/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_75_d0e5f5_1x400-faa3341c6543985d2c94bd65e36bd6d8.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_85_dfeffc_1x400-df1d30b336ee1530edc334458abd2417.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_95_fef1ec_1x400-5767880afddd9b98f4b4cfd43a09947b.png +0 -0
- data/public/assets/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/public/assets/jquery-ui/ui-bg_gloss-wave_55_5c9ccc_500x100-c563cdeeac0f1479b69e36b21d785ac4.png +0 -0
- data/public/assets/jquery-ui/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/public/assets/jquery-ui/ui-bg_inset-hard_100_f5f8f9_1x100-b837a3b8315a7ff270664ce469f2e6d7.png +0 -0
- data/public/assets/jquery-ui/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/public/assets/jquery-ui/ui-bg_inset-hard_100_fcfdfd_1x100-b5d3cda0e6142534937f71cf4438e28a.png +0 -0
- data/public/assets/jquery-ui/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/public/assets/jquery-ui/ui-icons_217bc0_256x240-14e62c24f88d00f227d88e5b16406eec.png +0 -0
- data/public/assets/jquery-ui/ui-icons_217bc0_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_2e83ff_256x240-c15e521f58d397c2fa31f4214f92a399.png +0 -0
- data/public/assets/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_469bdd_256x240-aceccf3311e1b369e71a4ac629953d61.png +0 -0
- data/public/assets/jquery-ui/ui-icons_469bdd_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_6da8d5_256x240-18148340aba4ce354c9d52c5aa2f5c0c.png +0 -0
- data/public/assets/jquery-ui/ui-icons_6da8d5_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240-279edbd373e73b1ecd1ea7a6ba19750d.png +0 -0
- data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_d8e7f3_256x240-732b446e2e1d4f4fec4277e2632a9adf.png +0 -0
- data/public/assets/jquery-ui/ui-icons_d8e7f3_256x240.png +0 -0
- data/public/assets/jquery-ui/ui-icons_f9bd01_256x240-1ee933e5956743f5607f2075ed21fac5.png +0 -0
- data/public/assets/jquery-ui/ui-icons_f9bd01_256x240.png +0 -0
- data/public/assets/json2-fdda51ffce29dd4cb684dc7bd0aede01.js +0 -157
- data/public/assets/json2-fdda51ffce29dd4cb684dc7bd0aede01.js.gz +0 -0
- data/public/assets/json2.js +0 -157
- data/public/assets/json2.js.gz +0 -0
- data/public/assets/leaf_end-2ac151e8d7b4928bacb557f96cb5b517.png +0 -0
- data/public/assets/leaf_end.png +0 -0
- data/public/assets/leaf_end_filled-cdb0eb9ce60425bf0a1fd12226e502eb.png +0 -0
- data/public/assets/leaf_end_filled.png +0 -0
- data/public/assets/leaf_mid-966f99acaeaddfaedb6b602eb1eed7e0.png +0 -0
- data/public/assets/leaf_mid.png +0 -0
- data/public/assets/leaf_mid_filled-fecf059c72a649fe77052a886fb030d5.png +0 -0
- data/public/assets/leaf_mid_filled.png +0 -0
- data/public/assets/leaf_nothing-e8b5532117e55a184d93e8bf66afa20a.png +0 -0
- data/public/assets/leaf_nothing.png +0 -0
- data/public/assets/leaf_only-e4fe523e451ad9dea6bba08b44cf8039.png +0 -0
- data/public/assets/leaf_only.png +0 -0
- data/public/assets/leaf_only_filled-7b9a97903759b89facd5fb2e03ba14d1.png +0 -0
- data/public/assets/leaf_only_filled.png +0 -0
- data/public/assets/leaf_top-61fbce4d3adf2235964e828647a52149.png +0 -0
- data/public/assets/leaf_top.png +0 -0
- data/public/assets/leaf_top_filled-003d96425167d3b74e63eb75e12d163e.png +0 -0
- data/public/assets/leaf_top_filled.png +0 -0
- data/public/assets/manifest-c08ebf92c2ea89fbce8705f984a7c604.css +0 -1139
- data/public/assets/manifest-c08ebf92c2ea89fbce8705f984a7c604.css.gz +0 -0
- data/public/assets/manifest-c6d880245ce63929a5842e48cb7c65f2.js +0 -21
- data/public/assets/manifest-c6d880245ce63929a5842e48cb7c65f2.js.gz +0 -0
- data/public/assets/manifest.css +0 -1139
- data/public/assets/manifest.css.gz +0 -0
- data/public/assets/manifest.js +0 -21
- data/public/assets/manifest.js.gz +0 -0
- data/public/assets/manifest.yml +0 -73
- data/public/assets/minus-633f45b71e7552c36214c9d81fce94b0.gif +0 -0
- data/public/assets/minus.gif +0 -0
- data/public/assets/nothing-19b9650c540a8776b047d6dde27687b0.png +0 -0
- data/public/assets/nothing.png +0 -0
- data/public/assets/ok-96195c6d50075a63cbdfa11818301f56.png +0 -0
- data/public/assets/ok.png +0 -0
- data/public/assets/plus-dd3920a86d5ea72497854d875c6afc00.gif +0 -0
- data/public/assets/plus.gif +0 -0
- data/public/assets/rdf_flyer-b2cc2d8b2a537a9c74b39450f8e6b16f.gif +0 -0
- data/public/assets/rdf_flyer.gif +0 -0
- data/public/assets/red_arrow-875d1bca1c4b97ec82635af86032a024.png +0 -0
- data/public/assets/red_arrow.png +0 -0
- data/public/assets/shadow-2975795dc944082531617a0c3ad2da70.png +0 -0
- data/public/assets/shadow.png +0 -0
- data/public/assets/spinner-0b76e32ff4e68b1e8789b4d0fe991cd7.gif +0 -0
- data/public/assets/spinner.gif +0 -0
- data/public/assets/tokenizer_delete-94c9b41ce566e499de2090b552e0d167.png +0 -0
- data/public/assets/tokenizer_delete.png +0 -0
- data/public/assets/tokenizer_pencile-b508830af36466f05620d83c544b22ff.png +0 -0
- data/public/assets/tokenizer_pencile.png +0 -0
- data/public/assets/tokenizer_show-152443b9a6c0b058cfb51c51f567116f.png +0 -0
- data/public/assets/tokenizer_show.png +0 -0
- data/public/assets/top_01-fab0825c0529e87fddf883074490dc19.png +0 -0
- data/public/assets/top_01.png +0 -0
- data/public/assets/treeview-black-116394dbf5afda75949a9925de790795.gif +0 -0
- data/public/assets/treeview-black-line-142d898d1f095b3cec1a5dd204daae0d.gif +0 -0
- data/public/assets/treeview-black-line.gif +0 -0
- data/public/assets/treeview-black.gif +0 -0
- data/public/assets/treeview-default-01747815c9007458fc391092548255f8.gif +0 -0
- data/public/assets/treeview-default-line-9aecef4278b9e684f18f3c52e3607f80.gif +0 -0
- data/public/assets/treeview-default-line.gif +0 -0
- data/public/assets/treeview-default.gif +0 -0
- data/public/assets/treeview-famfamfam-c5f86a8a52aa48e87b4bd58878c81ad8.gif +0 -0
- data/public/assets/treeview-famfamfam-line-897ce097b7d84700985608f22e2403c3.gif +0 -0
- data/public/assets/treeview-famfamfam-line.gif +0 -0
- data/public/assets/treeview-famfamfam.gif +0 -0
- data/public/assets/treeview-gray-56089927c44332a8375be41ab13130c8.gif +0 -0
- data/public/assets/treeview-gray-line-d4be395725623b1f39a0964fa479774e.gif +0 -0
- data/public/assets/treeview-gray-line.gif +0 -0
- data/public/assets/treeview-gray.gif +0 -0
- data/public/assets/treeview-red-cb4ed4e5654d76aef755e5c55b63e91c.gif +0 -0
- data/public/assets/treeview-red-line-fdf843bbfba11d00897c7971dff7e806.gif +0 -0
- data/public/assets/treeview-red-line.gif +0 -0
- data/public/assets/treeview-red.gif +0 -0
- data/public/assets/trunk-5686782333e8b4c7e4468c452fb52cec.png +0 -0
- data/public/assets/trunk.png +0 -0
- data/public/assets/unfinished-1cb6bae22a5b855f4b51cb03a1cce928.png +0 -0
- data/public/assets/unfinished.png +0 -0
data/app/models/user.rb
CHANGED
@@ -45,6 +45,14 @@
|
|
45
45
|
:concept => @concept, :klass => Iqvoc::Concept.broader_relation_class.narrower_class %>
|
46
46
|
<%- end -%>
|
47
47
|
|
48
|
+
<li>
|
49
|
+
<label>
|
50
|
+
<%= f.check_box "top_term",
|
51
|
+
:class => ("exclusive" if Iqvoc::Concept.broader_relation_class.singular?) %>
|
52
|
+
<%= f.object.class.human_attribute_name("top_term") %>
|
53
|
+
</label>
|
54
|
+
</li>
|
55
|
+
|
48
56
|
<%= render Iqvoc::Concept.broader_relation_class.edit_partial_name(@concept),
|
49
57
|
:concept => @concept, :klass => Iqvoc::Concept.broader_relation_class %>
|
50
58
|
|
@@ -7,22 +7,22 @@ while true
|
|
7
7
|
# The following code doesn't have much to do with MVC programming. Due to the
|
8
8
|
# fact you can't render a view from a controller multiple times we had to
|
9
9
|
# move the logic to the view.
|
10
|
-
|
10
|
+
|
11
11
|
concepts = Iqvoc::Concept.base_class.published.order("id").limit(100).offset(offset).all
|
12
12
|
break if concepts.size == 0
|
13
13
|
|
14
14
|
# When in single query mode, AR handles ALL includes to be loaded by that
|
15
15
|
# one query. We don't want that! So let's do it manually :-)
|
16
|
-
ActiveRecord::Associations::Preloader.new(concepts,
|
16
|
+
ActiveRecord::Associations::Preloader.new(concepts,
|
17
17
|
Iqvoc::Concept.base_class.default_includes + [
|
18
|
-
:matches,
|
19
|
-
:collection_members,
|
18
|
+
:matches,
|
19
|
+
:collection_members,
|
20
20
|
{:relations => :target, :labelings => :target, :notes => :annotations}]).run
|
21
21
|
|
22
22
|
concepts.each do |concept|
|
23
23
|
render_concept(document, concept)
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
offset+= concepts.size # Size is important!
|
27
27
|
|
28
28
|
end
|
@@ -25,7 +25,9 @@
|
|
25
25
|
<div class="container">
|
26
26
|
<div id="header" class="span-24 last">
|
27
27
|
<%= render :partial => 'layouts/header' %>
|
28
|
-
|
28
|
+
<ul id="navi_main">
|
29
|
+
<%= nav_items(Iqvoc.navigation_items) %>
|
30
|
+
</ul>
|
29
31
|
</div>
|
30
32
|
|
31
33
|
<div id="navi_sub" class="span-24 last">
|
@@ -5,10 +5,10 @@
|
|
5
5
|
concept.concept_relations_by_id(klass.name.to_relation_name),
|
6
6
|
:id => klass.name.to_relation_name,
|
7
7
|
:class => "entity_select",
|
8
|
-
:"data-query-url" => concepts_path(:format => :json),
|
8
|
+
:"data-query-url" => concepts_path(:format => :json, :exclude_top_terms => true),
|
9
9
|
:"data-entity-uri" => concept_path("{id}"),
|
10
10
|
:"data-singular" => klass.singular? || nil,
|
11
|
-
:"data-entities" => Concept
|
11
|
+
:"data-entities" => Iqvoc::Concept.base_class.editor_selectable.
|
12
12
|
by_origin(concept.concept_relations_by_id(klass.name.to_relation_name).
|
13
13
|
split(Iqvoc::InlineDataHelper::Splitter)).
|
14
14
|
map { |c| concept_widget_data(c) }.to_json %>
|
@@ -1,6 +1,9 @@
|
|
1
1
|
<div class="relation">
|
2
2
|
<h4><%= Iqvoc::Concept.broader_relation_class.model_name.human(:count => 2) %></h4>
|
3
3
|
<div class="relation-body block">
|
4
|
+
<% if concept.top_term? %>
|
5
|
+
<strong><%= concept.class.human_attribute_name("top_term") %></strong>
|
6
|
+
<% end %>
|
4
7
|
|
5
8
|
<%-
|
6
9
|
only_published = params[:published] != "0"
|
@@ -21,7 +24,7 @@
|
|
21
24
|
render concept.class.inline_partial_name, :concept => concept
|
22
25
|
}.join(" « ").html_safe %>
|
23
26
|
</div>
|
24
|
-
<%
|
27
|
+
<% elsif not concept.top_term? %>
|
25
28
|
<p>-</p>
|
26
29
|
<% end %>
|
27
30
|
</div>
|
@@ -1,13 +1,17 @@
|
|
1
1
|
<div class="relation">
|
2
2
|
<h4><%= Iqvoc::Concept.broader_relation_class.model_name.human(:count => 2) %></h4>
|
3
3
|
<div class="relation-body block">
|
4
|
+
<% if concept.top_term? %>
|
5
|
+
<strong><%= concept.class.human_attribute_name("top_term") %></strong>
|
6
|
+
<% end %>
|
7
|
+
|
4
8
|
<% if concept.related_concepts_for_relation_class(
|
5
9
|
Iqvoc::Concept.broader_relation_class, params[:published] != "0").
|
6
10
|
length > 0 %>
|
7
11
|
<div class="selector">
|
8
12
|
<%= treeview(@concept.broader_relations.map { |rel| rel.target }, true) %>
|
9
13
|
</div>
|
10
|
-
<%
|
14
|
+
<% elsif not concept.top_term? %>
|
11
15
|
<p>-</p>
|
12
16
|
<% end %>
|
13
17
|
</div>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Iqvoc.default_rdf_namespace_helper_methods.each do |meth|
|
2
|
+
document.namespaces(self.send(meth))
|
3
|
+
end
|
4
|
+
|
5
|
+
document << Iqvoc::Concept.root_class.instance.build_rdf_subject(document, controller) do |scheme|
|
6
|
+
@top_concepts.each do |top_concept|
|
7
|
+
scheme.Skos::hasTopConcept IqRdf.build_uri(top_concept.origin)
|
8
|
+
end
|
9
|
+
end
|
data/config/application.rb
CHANGED
data/config/engine.rb
CHANGED
@@ -12,19 +12,19 @@ require 'rails_autolink'
|
|
12
12
|
require 'iqvoc/controller_extensions'
|
13
13
|
|
14
14
|
module Iqvoc
|
15
|
-
|
15
|
+
|
16
16
|
class Engine < Rails::Engine
|
17
17
|
paths["lib/tasks"] << "lib/engine_tasks"
|
18
|
-
|
18
|
+
|
19
19
|
initializer "iqvoc.mixin_controller_extensions" do |app|
|
20
20
|
if Kernel.const_defined?(:ApplicationController)
|
21
21
|
ApplicationController.send(:include, Iqvoc::ControllerExtensions)
|
22
22
|
end
|
23
23
|
end
|
24
|
-
|
24
|
+
|
25
25
|
initializer "iqvoc.add_assets_to_precompilation" do |app|
|
26
26
|
app.config.assets.precompile += Iqvoc.core_assets
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
end
|
@@ -17,7 +17,7 @@
|
|
17
17
|
# Be sure to restart your server when you modify this file.
|
18
18
|
|
19
19
|
if Iqvoc.const_defined?(:Application)
|
20
|
-
|
20
|
+
|
21
21
|
if ENV['HEROKU']
|
22
22
|
puts 'heroku app detected; using session secret from config vars...'
|
23
23
|
Rails.application.config.secret_token = ENV['SECRET_TOKEN']
|
@@ -25,5 +25,5 @@ if Iqvoc.const_defined?(:Application)
|
|
25
25
|
system "bundle exec rake setup:generate_secret_token"
|
26
26
|
require Rails.root.join('config', 'initializers', 'secret_token.rb')
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
end
|
@@ -20,6 +20,12 @@ de:
|
|
20
20
|
concept/base:
|
21
21
|
one: "Konzept"
|
22
22
|
other: "Konzepte"
|
23
|
+
concept/relation/base:
|
24
|
+
one: "Relation"
|
25
|
+
other: "Relations"
|
26
|
+
concept/relation/skos/base:
|
27
|
+
one: "Relation"
|
28
|
+
other: "Relations"
|
23
29
|
concept/relation/skos/broader/mono:
|
24
30
|
one: "Allgemeinerer Begriff"
|
25
31
|
other: "Allgemeinere Begriffe"
|
@@ -47,6 +53,12 @@ de:
|
|
47
53
|
labeling/skos/alt_label:
|
48
54
|
one: "Alternatives Label"
|
49
55
|
other: "Alternative Labels"
|
56
|
+
match/base:
|
57
|
+
one: "Match"
|
58
|
+
other: "Matches"
|
59
|
+
match/skos/base:
|
60
|
+
one: "Match"
|
61
|
+
other: "Matches"
|
50
62
|
match/skos/broad_match:
|
51
63
|
one: "Broader Match"
|
52
64
|
other: "Broader Matches"
|
@@ -100,6 +112,7 @@ de:
|
|
100
112
|
concept/base:
|
101
113
|
follow_up: "Wiedervorlage"
|
102
114
|
expired_at: "Abgelaufen am"
|
115
|
+
top_term: "Top Term"
|
103
116
|
label/base:
|
104
117
|
follow_up: "Wiedervorlage"
|
105
118
|
expired_at: "Abgelaufen am"
|
@@ -20,6 +20,12 @@ en:
|
|
20
20
|
concept/base:
|
21
21
|
one: "Concept"
|
22
22
|
other: "Concepts"
|
23
|
+
concept/relation/base:
|
24
|
+
one: "Relation"
|
25
|
+
other: "Relations"
|
26
|
+
concept/relation/skos/base:
|
27
|
+
one: "Relation"
|
28
|
+
other: "Relations"
|
23
29
|
concept/relation/skos/broader/mono:
|
24
30
|
one: "Broader term"
|
25
31
|
other: "Broader terms"
|
@@ -47,6 +53,12 @@ en:
|
|
47
53
|
labeling/skos/alt_label:
|
48
54
|
one: "Alternative label"
|
49
55
|
other: "Alternative labels"
|
56
|
+
match/base:
|
57
|
+
one: "Match"
|
58
|
+
other: "Matches"
|
59
|
+
match/skos/base:
|
60
|
+
one: "Match"
|
61
|
+
other: "Matches"
|
50
62
|
match/skos/broad_match:
|
51
63
|
one: "Broader Match"
|
52
64
|
other: "Broader Matches"
|
@@ -100,6 +112,7 @@ en:
|
|
100
112
|
concept/base:
|
101
113
|
follow_up: "Reminder"
|
102
114
|
expired_at: "Expired at"
|
115
|
+
top_term: "Top Term"
|
103
116
|
label/base:
|
104
117
|
follow_up: "Reminder"
|
105
118
|
expired_at: "Expired at"
|
data/config/locales/de.yml
CHANGED
@@ -325,6 +325,9 @@ de:
|
|
325
325
|
origin_error: "Origin ungültig!"
|
326
326
|
version_error: "Es existieren schon zwei Versionen dieses Konzepts"
|
327
327
|
no_pref_label_error: "Es muss mindestens ein bevorzugtes Label angegeben werden."
|
328
|
+
orphan_error: "Es muss ein allgemeinerer Begriff oder Top Term zugewiesen werden."
|
329
|
+
top_term_exclusive_error: "Einem Top Term darf kein allgemeinerer Begriff zugewiesen werden."
|
330
|
+
top_term_rooted_error: "Top Terms dürfen nicht als spezifischere Begriffe verwendet werden."
|
328
331
|
main_pref_label_language_missing_error: "Es muss mindestens ein bevorzugtes Label in der Hauptsprache des Thesaurus existieren."
|
329
332
|
pref_labels_with_same_languages_error: "Es darf nur jeweils ein bevorzugtes Label zu einer Sprache geben."
|
330
333
|
association_pref_labels_unpublished: "Das bevorzugte Label muss veröffentlicht sein."
|
data/config/locales/en.yml
CHANGED
@@ -331,6 +331,9 @@ en:
|
|
331
331
|
origin_error: "Invalid origin."
|
332
332
|
version_error: "New Concept version already exists."
|
333
333
|
no_pref_label_error: "At least one preferred label must be specified."
|
334
|
+
orphan_error: "Missing broader term or Top Term assignment."
|
335
|
+
top_term_exclusive_error: "A Top Term must not have any broader terms."
|
336
|
+
top_term_rooted_error: "Top Terms must not be used as narrower terms."
|
334
337
|
main_pref_label_language_missing_error: "There has to be one preferred Label in the main language of the thesaurus."
|
335
338
|
pref_labels_with_same_languages_error: "There must be only one preferred Label per language."
|
336
339
|
association_pref_labels_unpublished: "The preferred Label has to be published."
|
data/config/routes.rb
CHANGED
@@ -20,7 +20,7 @@ Rails.application.routes.draw do
|
|
20
20
|
|
21
21
|
scope '(:lang)', :constraints => lambda { |params, req|
|
22
22
|
lang = params[:lang]
|
23
|
-
return lang.nil? || lang.to_s =~
|
23
|
+
return lang.nil? || lang.to_s =~ /^#{Iqvoc::Concept.pref_labeling_languages.join("|").presence || " "}$/
|
24
24
|
} do
|
25
25
|
|
26
26
|
resource :user_session, :only => [:new, :create, :destroy]
|
@@ -57,6 +57,7 @@ Rails.application.routes.draw do
|
|
57
57
|
|
58
58
|
root :to => 'concepts/hierarchical#index', :format => nil
|
59
59
|
end
|
60
|
-
|
60
|
+
|
61
|
+
match '/scheme(.:format)' => 'rdf#scheme', :as => 'scheme'
|
61
62
|
match '/:id(.:format)' => 'rdf#show', :as => 'rdf'
|
62
63
|
end
|
data/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20120201120736) do
|
15
15
|
|
16
16
|
create_table "collection_members", :force => true do |t|
|
17
17
|
t.integer "collection_id"
|
@@ -44,6 +44,7 @@ ActiveRecord::Schema.define(:version => 20120119000000) do
|
|
44
44
|
t.date "rdf_updated_at"
|
45
45
|
t.datetime "created_at"
|
46
46
|
t.datetime "updated_at"
|
47
|
+
t.boolean "top_term", :default => false
|
47
48
|
end
|
48
49
|
|
49
50
|
add_index "concepts", ["origin"], :name => "ix_concepts_on_origin", :length => {"origin"=>255}
|
data/iqvoc.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_dependency 'json'
|
22
22
|
s.add_dependency 'rails_autolink'
|
23
23
|
|
24
|
-
s.files = %w(LICENSE README.md CHANGELOG.md Gemfile Gemfile.lock Rakefile iqvoc.gemspec) +
|
24
|
+
s.files = %w(LICENSE README.md CHANGELOG.md Gemfile Gemfile.lock Rakefile iqvoc.gemspec) +
|
25
25
|
Dir.glob("{app,config,db,public,lib,test,vendor}/**/*")
|
26
26
|
s.test_files = Dir.glob("{test}/**/*")
|
27
27
|
s.executables = Dir.glob("{bin}/**/*")
|
data/lib/debug.rb
CHANGED
@@ -1,14 +1,40 @@
|
|
1
1
|
# encoding: UTF-8
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
# prints arguments to STDOUT or log depending on context
|
4
|
+
# optional block should return an array of values; the resulting output is then
|
5
|
+
# wrapped in separator lines
|
6
|
+
# the last argument may be an options hash with members :inspect and/or :tag
|
7
|
+
#
|
8
|
+
# examples:
|
9
|
+
# dbg("IMPORTANT", foo, bar)
|
10
|
+
# dbg { [lipsum] }
|
11
|
+
# dbg(foo, bar, :inspect => false, :tag => false) do |args|
|
12
|
+
# args << lorem
|
13
|
+
# args << ipsum
|
14
|
+
# end
|
15
|
+
def dbg(*args, &block)
|
16
|
+
defaults = { :inspect => true, :tag => true }
|
17
|
+
options = args.last.is_a?(Hash) && (defaults.keys & args.last.keys).any?
|
18
|
+
options = defaults.merge(options ? args.pop : {})
|
5
19
|
|
6
|
-
|
7
|
-
|
20
|
+
tty = defined?(Rails::Console) || Rails.env.test? # STDOUT is usually available here
|
21
|
+
meth = tty ? method(:puts) : Rails.logger.method(:debug)
|
8
22
|
|
9
|
-
if
|
10
|
-
|
11
|
-
|
12
|
-
|
23
|
+
if block
|
24
|
+
meth.call "=" * 80
|
25
|
+
block_args = yield [] # XXX: ideally we'd pass the `dbg` method itself here, but the need for `.call` makes for a weird API
|
26
|
+
block_args << options
|
27
|
+
dbg(*block_args)
|
28
|
+
meth.call "-" * 80
|
29
|
+
return unless args.length > 0
|
13
30
|
end
|
31
|
+
|
32
|
+
prefix = "#{args.shift} " if [String, Symbol].include?(args.first.class) # XXX: undocumented and unexpected
|
33
|
+
|
34
|
+
serializer = options[:inspect] ? :inspect : :to_s
|
35
|
+
msg = args.map(&serializer).join(" | ")
|
36
|
+
msg = "#{prefix}#{msg}"
|
37
|
+
msg = "[DEBUG] #{msg}" if options[:tag]
|
38
|
+
|
39
|
+
meth.call msg
|
14
40
|
end
|
data/lib/iqvoc/ability.rb
CHANGED
@@ -5,9 +5,8 @@ module Iqvoc
|
|
5
5
|
@@if_published = lambda { |o| o.published? }
|
6
6
|
|
7
7
|
def initialize(user = nil)
|
8
|
-
|
8
|
+
can :read, Iqvoc::Concept.root_class.instance
|
9
9
|
can :read, ::Collection::Base
|
10
|
-
|
11
10
|
can :read, [::Concept::Base, ::Label::Base], &@@if_published
|
12
11
|
|
13
12
|
if user # Every logged in user ...
|
@@ -4,13 +4,13 @@ module Iqvoc
|
|
4
4
|
module Configuration
|
5
5
|
module Collection
|
6
6
|
extend ActiveSupport::Concern
|
7
|
-
|
7
|
+
|
8
8
|
included do
|
9
9
|
mattr_accessor :base_class_name
|
10
10
|
|
11
11
|
self.base_class_name = 'Collection::Unordered'
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
module ClassMethods
|
15
15
|
def base_class
|
16
16
|
base_class_name.constantize
|
@@ -4,11 +4,11 @@ module Iqvoc
|
|
4
4
|
module Configuration
|
5
5
|
module Concept
|
6
6
|
extend ActiveSupport::Concern
|
7
|
-
|
7
|
+
|
8
8
|
included do
|
9
9
|
Iqvoc.first_level_class_configuration_modules << self
|
10
10
|
|
11
|
-
mattr_accessor :base_class_name,
|
11
|
+
mattr_accessor :base_class_name, :root_class_name,
|
12
12
|
:broader_relation_class_name, :further_relation_class_names,
|
13
13
|
:pref_labeling_class_name,
|
14
14
|
:match_class_names,
|
@@ -18,6 +18,7 @@ module Iqvoc
|
|
18
18
|
:include_module_names
|
19
19
|
|
20
20
|
self.base_class_name = 'Concept::SKOS::Base'
|
21
|
+
self.root_class_name = 'Concept::SKOS::Scheme'
|
21
22
|
|
22
23
|
self.broader_relation_class_name = 'Concept::Relation::SKOS::Broader::Mono'
|
23
24
|
self.further_relation_class_names = [ 'Concept::Relation::SKOS::Related' ]
|
@@ -47,7 +48,7 @@ module Iqvoc
|
|
47
48
|
|
48
49
|
self.include_module_names = []
|
49
50
|
end
|
50
|
-
|
51
|
+
|
51
52
|
module ClassMethods
|
52
53
|
def pref_labeling_languages
|
53
54
|
# FIXME: mutable object; needs custom array setters to guard against
|
@@ -61,6 +62,10 @@ module Iqvoc
|
|
61
62
|
base_class_name.constantize
|
62
63
|
end
|
63
64
|
|
65
|
+
def root_class
|
66
|
+
root_class_name.constantize
|
67
|
+
end
|
68
|
+
|
64
69
|
def pref_labeling_class
|
65
70
|
pref_labeling_class_name.constantize
|
66
71
|
end
|
@@ -130,7 +135,7 @@ module Iqvoc
|
|
130
135
|
def include_modules
|
131
136
|
include_module_names.map(&:constantize)
|
132
137
|
end
|
133
|
-
|
138
|
+
|
134
139
|
# @deprecated
|
135
140
|
def pref_labeling_languages=(value)
|
136
141
|
ActiveSupport::Deprecation.warn "pref_labeling_languages has been moved into instance configuration", caller
|
@@ -149,4 +154,4 @@ module Iqvoc
|
|
149
154
|
|
150
155
|
end
|
151
156
|
end
|
152
|
-
end
|
157
|
+
end
|
@@ -4,7 +4,7 @@ module Iqvoc
|
|
4
4
|
module Configuration
|
5
5
|
module Core
|
6
6
|
extend ActiveSupport::Concern
|
7
|
-
|
7
|
+
|
8
8
|
included do
|
9
9
|
mattr_accessor :searchable_class_names,
|
10
10
|
:unlimited_search_results,
|
@@ -13,8 +13,45 @@ module Iqvoc
|
|
13
13
|
:change_note_class_name,
|
14
14
|
:first_level_class_configuration_modules,
|
15
15
|
:ability_class_name,
|
16
|
+
:navigation_items,
|
16
17
|
:core_assets
|
17
18
|
|
19
|
+
self.navigation_items = [
|
20
|
+
{
|
21
|
+
:content => proc { link_to "Dashboard", dashboard_path },
|
22
|
+
:controller => "dashboard",
|
23
|
+
:authorized? => proc { can? :use, :dashboard }
|
24
|
+
}, {
|
25
|
+
:content => proc { link_to t("txt.views.navigation.hierarchical"),
|
26
|
+
hierarchical_concepts_path },
|
27
|
+
:controller => "concepts/hierarchical"
|
28
|
+
}, {
|
29
|
+
:content => proc { link_to t("txt.views.navigation.alphabetical"),
|
30
|
+
alphabetical_concepts_path(:letter => "a") },
|
31
|
+
:controller => "concepts/alphabetical"
|
32
|
+
}, {
|
33
|
+
:content => proc { link_to t("txt.views.navigation.collections"),
|
34
|
+
collections_path },
|
35
|
+
:controller => "collections"
|
36
|
+
}, {
|
37
|
+
:content => proc { link_to t("txt.views.navigation.search"), search_path },
|
38
|
+
:controller => "search_results"
|
39
|
+
}, {
|
40
|
+
:content => proc { link_to t("txt.views.navigation.users"), users_path },
|
41
|
+
:controller => "users",
|
42
|
+
:authorized? => proc { can? :manage, User }
|
43
|
+
}, {
|
44
|
+
:content => proc { link_to t("txt.views.navigation.instance_configuration"),
|
45
|
+
instance_configuration_path },
|
46
|
+
:controller => "instance_configuration",
|
47
|
+
:authorized? => proc { can? :manage, Iqvoc.config }
|
48
|
+
}, {
|
49
|
+
:content => proc { link_to t("txt.views.navigation.about"), about_path },
|
50
|
+
:active? => proc { params[:controller] == "pages" &&
|
51
|
+
params[:action] == "about" }
|
52
|
+
}
|
53
|
+
]
|
54
|
+
|
18
55
|
self.core_assets = %w(
|
19
56
|
manifest.css
|
20
57
|
manifest.js
|
@@ -51,7 +88,7 @@ module Iqvoc
|
|
51
88
|
self.first_level_class_configuration_modules = [] # Will be set in the modules
|
52
89
|
|
53
90
|
self.ability_class_name = 'Iqvoc::Ability'
|
54
|
-
|
91
|
+
|
55
92
|
# initialize
|
56
93
|
self.config.register_settings({
|
57
94
|
"title" => "iQvoc",
|
@@ -61,7 +98,7 @@ module Iqvoc
|
|
61
98
|
})
|
62
99
|
self.config.initialize_cache
|
63
100
|
end
|
64
|
-
|
101
|
+
|
65
102
|
module ClassMethods
|
66
103
|
def generate_secret_token
|
67
104
|
require 'securerandom'
|
@@ -92,7 +129,7 @@ module Iqvoc
|
|
92
129
|
return cfg
|
93
130
|
end
|
94
131
|
end
|
95
|
-
|
132
|
+
|
96
133
|
def change_note_class
|
97
134
|
change_note_class_name.constantize
|
98
135
|
end
|
@@ -108,7 +145,7 @@ module Iqvoc
|
|
108
145
|
def ability_class
|
109
146
|
ability_class_name.constantize
|
110
147
|
end
|
111
|
-
|
148
|
+
|
112
149
|
def title
|
113
150
|
return config["title"]
|
114
151
|
end
|
@@ -116,7 +153,7 @@ module Iqvoc
|
|
116
153
|
def available_languages
|
117
154
|
return config["available_languages"]
|
118
155
|
end
|
119
|
-
|
156
|
+
|
120
157
|
# @deprecated
|
121
158
|
def title=(value)
|
122
159
|
ActiveSupport::Deprecation.warn "title has been moved into instance configuration", caller
|
@@ -129,7 +166,7 @@ module Iqvoc
|
|
129
166
|
self.config.register_setting("available_languages", value)
|
130
167
|
end
|
131
168
|
end
|
132
|
-
|
169
|
+
|
133
170
|
end
|
134
171
|
end
|
135
|
-
end
|
172
|
+
end
|
@@ -3,7 +3,7 @@ require "active_support/concern"
|
|
3
3
|
module Iqvoc
|
4
4
|
module ControllerExtensions
|
5
5
|
extend ActiveSupport::Concern
|
6
|
-
|
6
|
+
|
7
7
|
included do
|
8
8
|
prepend_before_filter :set_locale
|
9
9
|
before_filter :ensure_extension
|
@@ -48,6 +48,7 @@ module Iqvoc
|
|
48
48
|
|
49
49
|
respond_to do |format|
|
50
50
|
format.html { render :template => 'errors/not_found', :status => :not_found }
|
51
|
+
format.any { head :not_found }
|
51
52
|
end
|
52
53
|
end
|
53
54
|
|
@@ -110,6 +111,6 @@ module Iqvoc
|
|
110
111
|
return false
|
111
112
|
end
|
112
113
|
end
|
113
|
-
|
114
|
+
|
114
115
|
end
|
115
116
|
end
|
data/lib/iqvoc/version.rb
CHANGED
data/lib/iqvoc.rb
CHANGED
data/lib/tasks/heroku.rake
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
namespace :heroku do
|
2
2
|
task :config do
|
3
3
|
require 'securerandom'
|
4
|
-
|
4
|
+
|
5
5
|
HEROKU_CONFIG = %W(
|
6
6
|
HEROKU=true
|
7
7
|
RACK_ENV=heroku
|
8
8
|
RAILS_ENV=heroku
|
9
9
|
SECRET_TOKEN=#{SecureRandom.hex(64)}
|
10
10
|
)
|
11
|
-
|
11
|
+
|
12
12
|
system "heroku config:add #{HEROKU_CONFIG.join(' ')}"
|
13
13
|
end
|
14
14
|
end
|
data/test/factories.rb
CHANGED
@@ -18,6 +18,7 @@ FactoryGirl.define do
|
|
18
18
|
factory :concept, :class => Iqvoc::Concept.base_class do |c|
|
19
19
|
c.sequence(:origin) { |n| "_000000#{n}" }
|
20
20
|
c.published_at 3.days.ago
|
21
|
+
c.top_term true
|
21
22
|
c.pref_labelings { |pref_labelings| [pref_labelings.association(:pref_labeling)] }
|
22
23
|
c.narrower_relations { |narrower_relations| [narrower_relations.association(:narrower_relation)] }
|
23
24
|
end
|
@@ -33,7 +34,7 @@ FactoryGirl.define do
|
|
33
34
|
|
34
35
|
factory :narrower_relation, :class => Iqvoc::Concept.broader_relation_class.narrower_class do |rel|
|
35
36
|
rel.target {|target|
|
36
|
-
target.association(:concept, :broader_relations => [], :narrower_relations => [], :pref_labelings => [
|
37
|
+
target.association(:concept, :top_term => false, :broader_relations => [], :narrower_relations => [], :pref_labelings => [
|
37
38
|
FactoryGirl.create(:pref_labeling, :target => FactoryGirl.create(:pref_label, :value => 'Some narrower relation'))
|
38
39
|
])
|
39
40
|
}
|