iqvoc 4.14.5 → 4.15.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/Gemfile +9 -16
- data/Gemfile.lock +313 -257
- data/README.md +1 -1
- data/app/aides/entity_logger.rb +27 -0
- data/app/aides/maker.rb +1 -1
- data/app/aides/origin.rb +1 -1
- data/app/aides/{rdfapi.rb → rdf_api.rb} +1 -1
- data/app/aides/skos_importer.rb +1 -1
- data/app/assets/javascripts/iqvoc/iqvoc.js +4 -3
- data/app/assets/javascripts/iqvoc/treeview.js +3 -3
- data/app/assets/stylesheets/_framework.scss +1 -1
- data/app/controllers/collections/alphabetical_controller.rb +75 -0
- data/app/controllers/collections/expired_controller.rb +37 -0
- data/app/controllers/collections_controller.rb +22 -28
- data/app/controllers/concepts/alphabetical_controller.rb +4 -6
- data/app/controllers/concepts/expired_controller.rb +1 -1
- data/app/controllers/concepts/hierarchical_controller.rb +18 -15
- data/app/controllers/concepts_controller.rb +0 -3
- data/app/controllers/concepts_movement_controller.rb +1 -1
- data/app/controllers/concerns/controller_extensions.rb +15 -0
- data/app/controllers/dashboard_controller.rb +1 -1
- data/app/controllers/exports_controller.rb +17 -8
- data/app/controllers/rdf_controller.rb +0 -2
- data/app/controllers/remote_labels_controller.rb +0 -2
- data/app/controllers/search_results_controller.rb +59 -43
- data/app/helpers/concepts_helper.rb +2 -2
- data/app/helpers/navigation_helper.rb +7 -7
- data/app/helpers/rdf_helper.rb +2 -0
- data/app/jobs/export_job.rb +4 -7
- data/app/models/collection/base.rb +6 -8
- data/app/models/collection/member/skos/base.rb +2 -2
- data/app/models/collection/skos/base.rb +1 -1
- data/app/models/collection/skos/unordered.rb +1 -1
- data/app/models/collection/unordered.rb +2 -2
- data/app/models/concept/base.rb +2 -10
- data/app/models/concept/relation/base.rb +1 -1
- data/app/models/concept/relation/skos/base.rb +2 -2
- data/app/models/concept/relation/skos/broader/base.rb +2 -2
- data/app/models/concept/relation/skos/broader/mono.rb +1 -1
- data/app/models/concept/relation/skos/broader/poly.rb +1 -1
- data/app/models/concept/relation/skos/narrower/base.rb +1 -1
- data/app/models/concept/relation/skos/related.rb +1 -1
- data/app/models/concept/skos/base.rb +1 -1
- data/app/models/concept/skos/scheme.rb +2 -2
- data/app/models/concept/validations.rb +14 -0
- data/app/models/concerns/expirable.rb +14 -0
- data/app/models/export.rb +21 -9
- data/app/models/label/base.rb +19 -1
- data/app/models/label/skos/base.rb +1 -1
- data/app/models/labeling/base.rb +12 -0
- data/app/models/labeling/skos/alt_label.rb +1 -1
- data/app/models/labeling/skos/base.rb +4 -4
- data/app/models/labeling/skos/hidden_label.rb +1 -1
- data/app/models/labeling/skos/pref_label.rb +1 -1
- data/app/models/match/skos/base.rb +3 -3
- data/app/models/match/skos/broad_match.rb +2 -2
- data/app/models/match/skos/close_match.rb +1 -1
- data/app/models/match/skos/exact_match.rb +1 -1
- data/app/models/match/skos/mapping_relation.rb +1 -1
- data/app/models/match/skos/narrow_match.rb +2 -2
- data/app/models/match/skos/related_match.rb +1 -1
- data/app/models/note/base.rb +2 -2
- data/app/models/note/rdfs/see_also.rb +1 -1
- data/app/models/note/skos/base.rb +4 -4
- data/app/models/note/skos/change_note.rb +2 -2
- data/app/models/note/skos/definition.rb +1 -1
- data/app/models/note/skos/editorial_note.rb +1 -1
- data/app/models/note/skos/example.rb +1 -1
- data/app/models/note/skos/history_note.rb +1 -1
- data/app/models/note/skos/scope_note.rb +1 -1
- data/app/presenters/alphabetical_search_result.rb +2 -2
- data/app/services/rdf_sync_service.rb +1 -1
- data/app/uploaders/base.rb +4 -3
- data/app/view_models/concept_view.rb +1 -1
- data/app/views/collections/_data.html.erb +1 -1
- data/app/views/collections/_form.html.erb +14 -2
- data/app/views/collections/alphabetical/_search_result.html.erb +17 -0
- data/app/views/collections/alphabetical/_search_result_remote.html.erb +14 -0
- data/app/views/collections/alphabetical/index.html.erb +23 -0
- data/app/views/collections/edit.html.erb +1 -1
- data/app/views/collections/expired/index.html.erb +23 -0
- data/app/views/collections/index.html.erb +1 -1
- data/app/views/collections/new.html.erb +1 -1
- data/app/views/collections/show_published.html.erb +1 -1
- data/app/views/collections/show_unpublished.html.erb +1 -1
- data/app/views/collections/sidebars/_plural.html.erb +28 -0
- data/app/views/collections/sidebars/_singular.html.erb +22 -0
- data/app/views/concepts/_form.html.erb +1 -1
- data/app/views/concepts/alphabetical/index.html.erb +1 -1
- data/app/views/concepts/expired/index.html.erb +1 -1
- data/app/views/concepts/glance.html.erb +1 -1
- data/app/views/concepts/scheme/edit.html.erb +1 -1
- data/app/views/concepts/sidebars/_plural.html.erb +1 -1
- data/app/views/concepts/sidebars/_singular.html.erb +1 -1
- data/app/views/dashboard/glance.html.erb +1 -1
- data/app/views/exports/index.html.erb +5 -1
- data/app/views/exports/show.html.erb +1 -1
- data/app/views/partials/collection/_inline_base.html.erb +4 -0
- data/app/views/search_results/_sidebar.html.erb +1 -1
- data/config/application.rb +7 -2
- data/config/ci.rb +20 -0
- data/config/database.yml +15 -21
- data/config/database.yml.postgresql +13 -20
- data/config/engine.rb +1 -0
- data/config/environments/development.rb +1 -1
- data/config/environments/production.rb +1 -1
- data/config/environments/test.rb +1 -1
- data/config/initializers/content_security_policy.rb +6 -2
- data/config/initializers/filter_parameter_logging.rb +4 -4
- data/config/initializers/new_framework_defaults_7_1.rb +280 -0
- data/config/initializers/new_framework_defaults_8_0.rb +30 -0
- data/config/initializers/new_framework_defaults_8_1.rb +74 -0
- data/config/initializers/permissions_policy.rb +11 -9
- data/config/initializers/zeitwerk.rb +1 -3
- data/config/locales/de.yml +4 -1
- data/config/locales/en.yml +4 -1
- data/config/locales/pt.yml +2 -1
- data/config/puma.rb +34 -35
- data/config/routes.rb +3 -1
- data/db/migrate/20110510162719_use_mono_hierarchy_instead_of_poly_hierarchy.rb +2 -2
- data/db/migrate/20130227145825_fix_collection_type.rb +3 -3
- data/db/migrate/20130502151221_fix_collection_member_types.rb +1 -1
- data/db/migrate/20250218160045_adapt_zeitwerk_naming_to_iqvoc.rb +25 -0
- data/db/migrate/20250326182601_adapt_zeitwerk_skos_naming_to_instance_configuration.rb +11 -0
- data/db/schema.rb +100 -1
- data/iqvoc.gemspec +4 -4
- data/lib/iqvoc/configuration/collection.rb +16 -4
- data/lib/iqvoc/configuration/concept.rb +22 -18
- data/lib/iqvoc/configuration/core.rb +9 -23
- data/lib/iqvoc/configuration/label.rb +1 -1
- data/lib/iqvoc/environments/development.rb +62 -57
- data/lib/iqvoc/environments/production.rb +70 -67
- data/lib/iqvoc/environments/test.rb +44 -38
- data/lib/iqvoc/version.rb +1 -1
- data/test/controllers/concepts_movement_controller_test.rb +14 -14
- data/test/controllers/hierarchy_test.rb +0 -1
- data/test/controllers/reverse_match_test.rb +6 -6
- data/test/integration/alphabetical_test.rb +5 -5
- data/test/integration/browse_concepts_and_labels_test.rb +4 -4
- data/test/integration/client_edit_concept_test.rb +1 -1
- data/test/integration/collection_browsing_test.rb +2 -2
- data/test/integration/collection_circularity_test.rb +10 -10
- data/test/integration/collection_test.rb +79 -0
- data/test/integration/concept_browsing_test.rb +3 -3
- data/test/integration/concept_collection_assignment_test.rb +4 -4
- data/test/integration/concept_scheme_browsing_test.rb +7 -7
- data/test/integration/edit_collections_test.rb +1 -1
- data/test/integration/edit_concepts_test.rb +2 -2
- data/test/integration/instance_configuration_browsing_test.rb +1 -1
- data/test/integration/note_annotations_test.rb +2 -2
- data/test/integration/reverse_match_job_test.rb +9 -9
- data/test/integration/search_test.rb +20 -10
- data/test/integration/tree_test.rb +5 -5
- data/test/integration/untranslated_test.rb +2 -2
- data/test/integration_test_helper.rb +7 -0
- data/test/models/concept_scheme_test.rb +6 -6
- data/test/models/concept_test.rb +38 -38
- data/test/models/deep_cloning_test.rb +6 -6
- data/test/models/note_test.rb +4 -4
- data/test/models/rdf_sync_test.rb +1 -1
- data/test/models/rdfapi_test.rb +24 -24
- data/test/models/skos_collection_import_test.rb +3 -3
- data/test/models/skos_import_test.rb +4 -4
- metadata +44 -32
- data/app/views/collections/_sidebar.html.erb +0 -20
- data/config/environments/heroku.rb +0 -81
- data/config/initializers/heroku.rb +0 -24
- data/config/secrets.yml +0 -35
- /data/{app/helpers → lib}/iqvoc_module_helper.rb +0 -0
- /data/{app/models/concerns → lib}/search_extension.rb +0 -0
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# See the License for the specific language governing permissions and
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
|
-
class Note::
|
|
17
|
+
class Note::Rdfs::SeeAlso < Note::Skos::Base
|
|
18
18
|
self.rdf_namespace = 'rdfs'
|
|
19
19
|
self.rdf_predicate = 'seeAlso'
|
|
20
20
|
end
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# See the License for the specific language governing permissions and
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
|
-
class Note::
|
|
17
|
+
class Note::Skos::Base < Note::Base
|
|
18
18
|
self.rdf_namespace = 'skos'
|
|
19
19
|
|
|
20
20
|
def self.build_from_rdf(rdf_subject, rdf_predicate, rdf_object)
|
|
@@ -23,10 +23,10 @@ class Note::SKOS::Base < Note::Base
|
|
|
23
23
|
raise "#{self.name}#build_from_rdf: Subject (#{rdf_subject}) must be able to receive this kind of note (#{self.name} => #{self.name.to_relation_name.to_s})."
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
target_class =
|
|
26
|
+
target_class = RdfApi::PREDICATE_DICTIONARY[rdf_predicate] || self
|
|
27
27
|
case rdf_object
|
|
28
28
|
when String # Literal
|
|
29
|
-
unless rdf_object =~
|
|
29
|
+
unless rdf_object =~ RdfApi::LITERAL_REGEXP
|
|
30
30
|
raise "#{self.name}#build_from_rdf: Object (#{rdf_object}) must be a string literal"
|
|
31
31
|
end
|
|
32
32
|
lang = $3
|
|
@@ -53,7 +53,7 @@ class Note::SKOS::Base < Note::Base
|
|
|
53
53
|
blank_node.Rdfs::comment(value, lang: language || nil) if value
|
|
54
54
|
annotations.order(:namespace, :predicate).each do |annotation|
|
|
55
55
|
if IqRdf::Namespace.find_namespace_class(annotation.namespace)
|
|
56
|
-
val = if annotation.value =~
|
|
56
|
+
val = if annotation.value =~ RdfApi::URI_REGEXP
|
|
57
57
|
# Fall back to plain value literal if URI is not parseable
|
|
58
58
|
URI.parse(annotation.value) rescue annotation.value
|
|
59
59
|
else
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# See the License for the specific language governing permissions and
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
|
-
class Note::
|
|
17
|
+
class Note::Skos::ChangeNote < Note::Skos::Base
|
|
18
18
|
self.rdf_predicate = 'changeNote'
|
|
19
19
|
|
|
20
20
|
def self.edit_partial_name(obj)
|
|
@@ -40,7 +40,7 @@ class Note::SKOS::ChangeNote < Note::SKOS::Base
|
|
|
40
40
|
if (IqRdf::Namespace.find_namespace_class(annotation.namespace))
|
|
41
41
|
blank_node.send(annotation.namespace.camelcase).send(annotation.predicate, annotation.value.nil? ? '' : annotation.value)
|
|
42
42
|
else
|
|
43
|
-
raise "Note::
|
|
43
|
+
raise "Note::Skos::ChangeNote#build_rdf: couldn't find Namespace '#{annotation.namespace}'."
|
|
44
44
|
end
|
|
45
45
|
end
|
|
46
46
|
end
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# See the License for the specific language governing permissions and
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
|
-
class Note::
|
|
17
|
+
class Note::Skos::Definition < Note::Skos::Base
|
|
18
18
|
self.rdf_predicate = 'definition'
|
|
19
19
|
|
|
20
20
|
def self.view_section(obj)
|
|
@@ -14,6 +14,6 @@
|
|
|
14
14
|
# See the License for the specific language governing permissions and
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
|
-
class Note::
|
|
17
|
+
class Note::Skos::EditorialNote < Note::Skos::Base
|
|
18
18
|
self.rdf_predicate = 'editorialNote'
|
|
19
19
|
end
|
|
@@ -18,12 +18,12 @@ class AlphabeticalSearchResult
|
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def definition?
|
|
21
|
-
relation_name = Note::
|
|
21
|
+
relation_name = Note::Skos::Definition.name.to_relation_name
|
|
22
22
|
@labeling.owner.respond_to?(relation_name) && @labeling.owner.send(relation_name).any?
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def definition
|
|
26
|
-
relation_name = Note::
|
|
26
|
+
relation_name = Note::Skos::Definition.name.to_relation_name
|
|
27
27
|
@labeling.owner.send(relation_name).first
|
|
28
28
|
end
|
|
29
29
|
|
|
@@ -112,6 +112,6 @@ module RdfSyncService::Helper # TODO: rename -- XXX: does not belong here!?
|
|
|
112
112
|
return RdfSyncService.new(base_url, Iqvoc.config['triplestore.url'],
|
|
113
113
|
username: Iqvoc.config['triplestore.username'].presence,
|
|
114
114
|
password: Iqvoc.config['triplestore.password'].presence,
|
|
115
|
-
view_context: view_context) # fugly, but necessary; cf.
|
|
115
|
+
view_context: view_context) # fugly, but necessary; cf. RdfSync#serialize
|
|
116
116
|
end
|
|
117
117
|
end
|
data/app/uploaders/base.rb
CHANGED
|
@@ -4,11 +4,11 @@ class Base < CarrierWave::Uploader::Base
|
|
|
4
4
|
storage :file
|
|
5
5
|
|
|
6
6
|
def store_dir
|
|
7
|
-
Iqvoc.upload_path.join(model.class.to_s.downcase)
|
|
7
|
+
Iqvoc.upload_path.join(self.model.class.to_s.downcase)
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
def filename
|
|
11
|
-
"#{secure_token}.#{file.extension}"
|
|
11
|
+
"#{self.secure_token}.#{file.extension}"
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
protected
|
|
@@ -16,6 +16,7 @@ class Base < CarrierWave::Uploader::Base
|
|
|
16
16
|
# https://github.com/jnicklas/carrierwave/wiki/How-to%3A-Create-random-and-unique-filenames-for-all-versioned-files
|
|
17
17
|
def secure_token
|
|
18
18
|
var = :"@#{mounted_as}_secure_token"
|
|
19
|
-
|
|
19
|
+
|
|
20
|
+
self.model.instance_variable_get(var) or self.model.instance_variable_set(var, SecureRandom.hex)
|
|
20
21
|
end
|
|
21
22
|
end
|
|
@@ -35,7 +35,7 @@ class ConceptView
|
|
|
35
35
|
|
|
36
36
|
# returns a string
|
|
37
37
|
def definition
|
|
38
|
-
@definition ||= @concept.notes_for_class(Note::
|
|
38
|
+
@definition ||= @concept.notes_for_class(Note::Skos::Definition)
|
|
39
39
|
.first # FIXME: hard-coded class, arbitrary pick
|
|
40
40
|
.try(:value)
|
|
41
41
|
end
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<% end %>
|
|
10
10
|
|
|
11
11
|
<div class="relation panel">
|
|
12
|
-
<h2><%= Note::
|
|
12
|
+
<h2><%= Note::Skos::Definition.model_name.human(:count => 2) %></h2>
|
|
13
13
|
<ul>
|
|
14
14
|
<% collection.note_skos_definitions.each do |definition| %>
|
|
15
15
|
<li><%= definition.value %> (<%= definition.language %>)</li>
|
|
@@ -4,10 +4,22 @@
|
|
|
4
4
|
# migrations to update existing data.
|
|
5
5
|
-%>
|
|
6
6
|
|
|
7
|
-
<%= bootstrap_form_for collection,
|
|
7
|
+
<%= bootstrap_form_for collection,
|
|
8
|
+
as: :concept,
|
|
9
|
+
url: collection.new_record? ? collections_path : collection_path(collection, published: 0),
|
|
10
|
+
layout: :horizontal,
|
|
11
|
+
label_col: 'col-sm-3',
|
|
12
|
+
control_col: 'col-sm-9' do |f| %>
|
|
13
|
+
|
|
14
|
+
<fieldset>
|
|
15
|
+
<legend><%= t('txt.common.attributes') %></legend>
|
|
16
|
+
<%= f.text_field :follow_up, :class => 'datepicker' %>
|
|
17
|
+
<%= f.text_field :expired_at, :class => 'datepicker' %>
|
|
18
|
+
</fieldset>
|
|
19
|
+
|
|
8
20
|
<fieldset>
|
|
9
21
|
<legend><%= t 'txt.views.layouts.sections.labels' %></legend>
|
|
10
|
-
<% if not Iqvoc.const_defined?(:
|
|
22
|
+
<% if not Iqvoc.const_defined?(:Skosxl) %>
|
|
11
23
|
<p><%= t 'txt.common.hint_csv_input' %></p>
|
|
12
24
|
<% end %>
|
|
13
25
|
<%- Iqvoc::Concept.labeling_classes.each do |labeling_class, languages| -%>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<li class="concept-item">
|
|
2
|
+
<p>
|
|
3
|
+
<%= link_to result.label.to_s, rdf_path(result.concept, lang: nil, format: nil),
|
|
4
|
+
alt: result.concept.origin, data: { 'resource-path': result.path, 'resource-url': rdf_url(result.concept, lang: nil, format: nil) }, class: 'concept-item-link' %>
|
|
5
|
+
<% if Iqvoc.concept_modal_preview_enabled? %>
|
|
6
|
+
<a href="<%= glance_concept_url(result.concept, format: :html) %>" class="dashboard-glance-link"><i class="fa fa-search-plus"></i></a>
|
|
7
|
+
<% end %>
|
|
8
|
+
|
|
9
|
+
<% if result.concept.additional_info.present? %>
|
|
10
|
+
<span class="additional_info">(<%= result.concept.additional_info %>)</span>
|
|
11
|
+
<% end %>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p class="concept-item-uri">
|
|
15
|
+
<%= rdf_url(id: result.concept.origin, lang: nil, format: nil) %>
|
|
16
|
+
</p>
|
|
17
|
+
</li>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<li class="concept-item">
|
|
2
|
+
<p>
|
|
3
|
+
<%= link_to result.label, result.path,
|
|
4
|
+
:data => { 'resource-url' => result.url },
|
|
5
|
+
:class => 'concept-item-link' %>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p class="concept-item-uri"><%= result.url %></p>
|
|
9
|
+
<% if result.definition? %>
|
|
10
|
+
<p class="concept-item-definition" lang="<%= result.definition_language %>">
|
|
11
|
+
<%= result.definition %>
|
|
12
|
+
</p>
|
|
13
|
+
<% end %>
|
|
14
|
+
</li>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<%
|
|
2
|
+
subtitle = t('txt.views.navigation.alphabetical')
|
|
3
|
+
if can?(:update, Iqvoc::Collection.base_class)
|
|
4
|
+
subtitle += " (#{number_with_delimiter(Iqvoc::Collection.base_class.published.not_expired.size)})"
|
|
5
|
+
end
|
|
6
|
+
%>
|
|
7
|
+
<%= page_header title: Iqvoc::Collection.base_class.model_name.human(:count => 2), desc: subtitle %>
|
|
8
|
+
<%= render 'collections/sidebars/plural' %>
|
|
9
|
+
|
|
10
|
+
<div class="panel">
|
|
11
|
+
<div class="panel-header centered">
|
|
12
|
+
<%= letter_selector(@letters) do |letter| %>
|
|
13
|
+
<% alphabetical_collections_path(prefix: letter.to_s.downcase) %>
|
|
14
|
+
<% end %>
|
|
15
|
+
</div>
|
|
16
|
+
<ol class="concept-items list-unstyled">
|
|
17
|
+
<% @search_results.each do |result| %>
|
|
18
|
+
<%= render partial: result.partial_name, locals: { result: result } %>
|
|
19
|
+
<% end %>
|
|
20
|
+
</ol>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<%= paginate @search_results %>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<%
|
|
2
|
+
subtitle = t('txt.views.navigation.expired')
|
|
3
|
+
if can?(:update, Iqvoc::Collection.base_class)
|
|
4
|
+
subtitle += " (#{number_with_delimiter(Iqvoc::Collection.base_class.published.expired.size)})"
|
|
5
|
+
end
|
|
6
|
+
%>
|
|
7
|
+
<%= page_header :title => Iqvoc::Collection.base_class.model_name.human(:count => 2), desc: subtitle %>
|
|
8
|
+
<%= render 'collections/sidebars/plural' %>
|
|
9
|
+
|
|
10
|
+
<div class="panel">
|
|
11
|
+
<div class="panel-header centered">
|
|
12
|
+
<%= letter_selector(@letters) do |letter| %>
|
|
13
|
+
<% expired_collections_path(prefix: letter.to_s.downcase) %>
|
|
14
|
+
<% end %>
|
|
15
|
+
</div>
|
|
16
|
+
<ol class="concept-items list-unstyled">
|
|
17
|
+
<% @search_results.each do |result| %>
|
|
18
|
+
<%= render partial: result.partial_name, locals: { result: result } %>
|
|
19
|
+
<% end %>
|
|
20
|
+
</ol>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<%= paginate @search_results %>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%= render 'header', :collection => @collection %>
|
|
2
|
-
<%= render '
|
|
2
|
+
<%= render 'collections/sidebars/singular', :collection => @collection %>
|
|
3
3
|
|
|
4
4
|
<% if @new_collection_version.blank? && can?(:branch, @collection) %>
|
|
5
5
|
<div class="editing_versioning_toolbar">
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<%= render 'header', :collection => @collection %>
|
|
2
|
-
<%= render '
|
|
2
|
+
<%= render 'collections/sidebars/singular', :collection => @collection %>
|
|
3
3
|
|
|
4
4
|
<%= alert :info, :header => t('txt.common.unpublished_version') + "." do %>
|
|
5
5
|
<%= t("txt.views.versioning.current_revision", :rev => @collection.rev) %>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<%= sidebar do %>
|
|
2
|
+
<%= sidebar_header t('txt.views.navigation.sections') %>
|
|
3
|
+
|
|
4
|
+
<%= sidebar_item text: t("txt.views.navigation.hierarchical"),
|
|
5
|
+
icon: 'list-alt',
|
|
6
|
+
path: collections_path,
|
|
7
|
+
active: params[:controller] == 'collections' && params[:published] != '0' %>
|
|
8
|
+
|
|
9
|
+
<%= sidebar_item text: t("txt.views.navigation.alphabetical"),
|
|
10
|
+
icon: 'list-alt',
|
|
11
|
+
path: alphabetical_collections_path,
|
|
12
|
+
active: (params[:controller] == 'collections/alphabetical') %>
|
|
13
|
+
|
|
14
|
+
<%= sidebar_item text: t("txt.views.navigation.expired"),
|
|
15
|
+
icon: 'list-alt',
|
|
16
|
+
path: expired_collections_path,
|
|
17
|
+
active: (params[:controller] == 'collections/expired') %>
|
|
18
|
+
<% end %>
|
|
19
|
+
|
|
20
|
+
<%= sidebar do %>
|
|
21
|
+
<% if can?(:create, Iqvoc::Collection.base_class) %>
|
|
22
|
+
<%= sidebar_header 'Links'%>
|
|
23
|
+
<% (Iqvoc.first_level_classes - [Iqvoc::Concept.base_class]).each do |klass| %>
|
|
24
|
+
<%= sidebar_item { render(klass.new_link_partial_name) } %>
|
|
25
|
+
<% end %>
|
|
26
|
+
<% end %>
|
|
27
|
+
<% end %>
|
|
28
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<%- published_param = collection.published? ? nil : "0" if defined?(collection) -%>
|
|
2
|
+
|
|
3
|
+
<%= sidebar do %>
|
|
4
|
+
<% if defined?(collection) %>
|
|
5
|
+
<%= sidebar_header t('txt.common.representations') %>
|
|
6
|
+
<%= sidebar_item icon: 'share', text: 'HTML', path: collection_url(collection.origin, :format => :html) %>
|
|
7
|
+
<%= sidebar_item icon: 'share', text: 'RDF/XML', path: rdf_url(collection.origin, format: :rdf, lang: nil), id: 'rdf_link_xml' %>
|
|
8
|
+
<%= sidebar_item icon: 'share', text: 'RDF/Turtle', path: rdf_url(collection.origin, format: :ttl, lang: nil), id: 'rdf_link_ttl' %>
|
|
9
|
+
<%= sidebar_item icon: 'share', text: 'RDF/NTriples', path: rdf_url(collection.origin, format: :nt, lang: nil), id: 'rdf_link_nt' %>
|
|
10
|
+
<% end %>
|
|
11
|
+
<% end %>
|
|
12
|
+
|
|
13
|
+
<%= sidebar do %>
|
|
14
|
+
<%= sidebar_header 'Links' %>
|
|
15
|
+
<% if defined?(collection) %>
|
|
16
|
+
<%= sidebar_item icon: 'link', text: t('txt.models.collection.uri'), path: rdf_url(collection.origin, format: nil, published: published_param, lang: nil) %>
|
|
17
|
+
<% end %>
|
|
18
|
+
|
|
19
|
+
<% (Iqvoc.first_level_classes - [Iqvoc::Concept.base_class]).each do |klass| %>
|
|
20
|
+
<%= sidebar_item { render(klass.new_link_partial_name) } %>
|
|
21
|
+
<% end %>
|
|
22
|
+
<% end %>
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<!-- Labelings -->
|
|
20
20
|
<fieldset>
|
|
21
21
|
<legend><%= Labeling::Base.model_name.human(:count => 2) %></legend>
|
|
22
|
-
<% unless Iqvoc.const_defined?(:
|
|
22
|
+
<% unless Iqvoc.const_defined?(:Skosxl) %>
|
|
23
23
|
<p><%= t 'txt.common.hint_csv_input' %></p>
|
|
24
24
|
<% end %>
|
|
25
25
|
<%- Iqvoc::Concept.labeling_classes.each do |labeling_class, languages| -%>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%
|
|
2
2
|
subtitle = t('txt.views.navigation.alphabetical')
|
|
3
3
|
if can?(:update, Iqvoc::Concept.base_class)
|
|
4
|
-
subtitle += " (#{number_with_delimiter(Iqvoc::Concept.base_class.not_expired.size)})"
|
|
4
|
+
subtitle += " (#{number_with_delimiter(Iqvoc::Concept.base_class.published.not_expired.size)})"
|
|
5
5
|
end
|
|
6
6
|
%>
|
|
7
7
|
<%= page_header :title => Iqvoc::Concept.base_class.model_name.human(:count => 2), desc: subtitle %>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<%
|
|
2
2
|
subtitle = t('txt.views.navigation.expired')
|
|
3
3
|
if can?(:update, Iqvoc::Concept.base_class)
|
|
4
|
-
subtitle += " (#{number_with_delimiter(Iqvoc::Concept.base_class.expired.size)})"
|
|
4
|
+
subtitle += " (#{number_with_delimiter(Iqvoc::Concept.base_class.published.expired.size)})"
|
|
5
5
|
end
|
|
6
6
|
%>
|
|
7
7
|
<%= page_header :title => Iqvoc::Concept.base_class.model_name.human(:count => 2), desc: subtitle %>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<%= bootstrap_form_for @scheme, :as => :concept, :url => scheme_path, :layout => :horizontal do |f| %>
|
|
5
5
|
<fieldset>
|
|
6
6
|
<legend><%= t 'txt.views.layouts.sections.labels' %></legend>
|
|
7
|
-
<% unless Iqvoc.const_defined?(:
|
|
7
|
+
<% unless Iqvoc.const_defined?(:Skosxl) %>
|
|
8
8
|
<p><%= t 'txt.common.hint_csv_input' %></p>
|
|
9
9
|
<% end %>
|
|
10
10
|
<%- Iqvoc::Concept.labeling_classes.each do |labeling_class, languages| -%>
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
<%= sidebar do %>
|
|
31
31
|
<% if can?(:create, Iqvoc::Concept.base_class) %>
|
|
32
32
|
<%= sidebar_header 'Links'%>
|
|
33
|
-
<% (Iqvoc.first_level_classes - [Collection
|
|
33
|
+
<% (Iqvoc.first_level_classes - [Iqvoc::Collection.base_class]).each do |klass| %>
|
|
34
34
|
<%= sidebar_item { render(klass.new_link_partial_name) } %>
|
|
35
35
|
<% end %>
|
|
36
36
|
<% end %>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<%= sidebar_item :icon => 'link', :text => t('txt.models.concept.uri'), :path => rdf_url(concept.origin, :format => nil, :published => published_param, :lang => nil) %>
|
|
17
17
|
<% end %>
|
|
18
18
|
|
|
19
|
-
<% (Iqvoc.first_level_classes - [Collection
|
|
19
|
+
<% (Iqvoc.first_level_classes - [Iqvoc::Collection.base_class]).each do |klass| %>
|
|
20
20
|
<%= sidebar_item { render(klass.new_link_partial_name) } %>
|
|
21
21
|
<% end %>
|
|
22
22
|
<% end %>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</button>
|
|
10
10
|
</div>
|
|
11
11
|
<div class="modal-body concept-teaser-body">
|
|
12
|
-
<h2><%= Note::
|
|
12
|
+
<h2><%= Note::Skos::EditorialNote.model_name.human(count: 2) %></h2>
|
|
13
13
|
<% if @editorial_notes.empty? %>
|
|
14
14
|
<div class="alert alert-warning" role="alert">
|
|
15
15
|
<%= t('txt.views.dashboard.no_editorial_notes') %>
|
|
@@ -32,7 +32,11 @@
|
|
|
32
32
|
<td><%= t("txt.common.rdf_serialization.#{export.file_type}") %></td>
|
|
33
33
|
<td><%= l(export.created_at, :format => :short) %></td>
|
|
34
34
|
<td><%= export.finished_at? ? l(export.finished_at, :format => :short) : icon(:cog, 'fa-spin') %></td>
|
|
35
|
-
<td
|
|
35
|
+
<td>
|
|
36
|
+
<%= link_to('Download', export_download_url(export), class: 'btn btn-primary btn-sm') if export.success? %>
|
|
37
|
+
|
|
38
|
+
<%= link_to(t('txt.common.delete'), export_url(export), data: { confirm: t('txt.views.export.delete_confirm')}, method: :delete, class: 'btn btn-danger btn-sm') %>
|
|
39
|
+
</td>
|
|
36
40
|
</tr>
|
|
37
41
|
<% end %>
|
|
38
42
|
</tbody>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<%= link_to(concept.pref_label, collection_path(id: concept, published: ((!concept.published? && !concept.published_version_id) ? 0 : nil)), class: concept.published? ? '' : 'unpublished') %>
|
|
2
|
+
<%- if concept.additional_info -%>
|
|
3
|
+
(<%= concept.additional_info %>)
|
|
4
|
+
<%- end -%>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<%= sidebar do %>
|
|
11
11
|
<%= sidebar_header 'Links' if can?(:create, Iqvoc::Concept.base_class) %>
|
|
12
|
-
<% (Iqvoc.first_level_classes - [Collection
|
|
12
|
+
<% (Iqvoc.first_level_classes - [Iqvoc::Collection.base_class]).each do |klass| %>
|
|
13
13
|
<%= sidebar_item { render(klass.new_link_partial_name) } %>
|
|
14
14
|
<% end %>
|
|
15
15
|
<% end %>
|
data/config/application.rb
CHANGED
|
@@ -4,7 +4,7 @@ require_relative "boot"
|
|
|
4
4
|
require "active_model/railtie"
|
|
5
5
|
require "active_job/railtie"
|
|
6
6
|
require "active_record/railtie"
|
|
7
|
-
require "active_storage/engine"
|
|
7
|
+
# require "active_storage/engine"
|
|
8
8
|
require "action_controller/railtie"
|
|
9
9
|
require "action_mailer/railtie"
|
|
10
10
|
require "action_mailbox/engine"
|
|
@@ -21,7 +21,12 @@ Bundler.require(*Rails.groups)
|
|
|
21
21
|
module Iqvoc
|
|
22
22
|
class Application < Rails::Application
|
|
23
23
|
# Initialize configuration defaults for originally generated Rails version.
|
|
24
|
-
config.load_defaults
|
|
24
|
+
config.load_defaults 8.1
|
|
25
|
+
|
|
26
|
+
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
|
27
|
+
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
|
28
|
+
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
|
29
|
+
config.autoload_lib(ignore: %w(assets tasks generators))
|
|
25
30
|
|
|
26
31
|
# Configuration for the application, engines, and railties goes here.
|
|
27
32
|
#
|
data/config/ci.rb
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Run using bin/ci
|
|
2
|
+
|
|
3
|
+
CI.run do
|
|
4
|
+
step "Setup", "bin/setup --skip-server"
|
|
5
|
+
|
|
6
|
+
# step "Security: Importmap vulnerability audit", "bin/importmap audit"
|
|
7
|
+
step "Tests: Rails", "bin/rails test"
|
|
8
|
+
step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant"
|
|
9
|
+
|
|
10
|
+
# Optional: Run system tests
|
|
11
|
+
step "Tests: System", "bin/rails test:system"
|
|
12
|
+
|
|
13
|
+
# Optional: set a green GitHub commit status to unblock PR merge.
|
|
14
|
+
# Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`.
|
|
15
|
+
# if success?
|
|
16
|
+
# step "Signoff: All systems go. Ready for merge and deploy.", "gh signoff"
|
|
17
|
+
# else
|
|
18
|
+
# failure "Signoff: CI failed. Do not merge or deploy.", "Fix the issues and try again."
|
|
19
|
+
# end
|
|
20
|
+
end
|
data/config/database.yml
CHANGED
|
@@ -1,26 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
default: &default
|
|
2
2
|
adapter: postgresql
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
encoding: utf8
|
|
4
|
+
host: <%= ENV['DB_HOST'] || 'localhost' %>
|
|
5
|
+
username: <%= ENV['DB_USERNAME'] || 'mjansing' %>
|
|
6
|
+
password: <%= ENV['DB_PASSWORD'] || '' %>
|
|
7
|
+
port: 5432
|
|
8
|
+
pool: <%= ENV["DB_POOL"] || ENV['RAILS_MAX_THREADS'] || 5 %>
|
|
9
|
+
|
|
10
|
+
development:
|
|
11
|
+
<<: *default
|
|
12
|
+
database: <%= ENV['DB_NAME'].presence || 'iqvoc_development' %>
|
|
9
13
|
|
|
10
14
|
test:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
encoding: unicode
|
|
14
|
-
database: <%= ENV["POSTGRES_DB"] || 'iqvoc_test' %>
|
|
15
|
-
pool: 5
|
|
16
|
-
username: <%= ENV["POSTGRES_USER"] || 'postgres' %>
|
|
17
|
-
password: <%= ENV["POSTGRES_PASSWORD"] || 'postgres' %>
|
|
15
|
+
<<: *default
|
|
16
|
+
database: <%= ENV['DB_NAME'].presence || 'iqvoc_test' %>
|
|
18
17
|
|
|
19
18
|
production:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
encoding: unicode
|
|
23
|
-
database: <%= ENV["POSTGRES_DB"] || 'iqvoc_production' %>
|
|
24
|
-
pool: 5
|
|
25
|
-
username: <%= ENV["POSTGRES_USER"] || 'postgres' %>
|
|
26
|
-
password: <%= ENV["POSTGRES_PASSWORD"] || 'postgres' %>
|
|
19
|
+
<<: *default
|
|
20
|
+
database: <%= ENV['DB_NAME'].presence || 'iqvoc_development' %>
|
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
default: &default
|
|
2
2
|
adapter: postgresql
|
|
3
|
-
host: localhost
|
|
4
3
|
encoding: unicode
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
host: <%= ENV['POSTGRES_HOST'] || 'localhost' %>
|
|
5
|
+
username: <%= ENV['POSTGRES_USER'] || 'postgres' %>
|
|
6
|
+
password: <%= ENV['POSTGRES_PASSWORD'] || 'postgres' %>
|
|
7
|
+
pool: <%= ENV["DB_POOL"] || ENV['RAILS_MAX_THREADS'] || 5 %>
|
|
8
|
+
|
|
9
|
+
development:
|
|
10
|
+
<<: *default
|
|
11
|
+
database: <%= ENV['POSTGRES_DB'] || 'iqvoc_development' %>
|
|
9
12
|
|
|
10
13
|
test:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
encoding: unicode
|
|
14
|
-
database: <%= ENV["POSTGRES_DB"] || 'iqvoc_test' %>
|
|
15
|
-
pool: 5
|
|
16
|
-
username: <%= ENV["POSTGRES_USER"] || 'postgres' %>
|
|
17
|
-
password: <%= ENV["POSTGRES_PASSWORD"] || 'postgres' %>
|
|
14
|
+
<<: *default
|
|
15
|
+
database: <%= ENV['POSTGRES_DB'] || 'iqvoc_test' %>
|
|
18
16
|
|
|
19
17
|
production:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
encoding: unicode
|
|
23
|
-
database: <%= ENV["POSTGRES_DB"] || 'iqvoc_production' %>
|
|
24
|
-
pool: 5
|
|
25
|
-
username: <%= ENV["POSTGRES_USER"] || 'postgres' %>
|
|
26
|
-
password: <%= ENV["POSTGRES_PASSWORD"] || 'postgres' %>
|
|
18
|
+
<<: *default
|
|
19
|
+
database: <%= ENV['POSTGRES_DB'] || 'iqvoc_production' %>
|