iqvoc 3.2.7 → 3.2.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,7 @@ module ConceptsHelper
18
18
 
19
19
  # if `broader` is supplied, the tree's direction is reversed (descendants represent broader relations)
20
20
  def treeview(concepts, broader = false)
21
+ concepts = concepts.sort { |a, b| a.pref_label.to_s <=> b.pref_label.to_s }
21
22
  render :partial => "concepts/hierarchical/treeview",
22
23
  :locals => { :concepts => concepts, :broader => broader }
23
24
  end
data/config/database.yml CHANGED
@@ -1,9 +1,16 @@
1
+ # development:
2
+ # adapter: postgresql
3
+ # encoding: unicode
4
+ # database: iqvoc_development
5
+ # username: iqvoc
6
+ # password:
7
+ # pool: 5
8
+
1
9
  development:
2
10
  adapter: mysql2
3
11
  encoding: utf8
4
12
  reconnect: false
5
13
  database: iqvoc_development
6
- pool: 5
7
14
  username: root
8
15
  password:
9
16
  hostname: 127.0.0.1
@@ -13,7 +20,6 @@ test:
13
20
  encoding: utf8
14
21
  reconnect: false
15
22
  database: iqvoc_test
16
- pool: 5
17
23
  username: root
18
24
  password:
19
25
  hostname: 127.0.0.1
@@ -23,7 +29,6 @@ production:
23
29
  encoding: utf8
24
30
  reconnect: false
25
31
  database: iqvoc_development
26
- pool: 5
27
32
  username: root
28
33
  password:
29
34
  hostname: 127.0.0.1
@@ -25,6 +25,6 @@ if Iqvoc.const_defined?(:Application)
25
25
 
26
26
  # Run `rake secret` and uncomment the following line
27
27
  # Replace the secret-placeholder with your generated token
28
- Iqvoc::Application.config.secret_token = '17d06ea2c1b5aceb4274a466a83d3b063094ecb22826c82af3572740bf2d61b30f756f1aea5e6c845ad5c078265065c8748760e655da7f6425a11bbf22ec8007'
28
+ Iqvoc::Application.config.secret_token = 'ef1f801c911b45ded2944aad3121244bfabf231631d102e6e120da8639c47eb6aa4ae7df733f0d539951cbc4e399e6050f46bc279d6a85d57135688394b87c5a'
29
29
 
30
30
  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 => 20120201120736) do
14
+ ActiveRecord::Schema.define(:version => 20120601094501) do
15
15
 
16
16
  create_table "collection_members", :force => true do |t|
17
17
  t.integer "collection_id"
@@ -27,6 +27,7 @@ ActiveRecord::Schema.define(:version => 20120201120736) do
27
27
  t.integer "target_id"
28
28
  t.datetime "created_at"
29
29
  t.datetime "updated_at"
30
+ t.integer "rank", :default => 100
30
31
  end
31
32
 
32
33
  add_index "concept_relations", ["owner_id", "target_id"], :name => "ix_concept_relations_fk"
@@ -116,6 +117,15 @@ ActiveRecord::Schema.define(:version => 20120201120736) do
116
117
  add_index "notes", ["owner_id", "owner_type", "type"], :name => "ix_notes_fk_type"
117
118
  add_index "notes", ["type"], :name => "ix_notes_on_type"
118
119
 
120
+ create_table "page_requests", :force => true do |t|
121
+ t.string "path"
122
+ t.float "page_duration"
123
+ t.float "view_duration"
124
+ t.float "db_duration"
125
+ t.datetime "created_at", :null => false
126
+ t.datetime "updated_at", :null => false
127
+ end
128
+
119
129
  create_table "users", :force => true do |t|
120
130
  t.string "forename"
121
131
  t.string "surname"
data/lib/iqvoc/version.rb CHANGED
@@ -15,5 +15,5 @@
15
15
  # limitations under the License.
16
16
 
