iqvoc_skosxl 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ .entity_select {
2
+ display: inline-block;
3
+ }
@@ -0,0 +1,3 @@
1
+ /*
2
+ *= require iqvoc_skosxl/entity_select
3
+ */
@@ -15,4 +15,11 @@ module IqvocSkosxlHelper
15
15
  end
16
16
  end
17
17
 
18
+ def search_result_label(label, concept)
19
+ str = ActiveSupport::SafeBuffer.new
20
+ str << label
21
+ str << " (#{concept.additional_info})" if concept.additional_info
22
+ str
23
+ end
24
+
18
25
  end
@@ -130,15 +130,6 @@ class Label::SKOSXL::Base < Label::Base
130
130
  "partials/label/skosxl/edit_link_base"
131
131
  end
132
132
 
133
- def self.from_rdf(str)
134
- h = Iqvoc::RdfHelper.split_literal(str)
135
- self.new(:value => h[:value], :language => h[:language])
136
- end
137
-
138
- def self.from_rdf!(str)
139
- self.from_rdf(str).save!
140
- end
141
-
142
133
  def build_rdf_subject(document, controller, &block)
143
134
  ns = IqRdf::Namespace.find_namespace_class(self.rdf_namespace.to_sym)
144
135
  raise "Namespace '#{rdf_namespace}' is not defined in IqRdf document." unless ns
@@ -161,9 +152,9 @@ class Label::SKOSXL::Base < Label::Base
161
152
  end
162
153
 
163
154
  def from_rdf(str)
164
- h = Iqvoc::RdfHelper.split_literal(str)
165
- self.value = h[:value]
166
- self.language = h[:language]
155
+ raise "invalid rdf literal" unless str =~ /^"(.+)"(@(.+))$/
156
+ self.value = $1
157
+ self.language = $3
167
158
  self
168
159
  end
169
160
 
@@ -1,15 +1,19 @@
1
- <%= content_tag("li", { :class => "translation", :lang => language || nil }, true) do %>
2
- <%= label_tag(klass.name.to_relation_name,
3
- klass.model_name.human(:count => 2) + " (#{language})") %>
4
- <%= text_field_tag "concept[labelings_by_id][#{klass.name.to_relation_name}][#{language}]",
5
- concept.labelings_by_id(klass.name.to_relation_name, language),
6
- :id => "#{klass.name.to_relation_name}_#{language}",
7
- :class => "entity_select",
8
- :"data-query-url" => labels_path(:format => :json, :language => language),
9
- :"data-entity-uri" => label_path("{id}"),
10
- :"data-entities" => Iqvoc::XLLabel.base_class.editor_selectable.
11
- by_language(language).by_origin(concept.labelings_by_id(
12
- klass.name.to_relation_name, language).
13
- split(Iqvoc::InlineDataHelper::Splitter)).
14
- map { |l| label_widget_data(l) }.to_json %>
15
- <%- end -%>
1
+ <%= content_tag :div, :class => "translation", :lang => language || nil do %>
2
+ <%- fieldname = "concept[labelings_by_id][#{klass.name.to_relation_name}][#{language}]" -%>
3
+ <%- label = klass.model_name.human(:count => 2) -%>
4
+
5
+ <%= f.label label %>
6
+ <%= f.input fieldname, :wrapper => :prepend, :label => false do %>
7
+ <span class="add-on"><%= language %></span><%= text_field_tag "concept[labelings_by_id][#{klass.name.to_relation_name}][#{language}]",
8
+ concept.labelings_by_id(klass.name.to_relation_name, language),
9
+ :id => "#{klass.name.to_relation_name}_#{language}",
10
+ :class => "entity_select",
11
+ :"data-query-url" => labels_path(:format => :json, :language => language),
12
+ :"data-entity-uri" => label_path("{id}"),
13
+ :"data-entities" => Iqvoc::XLLabel.base_class.editor_selectable.
14
+ by_language(language).by_origin(concept.labelings_by_id(
15
+ klass.name.to_relation_name, language).
16
+ split(Iqvoc::InlineDataHelper::Splitter)).
17
+ map { |l| label_widget_data(l) }.to_json %>
18
+ <% end %>
19
+ <% end %>
@@ -1,9 +1,9 @@
1
- <%- if concept = result.owner -%>
1
+ <% if concept = result.owner %>
2
2
  <dt>
3
- <%= link_to highlight_query(result.target.value, params[:query]), concept_path(:id => concept) %>
3
+ <%= link_to search_result_label(highlight_query(result.target.value, params[:query]), concept), concept_path(:id => concept) %>
4
4
  </dt>
5
5
  <dd><%= t('txt.views.search_results.type') %>: <%= result.class.model_name.human %></dd>
6
- <%- if result.target.language -%>
6
+ <% if result.target.language %>
7
7
  <dd><%= t('txt.views.search_results.language') %>: <%= result.target.language %></dd>
8
- <%- end -%>
9
- <%- end -%>
8
+ <% end %>
9
+ <% end %>
@@ -3,7 +3,7 @@ en:
3
3
  views:
4
4
  layouts:
5
5
  sections:
6
- concepts: Konzepte
6
+ concepts: Concepts
7
7
  models:
8
8
  label:
9
9
  origin_invalid: Origin contains invalid characters.
@@ -1,5 +1,5 @@
1
1
  module Iqvoc
2
2
  module SKOSXL
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iqvoc_skosxl
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-05-31 00:00:00.000000000 Z
14
+ date: 2012-11-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: iqvoc
18
- requirement: &70351838150520 !ruby/object:Gem::Requirement
18
+ requirement: &70188584862520 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 4.0.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70351838150520
26
+ version_requirements: *70188584862520
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
- requirement: &70351838149880 !ruby/object:Gem::Requirement
29
+ requirement: &70188584878460 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,7 +34,7 @@ dependencies:
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70351838149880
37
+ version_requirements: *70188584878460
38
38
  description: ''
39
39
  email:
40
40
  - till.schulte-coerne@innoq.com
@@ -49,6 +49,7 @@ files:
49
49
  - iqvoc_skosxl.gemspec
50
50
  - app/assets/javascripts/iqvoc_skosxl/manifest.js
51
51
  - app/assets/javascripts/manifest.js
52
+ - app/assets/stylesheets/iqvoc_skosxl/entity_select.css
52
53
  - app/assets/stylesheets/iqvoc_skosxl/manifest.css
53
54
  - app/assets/stylesheets/manifest.css
54
55
  - app/controllers/labels/versions_controller.rb