iqvoc_skosxl 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +40 -0
- data/Gemfile.lock +154 -0
- data/README.md +26 -0
- data/Rakefile +11 -0
- data/app/assets/javascripts/iqvoc_skosxl/manifest.js +0 -0
- data/app/assets/javascripts/manifest.js +3 -0
- data/app/assets/stylesheets/iqvoc_skosxl/manifest.css +0 -0
- data/app/assets/stylesheets/manifest.css +5 -0
- data/app/controllers/labels/versions_controller.rb +109 -0
- data/app/controllers/labels_controller.rb +130 -0
- data/app/controllers/rdf_controller.rb +23 -0
- data/app/helpers/iqvoc_skosxl_helper.rb +18 -0
- data/app/helpers/labels_helper.rb +68 -0
- data/app/models/concept/skosxl/extension.rb +62 -0
- data/app/models/label/relation/base.rb +54 -0
- data/app/models/label/relation/skosxl/base.rb +12 -0
- data/app/models/label/skosxl/base.rb +219 -0
- data/app/models/labeling/skosxl/alt_label.rb +8 -0
- data/app/models/labeling/skosxl/base.rb +75 -0
- data/app/models/labeling/skosxl/hidden_label.rb +12 -0
- data/app/models/labeling/skosxl/pref_label.rb +12 -0
- data/app/views/labels/_base_data.html.erb +62 -0
- data/app/views/labels/_change_note.html.erb +46 -0
- data/app/views/labels/_details.html.erb +6 -0
- data/app/views/labels/_label_relation.html.erb +7 -0
- data/app/views/labels/_labeling.html.erb +3 -0
- data/app/views/labels/_note.html.erb +33 -0
- data/app/views/labels/_show_head.html.erb +22 -0
- data/app/views/labels/_value_and_language.html.erb +9 -0
- data/app/views/labels/edit.html.erb +22 -0
- data/app/views/labels/new.html.erb +3 -0
- data/app/views/labels/show.ttl.erb +1 -0
- data/app/views/labels/show_published.html.erb +13 -0
- data/app/views/labels/show_unpublished.html.erb +36 -0
- data/app/views/partials/label/relation/_base.html.erb +9 -0
- data/app/views/partials/label/relation/_edit_base.html.erb +13 -0
- data/app/views/partials/label/skosxl/_edit_link_base.html.erb +1 -0
- data/app/views/partials/label/skosxl/_new_link_base.html.erb +7 -0
- data/app/views/partials/labeling/skosxl/_base.html.erb +19 -0
- data/app/views/partials/labeling/skosxl/_edit_base.html.erb +15 -0
- data/app/views/partials/labeling/skosxl/_search_result.html.erb +9 -0
- data/app/views/rdf/show_label.iqrdf +5 -0
- data/config/application.rb +56 -0
- data/config/boot.rb +13 -0
- data/config/database.template.yml +38 -0
- data/config/database.yml +36 -0
- data/config/engine.rb +13 -0
- data/config/environment.rb +5 -0
- data/config/environments/development.rb +55 -0
- data/config/environments/production.rb +64 -0
- data/config/environments/test.rb +44 -0
- data/config/initializers/iqvoc.rb +4 -0
- data/config/initializers/iqvoc_skosxl.rb +1 -0
- data/config/initializers/secret_token.rb.template +9 -0
- data/config/initializers/session_store.rb +8 -0
- data/config/locales/activerecord.de.yml +18 -0
- data/config/locales/activerecord.en.yml +18 -0
- data/config/locales/de.yml +5 -0
- data/config/locales/en.yml +5 -0
- data/config/routes.rb +15 -0
- data/db/migrate/20110408121540_extend_label.rb +37 -0
- data/db/migrate/20110408123644_add_label_relations.rb +24 -0
- data/db/schema.rb +146 -0
- data/db/seeds.rb +0 -0
- data/iqvoc_skosxl.gemspec +22 -0
- data/lib/engine_tasks/db.rake +19 -0
- data/lib/iqvoc/skosxl/version.rb +5 -0
- data/lib/iqvoc/xllabel.rb +60 -0
- data/lib/iqvoc_skosxl.rb +22 -0
- data/test/factories.rb +23 -0
- data/test/integration/concept_label_language_test.rb +95 -0
- data/test/integration/dashboard_test.rb +29 -0
- data/test/integration/edit_labels_test.rb +26 -0
- data/test/integration/labels_order_test.rb +27 -0
- data/test/integration_test_helper.rb +27 -0
- data/test/test_helper.rb +15 -0
- data/test/unit/label_test.rb +30 -0
- metadata +154 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
class Labeling::SKOSXL::Base < Labeling::Base
|
2
|
+
|
3
|
+
scope :target_in_edit_mode, lambda {
|
4
|
+
includes(:target).merge(Iqvoc::XLLabel.base_class.in_edit_mode)
|
5
|
+
}
|
6
|
+
|
7
|
+
scope :by_label_origin, lambda { |origin|
|
8
|
+
includes(:target).merge(self.label_class.by_origin(origin))
|
9
|
+
}
|
10
|
+
|
11
|
+
scope :by_label_language, lambda { |language|
|
12
|
+
includes(:target).merge(self.label_class.by_language(language))
|
13
|
+
}
|
14
|
+
|
15
|
+
scope :label_editor_selectable, lambda { # Lambda because self.label_class is currently not known + we don't want to call it at load time!
|
16
|
+
includes(:target).merge(self.label_class.editor_selectable)
|
17
|
+
}
|
18
|
+
|
19
|
+
def self.create_for(o, t)
|
20
|
+
find_or_create_by_owner_id_and_target_id(o.id, t.id)
|
21
|
+
end
|
22
|
+
|
23
|
+
# FIXME: Hmm... Why should I sort labelings (not necessarily pref_labelings) by pref_label???
|
24
|
+
def <=>(other)
|
25
|
+
owner.pref_label <=> other.owner.pref_label
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.label_class
|
29
|
+
Iqvoc::XLLabel.base_class
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.single_query(params = {})
|
33
|
+
query_str = build_query_string(params)
|
34
|
+
|
35
|
+
scope = includes(:target).order("LOWER(#{Label::Base.table_name}.value)")
|
36
|
+
|
37
|
+
if params[:query].present?
|
38
|
+
scope = scope.merge(Label::Base.by_query_value(query_str).by_language(params[:languages].to_a).published)
|
39
|
+
else
|
40
|
+
scope = scope.merge(Label::Base.by_language(params[:languages].to_a).published)
|
41
|
+
end
|
42
|
+
|
43
|
+
if params[:collection_origin].present?
|
44
|
+
scope = scope.includes(:owner => { :collection_members => :collection })
|
45
|
+
scope = scope.merge(Collection::Base.where(:origin => params[:collection_origin]))
|
46
|
+
end
|
47
|
+
|
48
|
+
# Check that the included concept is in published state:
|
49
|
+
scope = scope.includes(:owner).merge(Iqvoc::Concept.base_class.published)
|
50
|
+
|
51
|
+
unless params[:collection_origin].blank?
|
52
|
+
#
|
53
|
+
end
|
54
|
+
|
55
|
+
scope
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.search_result_partial_name
|
59
|
+
'partials/labeling/skosxl/search_result'
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.partial_name(obj)
|
63
|
+
"partials/labeling/skosxl/base"
|
64
|
+
end
|
65
|
+
|
66
|
+
def self.edit_partial_name(obj)
|
67
|
+
"partials/labeling/skosxl/edit_base"
|
68
|
+
end
|
69
|
+
|
70
|
+
def build_search_result_rdf(document, result)
|
71
|
+
result.Sdc::link(IqRdf.build_uri(owner.origin))
|
72
|
+
build_rdf(document, result)
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class Labeling::SKOSXL::HiddenLabel < Labeling::SKOSXL::Base
|
2
|
+
|
3
|
+
def build_rdf(document, subject)
|
4
|
+
subject.Skosxl::hiddenLabel(IqRdf.build_uri(target.origin))
|
5
|
+
subject.Skos.hiddenLabel(target.to_s, :lang => target.language)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.view_section(obj)
|
9
|
+
"hidden"
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
class Labeling::SKOSXL::PrefLabel < Labeling::SKOSXL::Base
|
2
|
+
|
3
|
+
def build_rdf(document, subject)
|
4
|
+
subject.Skosxl::prefLabel(IqRdf.build_uri(target.origin))
|
5
|
+
subject.Skos.prefLabel(target.to_s, :lang => target.language)
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.only_one_allowed?
|
9
|
+
true
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
<h3><%= Label::Base.model_name.human %></h3>
|
2
|
+
|
3
|
+
<%= form_for @label, :as => 'label', :url => @label.new_record? ? labels_path : label_path(:id => @label, :published => 0), :html => {:class => "form"} do |f| %>
|
4
|
+
<fieldset id="label_base_data">
|
5
|
+
<legend><%= t("txt.common.attributes") %></legend>
|
6
|
+
<ol>
|
7
|
+
<li>
|
8
|
+
<label><%= t("txt.views.labels.template_form") %></label>
|
9
|
+
<%= f.text_field :value %>
|
10
|
+
</li>
|
11
|
+
<li>
|
12
|
+
<%= f.label :language %>
|
13
|
+
<%= @label.language %>
|
14
|
+
<%= f.hidden_field :language %>
|
15
|
+
</li>
|
16
|
+
|
17
|
+
<%- if Iqvoc::XLLabel.has_additional_base_data -%>
|
18
|
+
<%= render :partial => 'partials/label/additional_base_data', :locals => { :f => f } %>
|
19
|
+
<%- end -%>
|
20
|
+
|
21
|
+
<li>
|
22
|
+
<%= f.label :follow_up %>
|
23
|
+
<%= f.text_field :follow_up, :class => "datepicker" %>
|
24
|
+
</li>
|
25
|
+
<li>
|
26
|
+
<%= f.label :expired_at %>
|
27
|
+
<%= f.text_field :expired_at, :class => "datepicker" %>
|
28
|
+
</li>
|
29
|
+
</ol>
|
30
|
+
</fieldset>
|
31
|
+
|
32
|
+
<fieldset>
|
33
|
+
<legend>Relations</legend>
|
34
|
+
<ol>
|
35
|
+
<%- Iqvoc::XLLabel.relation_classes.each do |relation_class| -%>
|
36
|
+
<%= render relation_class.edit_partial_name(@label), :label => @label, :klass => relation_class %>
|
37
|
+
<%- end -%>
|
38
|
+
</ol>
|
39
|
+
</fieldset>
|
40
|
+
|
41
|
+
<%- Iqvoc::XLLabel.additional_association_classes.keys.each do |association_class| -%>
|
42
|
+
<fieldset>
|
43
|
+
<legend><%= association_class.model_name.human(:count => 2) %></legend>
|
44
|
+
<ol>
|
45
|
+
<%= render association_class.edit_partial_name(@label), :label => @label, :klass => association_class, :f => f %>
|
46
|
+
</ol>
|
47
|
+
</fieldset>
|
48
|
+
<%- end -%>
|
49
|
+
|
50
|
+
|
51
|
+
<% unless @label.new_record? %>
|
52
|
+
<% Iqvoc::XLLabel.note_classes.each do |note_class| %>
|
53
|
+
<%= render note_class.edit_partial_name(@label), :owner_klass => @label, :assoc_klass => note_class, :f => f %>
|
54
|
+
<% end %>
|
55
|
+
<% end %>
|
56
|
+
|
57
|
+
<%= f.submit t("txt.common.save") %>
|
58
|
+
|
59
|
+
<% unless controller.action_name == "new" || controller.action_name == "create" %>
|
60
|
+
<%= link_to t("txt.common.reset"), nil, :class => "button" %>
|
61
|
+
<% end %>
|
62
|
+
<% end %>
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<fieldset id="label_umt_change_note_data" class="note_relation">
|
2
|
+
<legend><%= t("txt.common.umt_change_note", :count => 2) %></legend>
|
3
|
+
<ol>
|
4
|
+
<% change_notes = @label.umt_change_notes.sort {|a,b| a.created_at <=> b.created_at } %>
|
5
|
+
<% change_notes.each do |note| %>
|
6
|
+
<li class="inline_note<%= " new" if note.new_record? %>">
|
7
|
+
<%= f.fields_for :umt_change_notes, note do |note_form| %>
|
8
|
+
<% if note == change_notes.last %>
|
9
|
+
<%= note_form.label :value, t("txt.common.umt_change_note", :count => 1) %>
|
10
|
+
<%= note_form.text_area :value, :rows => 5, :cols => 40 %>
|
11
|
+
|
12
|
+
<br />
|
13
|
+
|
14
|
+
<label><%= t("txt.common.note_annotation", :count => 2) %></label>
|
15
|
+
<textarea disabled="true" rows="3" cols="40">
|
16
|
+
<%= note.annotations.map { |na| "#{na.identifier} #{na.value}" }.join("\n") %>
|
17
|
+
</textarea>
|
18
|
+
|
19
|
+
<br />
|
20
|
+
|
21
|
+
<%= note_form.label :language, t("txt.common.language") %>
|
22
|
+
<%= note_form.select :language, options_for_language_select(note.new_record? ? @label.language : note.language) %>
|
23
|
+
|
24
|
+
<br />
|
25
|
+
<% else %>
|
26
|
+
|
27
|
+
<label><%= t("txt.common.value") %></label>
|
28
|
+
<span><%= note.value %></span>
|
29
|
+
<br/>
|
30
|
+
|
31
|
+
<% note.annotations.each do |na| %>
|
32
|
+
<label><%= na.identifier %></label>
|
33
|
+
<span><%= na.value %></span>
|
34
|
+
<br/>
|
35
|
+
<% end %>
|
36
|
+
|
37
|
+
<% end %>
|
38
|
+
|
39
|
+
<%#= note_form.check_box :"_destroy" %>
|
40
|
+
<%#= note_form.label :"_destroy", t("txt.views.labels.edit.delete") %>
|
41
|
+
<% end %>
|
42
|
+
</li>
|
43
|
+
<% end %>
|
44
|
+
</ol>
|
45
|
+
<input type="button" value="<%= t("txt.common.add_note") %>">
|
46
|
+
</fieldset>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<li>
|
2
|
+
<%= link_to(label_relation.range.value, label_path(:id => label_relation.range)) %>
|
3
|
+
<%= link_to(image_tag("note_edit.png"), edit_label_relation_path(:id => label_relation)) %>
|
4
|
+
<%= link_to(image_tag("note_delete.png"), label_relation_path(:id => label_relation),
|
5
|
+
:method => :delete,
|
6
|
+
:confirm => t("txt.views.labels.edit.delete_confirm")) %>
|
7
|
+
</li>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<fieldset id="label_<%= klass %>_data" class="note_relation">
|
2
|
+
<legend><%= t("txt.common.#{klass}", :count => 2) %></legend>
|
3
|
+
<ol>
|
4
|
+
<% @label.send(klass.pluralize).each do |note| %>
|
5
|
+
<li class="inline_note<%= " new" if note.new_record? %>">
|
6
|
+
<%= f.fields_for :"#{klass.pluralize}", note do |note_form| %>
|
7
|
+
<%= note_form.label :value, t("txt.common.#{klass}", :count => 1) %>
|
8
|
+
<%= note_form.text_area :value, :rows => 5, :cols => 40 %>
|
9
|
+
|
10
|
+
<br />
|
11
|
+
|
12
|
+
<% if klass == "umt_change_note" %>
|
13
|
+
<label><%= t("txt.common.note_annotation", :count => 2) %></label>
|
14
|
+
<textarea disabled="true" rows="3" cols="40">
|
15
|
+
<%= note.annotations.map { |na| "#{na.identifier} #{na.value}" }.join("\n") %>
|
16
|
+
</textarea>
|
17
|
+
|
18
|
+
<br />
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<%= note_form.label :language, t("txt.common.language") %>
|
22
|
+
<%= note_form.select :language, options_for_language_select(note.new_record? ? @label.language : note.language) %>
|
23
|
+
|
24
|
+
<br />
|
25
|
+
|
26
|
+
<%= note_form.check_box :"_destroy" %>
|
27
|
+
<%= note_form.label :"_destroy", t("txt.common.delete") %>
|
28
|
+
<% end %>
|
29
|
+
</li>
|
30
|
+
<% end %>
|
31
|
+
</ol>
|
32
|
+
<input type="button" value="<%= t("txt.common.add_note") %>">
|
33
|
+
</fieldset>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<%- published_param = @label.published? ? nil : 0 %>
|
2
|
+
<%= content_for :head do -%>
|
3
|
+
<link href="<%= rdf_url(@label.origin, :format => :ttl, :published => published_param, :lang => nil) %>" type="text/turtle" rel="alternate" title=""/>
|
4
|
+
<link href="<%= rdf_url(@label.origin, :format => :rdf, :published => published_param, :lang => nil) %>" type="application/rdf+xml" rel="alternate" title=""/>
|
5
|
+
<% end -%>
|
6
|
+
|
7
|
+
<h2><%= @label.class.model_name.human %>:
|
8
|
+
<%= @label.origin %>
|
9
|
+
<%- if !@label.published? %>
|
10
|
+
(<%= t('txt.common.unpublished_version') %>)
|
11
|
+
<%- end -%>
|
12
|
+
</h2>
|
13
|
+
|
14
|
+
<div id="abstract_uri">
|
15
|
+
<%= rdf_url(@label.origin, :format => nil, :published => published_param, :lang => nil) %>
|
16
|
+
(<%= link_to "Turtle", rdf_url(@label.origin, :format => :ttl, :published => published_param, :lang => nil) %>,
|
17
|
+
<%= link_to "RDF/XML", rdf_url(@label.origin, :format => :rdf, :published => published_param, :lang => nil) %>)
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<%- if @label.expired_at -%>
|
21
|
+
<h4><%= t('txt.views.concepts.expired_at', :date => l(@label.expired_at, :format => :long)) %></h4>
|
22
|
+
<%- end -%>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<%= error_messages_for @label %>
|
2
|
+
|
3
|
+
<h2><%= t("txt.views.labels.edit.header") %> <strong><%=h @label.value %></strong></h2>
|
4
|
+
|
5
|
+
<% if @association_objects_in_editing_mode.present? %>
|
6
|
+
|
7
|
+
<% if @association_objects_in_editing_mode[:label_relations].present? %>
|
8
|
+
<h4><%= t("txt.common.referenced_labels") %></h4>
|
9
|
+
<% @association_objects_in_editing_mode[:label_relations].each do |label_relation| %>
|
10
|
+
<%= label_relation.type.demodulize + ': ' + link_to(label_relation.range.value, label_path(:published => 0, :id => label_relation.range)) + user_and_phone_number(t("txt.common.editor"), label_relation.range.locking_user.name, label_relation.range.locking_user.telephone_number) %><br />
|
11
|
+
<% end %>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render :partial => "labels/base_data" %>
|
17
|
+
|
18
|
+
<%= content_for :sub_navigation do %>
|
19
|
+
<ul>
|
20
|
+
<li><%= link_to t('txt.views.navigation.back_to_preview'), label_path(:published => 0, :id => @label), :class => 'back' %></li>
|
21
|
+
</ul>
|
22
|
+
<% end %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= render_ttl_for_label(@label) %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= render 'show_head' %>
|
2
|
+
|
3
|
+
<% if can?(:read, @new_label_version) || can?(:branch, @label) %>
|
4
|
+
<div class="editing_versioning_toolbar ui-corner-all ui-widget ui-widget-content">
|
5
|
+
<% if @new_label_version.blank? && can?(:branch, @label) %>
|
6
|
+
<%= button_to t("txt.views.versioning.versioning_mode"), label_versions_branch_path(:origin => @label.origin) %>
|
7
|
+
<% elsif can?(:read, @new_label_version) %>
|
8
|
+
<%= link_to t("txt.views.versioning.preview_new_version"), label_path(:published => 0, :id => @new_label_version) %>
|
9
|
+
<% end %>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%= render 'layouts/sections', :sections => Iqvoc::XLLabel.view_sections, :data => label_view_data(@label) %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<%= render 'show_head' %>
|
2
|
+
|
3
|
+
<p class="flash_notice">
|
4
|
+
<%= t("txt.views.versioning.current_revision") %> <%= @label.rev %><% if @label.locked? %> <%= t("txt.views.versioning.in_ongoing_editing_by") %> <%= @label.locking_user.name %><% end %>
|
5
|
+
</p>
|
6
|
+
|
7
|
+
<div class="editing_versioning_toolbar ui-corner-all ui-widget ui-widget-content">
|
8
|
+
|
9
|
+
<% if (not @label.locked?) || @label.locked_by == @current_user.id %>
|
10
|
+
<%= button_to t("txt.views.versioning.publishing"),
|
11
|
+
label_versions_merge_path(:origin => @label.origin) %>
|
12
|
+
<% end %>
|
13
|
+
<%= button_to t("txt.views.versioning.consistency_check"),
|
14
|
+
label_versions_consistency_check_path(:origin => @label.origin), :method => :get %>
|
15
|
+
|
16
|
+
<% if (not @label.in_review?) && @label.locked_by == @current_user.id %>
|
17
|
+
<%= button_to t("txt.common.to_review"), label_versions_to_review_path(:origin => @label.origin) %>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<% unless @label.locked? %>
|
21
|
+
<%= button_to t("txt.views.versioning.to_edit_mode"),
|
22
|
+
label_versions_lock_path(:origin => @label.origin) %>
|
23
|
+
<%= button_to t("txt.views.versioning.delete"),
|
24
|
+
label_path(:published => 0, :id => @label.origin),
|
25
|
+
:method => :delete,
|
26
|
+
:confirm => I18n.t("txt.views.versioning.delete_confirm") %>
|
27
|
+
<% else %>
|
28
|
+
<%= button_to t("txt.views.versioning.unlock"),
|
29
|
+
label_versions_unlock_path(:origin => @label.origin) if can?(:unlock, @label) %>
|
30
|
+
<%= link_to t("txt.views.versioning.edit_mode"),
|
31
|
+
edit_label_path(:published => 0, :id => @label.origin),
|
32
|
+
:class => "button" if can?(:update, @label) %>
|
33
|
+
<% end %>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<%= render 'layouts/sections', :sections => Iqvoc::XLLabel.view_sections, :data => label_view_data(@label) %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<li>
|
2
|
+
<%= label_tag(klass.name.to_relation_name,
|
3
|
+
klass.model_name.human(:count => 2)) %>
|
4
|
+
<%= text_field_tag "label[inline_#{klass.name.to_relation_name}]",
|
5
|
+
label.send("inline_#{klass.name.to_relation_name}"),
|
6
|
+
:id => "#{klass.name.to_relation_name}",
|
7
|
+
:class => "entity_select",
|
8
|
+
:"data-query-url" => labels_path(:format => :json),
|
9
|
+
:"data-entity-uri" => label_path("{id}"),
|
10
|
+
:"data-entities" => Iqvoc::XLLabel.base_class.editor_selectable.
|
11
|
+
by_origin(label.send("inline_#{klass.name.to_relation_name}")).
|
12
|
+
map { |l| label_widget_data(l) }.to_json %>
|
13
|
+
</li>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= link_to truncate(item.value, :length => 45), (item.published? ? label_path(:id => item.origin) : label_path(:published => 0, :id => item.origin)) %> (<%= item.language %>)
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<%- if can?(:create, Iqvoc::XLLabel.base_class) -%>
|
2
|
+
<%= t("txt.views.labels.new") %>
|
3
|
+
(<%- Iqvoc::Concept::labeling_class_names.values.flatten.uniq.each do |language| -%>
|
4
|
+
<%= link_to language.to_s,
|
5
|
+
new_label_path(:published => 0, :language => language) %>
|
6
|
+
<%- end -%>)
|
7
|
+
<%- end -%>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<%= content_tag("div", { :class => "relation translation", :lang => defined?(concept) ? lang || nil : nil }, true) do %>
|
2
|
+
<%- if defined?(concept) -%>
|
3
|
+
<h4><%= klass.model_name.human(:count => 2) %> (<%= lang %>)</h4>
|
4
|
+
<div class="relation-body">
|
5
|
+
<%= item_listing(concept.labels_for_labeling_class_and_language(klass, lang.to_s)) do |label|
|
6
|
+
link_to label.value, label_path(:id => label)
|
7
|
+
end
|
8
|
+
%>
|
9
|
+
</div>
|
10
|
+
<%- elsif defined?(label) -%>
|
11
|
+
<h4><%= klass.model_name.human %> <%= t("txt.common.of") %></h4>
|
12
|
+
<div class="relation">
|
13
|
+
<%= item_listing(label.concepts_for_labeling_class(klass)) do |c|
|
14
|
+
link_to c.to_s, concept_path(:id => c)
|
15
|
+
end
|
16
|
+
%>
|
17
|
+
</div>
|
18
|
+
<%- end -%>
|
19
|
+
<%- end -%>
|