17
17
  module Iqvoc
18
- VERSION = "3.2.7"
18
+ VERSION = "3.2.8"
19
19
  end
@@ -2,132 +2,144 @@
2
2
  /*global jQuery, IQVOC */
3
3
 
4
4
  jQuery(document).ready(function($) {
5
- "use strict";
5
+ "use strict";
6
6
 
7
- var locale = $("head meta[name=i18n-locale]").attr("content");
7
+ var locale = $("head meta[name=i18n-locale]").attr("content");
8
8
 
9
- IQVOC.enhancedDropdown(".menu");
10
- IQVOC.dynamicAuth("#auth_controls");
9
+ IQVOC.enhancedDropdown(".menu");
10
+ IQVOC.dynamicAuth("#auth_controls");
11
11
 
12
- if(IQVOC.visualization) {
13
- IQVOC.visualization.init("infovis", function(container) {
14
- if(IQVOC.Storage.getItem("visualization") === "enlarged") {
15
- container.data("widget").toggleSize(true);
16
- }
17
- });
18
- }
12
+ if(IQVOC.visualization) {
13
+ IQVOC.visualization.init("infovis", function(container) {
14
+ if(IQVOC.Storage.getItem("visualization") === "enlarged") {
15
+ container.data("widget").toggleSize(true);
16
+ }
17
+ });
18
+ }
19
19
 
20
- // language selection
21
- var langWidget = $("ul.lang-widget")[0];
22
- // primary language (converting links to radio buttons)
23
- $("a", langWidget).each(function(i, node) {
24
- var link = $(node),
25
- el = link.closest("li"),
26
- btn = $('<input type="radio" name="primary_language">');
27
- if(link.hasClass("current")) {
28
- btn[0].checked = true;
29
- }
30
- var label = $("<label />").append(btn).append(link);
31
- el.append(label);
32
- return label[0];
33
- });
34
- $("input:radio", langWidget).live("change", function(ev) {
35
- window.location = $(this).closest("label").find("a").attr("href");
36
- });
37
- // secondary language
38
- var toggleSections = function(langSelected) {
39
- $(".translation[lang]").each(function(i, node) {
40
- var el = $(node),
41
- lang = el.attr("lang");
42
- if(lang !== locale && $.inArray(lang, langSelected) === -1) {
43
- el.addClass("hidden");
44
- } else {
45
- el.removeClass("hidden");
46
- }
47
- });
48
- };
49
- var updateNoteLangs = function(langSelected) {
50
- $(".inline_note.new select").each(function(i, sel) { // NB: new notes only!
51
- $(sel).find("option").each(function(i, opt) {
52
- var el = $(opt),
53
- lang = el.val();
54
- if(lang !== locale && $.inArray(lang, langSelected) === -1) {
55
- el.remove();
56
- }
57
- });
58
- });
59
- };
60
- $(document).bind("lang_selected", function(ev, data) {
61
- toggleSections(data.langs);
62
- updateNoteLangs(data.langs);
63
- });
64
- var langSelector = new IQVOC.LanguageSelector(langWidget, "lang_selected");
65
- if($("#concept_new, #concept_edit").length) { // edit mode
66
- // disable secondary language selection to avoid excessive state complexity
67
- $(":checkbox", langSelector.container).prop("disabled", true);
68
- }
20
+ // language selection
21
+ var langWidget = $("ul.lang-widget")[0];
22
+ // primary language (converting links to radio buttons)
23
+ $("a", langWidget).each(function(i, node) {
24
+ var link = $(node),
25
+ el = link.closest("li"),
26
+ btn = $('<input type="radio" name="primary_language">');
27
+ if(link.hasClass("current")) {
28
+ btn[0].checked = true;
29
+ }
30
+ var label = $("<label />").append(btn).append(link);
31
+ el.append(label);
32
+ return label[0];
33
+ });
34
+ $("input:radio", langWidget).live("change", function(ev) {
35
+ window.location = $(this).closest("label").find("a").attr("href");
36
+ });
37
+ // secondary language
38
+ var toggleSections = function(langSelected) {
39
+ $(".translation[lang]").each(function(i, node) {
40
+ var el = $(node),
41
+ lang = el.attr("lang");
42
+ if(lang !== locale && $.inArray(lang, langSelected) === -1) {
43
+ el.addClass("hidden");
44
+ } else {
45
+ el.removeClass("hidden");
46
+ }
47
+ });
48
+ };
49
+ var updateNoteLangs = function(langSelected) {
50
+ $(".inline_note.new select").each(function(i, sel) { // NB: new notes only!
51
+ $(sel).find("option").each(function(i, opt) {
52
+ var el = $(opt),
53
+ lang = el.val();
54
+ if(lang !== locale && $.inArray(lang, langSelected) === -1) {
55
+ el.remove();
56
+ }
57
+ });
58
+ });
59
+ };
60
+ $(document).bind("lang_selected", function(ev, data) {
61
+ toggleSections(data.langs);
62
+ updateNoteLangs(data.langs);
63
+ });
64
+ var langSelector = new IQVOC.LanguageSelector(langWidget, "lang_selected");
65
+ if($("#concept_new, #concept_edit").length) { // edit mode
66
+ // disable secondary language selection to avoid excessive state complexity
67
+ $(":checkbox", langSelector.container).prop("disabled", true);
68
+ }
69
69
 
70
- // entity selection (edit mode)
71
- $("input.entity_select").each(function(i, node) {
72
- IQVOC.EntitySelector(node);
73
- });
70
+ // entity selection (edit mode)
71
+ $("input.entity_select").each(function(i, node) {
72
+ IQVOC.EntitySelector(node);
73
+ });
74
74
 
75
- // Label editing (inline notes)
76
- $("fieldset.note_relation ol li.inline_note.new").hide();
77
- $("fieldset.note_relation input[type=button]").click(function(ev) {
78
- IQVOC.createNote.apply(this, arguments);
79
- langSelector.notify(); // trigger updateNoteLangs -- XXX: hacky!?
80
- });
81
- $("li.inline_note input:checkbox").change(function(ev) {
82
- var action = this.checked ? "addClass" : "removeClass";
83
- $(this).closest("li")[action]("deleted");
84
- });
75
+ // Label editing (inline notes)
76
+ $("fieldset.note_relation ol li.inline_note.new").hide();
77
+ $("fieldset.note_relation input[type=button]").click(function(ev) {
78
+ IQVOC.createNote.apply(this, arguments);
79
+ langSelector.notify(); // trigger updateNoteLangs -- XXX: hacky!?
80
+ });
81
+ $("li.inline_note input:checkbox").change(function(ev) {
82
+ var action = this.checked ? "addClass" : "removeClass";
83
+ $(this).closest("li")[action]("deleted");
84
+ });
85
85
 
86
- // Datepicker
87
- $.datepicker.setDefaults($.datepicker.regional[locale]);
88
- $("input.datepicker").datepicker({ dateFormat: "yy-mm-dd" });
86
+ // Datepicker
87
+ $.datepicker.setDefaults($.datepicker.regional[locale]);
88
+ $("input.datepicker").datepicker({ dateFormat: "yy-mm-dd" });
89
89
 
90
- // Dashboard table row highlighting and click handling
91
- $("tr.highlightable")
92
- .hover(function(ev) {
93
- var action = ev.type === "mouseenter" ? "addClass" : "removeClass";
94
- $(this)[action]("hover");
95
- })
96
- .click(function(ev) {
97
- window.location = $(this).attr("data-url");
98
- });
90
+ // Dashboard table row highlighting and click handling
91
+ $("tr.highlightable")
92
+ .hover(function(ev) {
93
+ var action = ev.type === "mouseenter" ? "addClass" : "removeClass";
94
+ $(this)[action]("hover");
95
+ })
96
+ .click(function(ev) {
97
+ window.location = $(this).attr("data-url");
98
+ });
99
99
 
100
- // Search
101
- $("button#language_select_all").click(function() {
102
- $("input[type=checkbox].lang_check").attr("checked", true);
103
- });
104
- $("button#language_select_none").click(function() {
105
- $("input[type=checkbox].lang_check").attr("checked", false);
106
- });
107
- $("select.search_type").change(function() {
108
- var result_type_filter = $("li.result_type_filter");
109
- if($(this).val().match(/labeling/)) {
110
- result_type_filter.show();
111
- }
112
- else {
113
- result_type_filter.hide();
114
- }
115
- });
116
- $("select.search_type").change();
100
+ // Search
101
+ $("button#language_select_all").click(function() {
102
+ $("input[type=checkbox].lang_check").attr("checked", true);
103
+ });
104
+ $("button#language_select_none").click(function() {
105
+ $("input[type=checkbox].lang_check").attr("checked", false);
106
+ });
107
+ $("select.search_type").change(function() {
108
+ var result_type_filter = $("li.result_type_filter");
109
+ if($(this).val().match(/labeling/)) {
110
+ result_type_filter.show();
111
+ }
112
+ else {
113
+ result_type_filter.hide();
114
+ }
115
+ });
116
+ $("select.search_type").change();
117
117
 
118
- // hierarchical tree view
119
- $("ul.hybrid-treeview").each(function() {
120
- var url = $(this).attr("data-url"),
121
- container = this;
122
- $(this).treeview({
123
- collapsed: true,
124
- toggle: function() {
125
- var el = $(this);
126
- if(el.hasClass("hasChildren")) {
127
- var childList = el.removeClass("hasChildren").find("ul");
128
- $.fn.treeviewLoad({ url: url }, this.id, childList, container);
129
- }
130
- }
131
- });
132
- });
118
+ // hierarchical tree view
119
+ $("ul.hybrid-treeview").each(function() {
120
+ var url = $(this).attr("data-url"),
121
+ container = this;
122
+ $(this).treeview({
123
+ collapsed: true,
124
+ toggle: function() {
125
+ var el = $(this);
126
+ if(el.hasClass("hasChildren")) {
127
+ var childList = el.removeClass("hasChildren").find("ul");
128
+
129
+ var sortedItems = $(childList).children();
130
+ sortedItems.sort(function(a, b) {
131
+ var nameA = a.find("a").text(), nameB = b.find("a").text();
132
+ if (nameA < nameB) // sort string ascending
133
+ return -1
134
+ if (nameA > nameB)
135
+ return 1
136
+ return 0 // default return value (no sorting)
137
+ })
138
+ $(childList).empty().append(sortedItems);
139
+
140
+ $.fn.treeviewLoad({ url: url }, this.id, childList, container);
141
+ }
142
+ }
143
+ });
144
+ });
133
145
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iqvoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.7
4
+ version: 3.2.8
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-02-07 00:00:00.000000000 Z
14
+ date: 2012-07-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
18
- requirement: &70182803396680 !ruby/object:Gem::Requirement
18
+ requirement: &70201195576640 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 3.0.9
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *70182803396680
26
+ version_requirements: *70201195576640
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
- requirement: &70182803396020 !ruby/object:Gem::Requirement
29
+ requirement: &70201195576240 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *70182803396020
37
+ version_requirements: *70201195576240
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: kaminari
40
- requirement: &70182803394520 !ruby/object:Gem::Requirement
40
+ requirement: &70201195575780 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *70182803394520
48
+ version_requirements: *70201195575780
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: authlogic
51
- requirement: &70182803391860 !ruby/object:Gem::Requirement
51
+ requirement: &70201195605560 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '0'
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *70182803391860
59
+ version_requirements: *70201195605560
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: cancan
62
- requirement: &70182803390640 !ruby/object:Gem::Requirement
62
+ requirement: &70201195605140 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ! '>='
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '0'
68
68
  type: :runtime
69
69
  prerelease: false
70
- version_requirements: *70182803390640
70
+ version_requirements: *70201195605140
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: iq_rdf
73
- requirement: &70182803390040 !ruby/object:Gem::Requirement
73
+ requirement: &70201195604640 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ~>
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: 0.0.14
79
79
  type: :runtime
80
80
  prerelease: false
81
- version_requirements: *70182803390040
81
+ version_requirements: *70201195604640
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: json
84
- requirement: &70182803389140 !ruby/object:Gem::Requirement
84
+ requirement: &70201195604220 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,7 +89,7 @@ dependencies:
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
- version_requirements: *70182803389140
92
+ version_requirements: *70201195604220
93
93
  description: iQvoc - a SKOS(-XL) vocabulary management system built on the Semantic
94
94
  Web
95
95
  email:
@@ -242,7 +242,6 @@ files:
242
242
  - config/database.yml
243
243
  - config/database.yml.mysql
244
244
  - config/database.yml.sqlite
245
- - config/deploy.rb
246
245
  - config/engine.rb
247
246
  - config/environment.rb
248
247
  - config/environments/development.rb
@@ -481,7 +480,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
481
480
  version: '0'
482
481
  requirements: []
483
482
  rubyforge_project:
484
- rubygems_version: 1.8.10
483
+ rubygems_version: 1.8.11
485
484
  signing_key:
486
485
  specification_version: 3
487
486
  summary: iQvoc
data/config/deploy.rb DELETED
@@ -1,72 +0,0 @@
1
- # encoding: UTF-8
2
-
3
- # Copyright 2011 innoQ Deutschland GmbH
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # http://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- require "#{File.dirname(__FILE__)}/deploy/history"
18
- load_history
19
-
20
- load "#{File.dirname(__FILE__)}/deploy/common.rb"
21
-
22
- set :default_stage, "innoq"
23
- set :stages, %w(ec2 innoq bian)
24
- require 'capistrano/ext/multistage'
25
-
26
- # RVM bootstrap
27
- $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
28
- require 'rvm/capistrano'
29
- set :rvm_ruby_string, '1.9.3'
30
- # set :rvm_type, :user
31
-
32
- # bundler bootstrap
33
- require 'bundler/capistrano'
34
-
35
- # main details
36
- set :application, "iqvoc"
37
-
38
- # repo details
39
- set :scm, :git
40
- set :git_enable_submodules, 1
41
- # set :scm_username, "passenger"
42
- set :repository, "git@github.com:innoq/iqvoc.git"
43
- @capistrano_history['last_branch'] = "master" if @capistrano_history['last_branch'].nil? || @capistrano_history['last_branch'] == ""
44
- set :branch, Capistrano::CLI.ui.ask("Please enter the branch or tag we should use [#{@capistrano_history['last_branch']}]: ")
45
- set :branch, @capistrano_history['last_branch'] if fetch(:branch) == ""
46
- @capistrano_history['last_branch'] = fetch(:branch)
47
-
48
- save_history
49
-
50
- # tasks
51
- namespace :deploy do
52
- task :start, :roles => :app do
53
- run "touch #{current_path}/tmp/restart.txt"
54
- end
55
-
56
- task :stop, :roles => :app do
57
- # Do nothing.
58
- end
59
-
60
- desc "Restart Application"
61
- task :restart, :roles => :app do
62
- run "touch #{current_path}/tmp/restart.txt"
63
- end
64
-
65
- desc "Symlink shared resources on each release"
66
- task :symlink_shared, :roles => :app do
67
- run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
68
- run "ln -nfs #{shared_path}/config/initializers/secret_token.rb #{release_path}/config/initializers/secret_token.rb"
69
- end
70
- end
71
-
72
- after 'deploy:update_code', 'deploy:symlink_shared'