iqvoc 3.4.0 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. data/CHANGELOG.md +5 -0
  2. data/Gemfile +5 -4
  3. data/Gemfile.lock +54 -27
  4. data/app/assets/javascripts/framework.js +0 -1
  5. data/app/assets/stylesheets/iqvoc/forms.css.erb +5 -1
  6. data/app/controllers/application_controller.rb +4 -107
  7. data/app/controllers/concepts/hierarchical_controller.rb +11 -12
  8. data/app/controllers/concepts/untranslated_controller.rb +1 -1
  9. data/app/controllers/instance_configuration_controller.rb +103 -0
  10. data/app/controllers/search_results_controller.rb +4 -3
  11. data/app/helpers/application_helper.rb +1 -1
  12. data/app/helpers/concepts_helper.rb +1 -1
  13. data/app/models/configuration_setting.rb +22 -0
  14. data/app/views/instance_configuration/index.html.erb +15 -0
  15. data/app/views/layouts/_controls.html.erb +3 -3
  16. data/app/views/layouts/_header.html.erb +1 -1
  17. data/app/views/layouts/_navigation.html.erb +6 -1
  18. data/app/views/layouts/application.html.erb +11 -4
  19. data/config/blazing.rb +36 -0
  20. data/config/database.yml +3 -16
  21. data/config/deploy.rb +1 -1
  22. data/config/engine.rb +8 -0
  23. data/config/environments/development.rb +2 -60
  24. data/config/environments/heroku.rb +1 -1
  25. data/config/environments/production.rb +2 -60
  26. data/config/environments/test.rb +2 -45
  27. data/config/initializers/iqvoc.rb +2 -12
  28. data/config/initializers/secret_token.rb +3 -1
  29. data/config/locales/de.yml +8 -0
  30. data/config/locales/en.yml +8 -0
  31. data/config/routes.rb +7 -1
  32. data/db/migrate/20120119000000_create_configuration_settings.rb +14 -0
  33. data/lib/debug.rb +4 -4
  34. data/lib/iqvoc.rb +11 -219
  35. data/lib/iqvoc/ability.rb +2 -1
  36. data/lib/iqvoc/configuration/collection.rb +22 -0
  37. data/lib/iqvoc/configuration/concept.rb +152 -0
  38. data/lib/iqvoc/configuration/core.rb +135 -0
  39. data/lib/iqvoc/configuration/label.rb +23 -0
  40. data/lib/iqvoc/controller_extensions.rb +115 -0
  41. data/lib/iqvoc/environments/development.rb +66 -0
  42. data/lib/iqvoc/environments/production.rb +64 -0
  43. data/lib/iqvoc/environments/test.rb +52 -0
  44. data/lib/iqvoc/instance_configuration.rb +122 -0
  45. data/lib/iqvoc/version.rb +1 -1
  46. data/public/assets/ajax-loader-5c1bf2208bffabddfb583013023b2b11.gif +0 -0
  47. data/public/assets/ajax-loader.gif +0 -0
  48. data/public/assets/arrow_down-e1f4aacd91274ce8d4db40d8b4ad781f.gif +0 -0
  49. data/public/assets/arrow_down.gif +0 -0
  50. data/public/assets/arrow_up-a48d7a55002e97f1b70e0e957edf3964.gif +0 -0
  51. data/public/assets/arrow_up.gif +0 -0
  52. data/public/assets/back-ffd41b7924770324ead91a4eb51604f6.png +0 -0
  53. data/public/assets/back.png +0 -0
  54. data/public/assets/blueprint/ie-d2ff4b1cc209dc6b08716b5e0098e106.css +36 -0
  55. data/public/assets/blueprint/ie-d2ff4b1cc209dc6b08716b5e0098e106.css.gz +0 -0
  56. data/public/assets/blueprint/ie.css +36 -0
  57. data/public/assets/blueprint/ie.css.gz +0 -0
  58. data/public/assets/blueprint/print-799a53ff649d9f14baf5f5fe643d04c4.css +30 -0
  59. data/public/assets/blueprint/print-799a53ff649d9f14baf5f5fe643d04c4.css.gz +0 -0
  60. data/public/assets/blueprint/print.css +30 -0
  61. data/public/assets/blueprint/print.css.gz +0 -0
  62. data/public/assets/blueprint/screen-d721f98ceac371a9294fc6f091ca1cb5.css +259 -0
  63. data/public/assets/blueprint/screen-d721f98ceac371a9294fc6f091ca1cb5.css.gz +0 -0
  64. data/public/assets/blueprint/screen.css +259 -0
  65. data/public/assets/blueprint/screen.css.gz +0 -0
  66. data/public/assets/branch-c950c8ac69ee2f753f86a75d944aa976.png +0 -0
  67. data/public/assets/branch.png +0 -0
  68. data/public/assets/categ-e1e1a5958017a5586456895785298c89.png +0 -0
  69. data/public/assets/categ.png +0 -0
  70. data/public/assets/categ_open-de616238db93a0645b4c4a2cdd4eece4.png +0 -0
  71. data/public/assets/categ_open.png +0 -0
  72. data/public/assets/excanvas-1f8c36f3578409126862b5c17e59b9bd.js +14 -0
  73. data/public/assets/excanvas-1f8c36f3578409126862b5c17e59b9bd.js.gz +0 -0
  74. data/public/assets/excanvas.js +14 -0
  75. data/public/assets/excanvas.js.gz +0 -0
  76. data/public/assets/file-48364459f087292aafa11168442bde71.gif +0 -0
  77. data/public/assets/file.gif +0 -0
  78. data/public/assets/folder-7e0f370ab3fcca5deab89784db42da4a.gif +0 -0
  79. data/public/assets/folder-closed-cb6c847cac4dea2cb59c98ecfc76b8ae.gif +0 -0
  80. data/public/assets/folder-closed.gif +0 -0
  81. data/public/assets/folder.gif +0 -0
  82. data/public/assets/footer-ea48e7e96122c8ab345da8ff67f29838.png +0 -0
  83. data/public/assets/footer.png +0 -0
  84. data/public/assets/go_there-ee7df641e73ef83e43180dbc07c40540.png +0 -0
  85. data/public/assets/go_there.png +0 -0
  86. data/public/assets/header_long-5c7970b5911f94433a696ae87918ecb0.png +0 -0
  87. data/public/assets/header_long.png +0 -0
  88. data/public/assets/iqvoc-ff2c5252d9877c38297164984d4a7a55.png +0 -0
  89. data/public/assets/iqvoc.png +0 -0
  90. data/public/assets/iqvoc/ie_fixes-7797396e9cd2f32961f56af18bacd33a.css +7 -0
  91. data/public/assets/iqvoc/ie_fixes-7797396e9cd2f32961f56af18bacd33a.css.gz +0 -0
  92. data/public/assets/iqvoc/ie_fixes.css +7 -0
  93. data/public/assets/iqvoc/ie_fixes.css.gz +0 -0
  94. data/public/assets/iqvoc/visualization-49b198ac7d8bc15fa13eafc528e96081.js +4 -0
  95. data/public/assets/iqvoc/visualization-49b198ac7d8bc15fa13eafc528e96081.js.gz +0 -0
  96. data/public/assets/iqvoc/visualization.js +4 -0
  97. data/public/assets/iqvoc/visualization.js.gz +0 -0
  98. data/public/assets/jit_rgraph-63bc6fa01820d73bb4076f2f62493e66.js +25 -0
  99. data/public/assets/jit_rgraph-63bc6fa01820d73bb4076f2f62493e66.js.gz +0 -0
  100. data/public/assets/jit_rgraph.js +25 -0
  101. data/public/assets/jit_rgraph.js.gz +0 -0
  102. data/public/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100-951e2a65945b93d3f69c1994e5672f39.png +0 -0
  103. data/public/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  104. data/public/assets/jquery-ui/ui-bg_flat_55_fbec88_40x100-befbc2de63b9556a093c0a5bb2e08a95.png +0 -0
  105. data/public/assets/jquery-ui/ui-bg_flat_55_fbec88_40x100.png +0 -0
  106. data/public/assets/jquery-ui/ui-bg_glass_75_d0e5f5_1x400-faa3341c6543985d2c94bd65e36bd6d8.png +0 -0
  107. data/public/assets/jquery-ui/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  108. data/public/assets/jquery-ui/ui-bg_glass_85_dfeffc_1x400-df1d30b336ee1530edc334458abd2417.png +0 -0
  109. data/public/assets/jquery-ui/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  110. data/public/assets/jquery-ui/ui-bg_glass_95_fef1ec_1x400-5767880afddd9b98f4b4cfd43a09947b.png +0 -0
  111. data/public/assets/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  112. data/public/assets/jquery-ui/ui-bg_gloss-wave_55_5c9ccc_500x100-c563cdeeac0f1479b69e36b21d785ac4.png +0 -0
  113. data/public/assets/jquery-ui/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  114. data/public/assets/jquery-ui/ui-bg_inset-hard_100_f5f8f9_1x100-b837a3b8315a7ff270664ce469f2e6d7.png +0 -0
  115. data/public/assets/jquery-ui/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  116. data/public/assets/jquery-ui/ui-bg_inset-hard_100_fcfdfd_1x100-b5d3cda0e6142534937f71cf4438e28a.png +0 -0
  117. data/public/assets/jquery-ui/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  118. data/public/assets/jquery-ui/ui-icons_217bc0_256x240-14e62c24f88d00f227d88e5b16406eec.png +0 -0
  119. data/public/assets/jquery-ui/ui-icons_217bc0_256x240.png +0 -0
  120. data/public/assets/jquery-ui/ui-icons_2e83ff_256x240-c15e521f58d397c2fa31f4214f92a399.png +0 -0
  121. data/public/assets/jquery-ui/ui-icons_2e83ff_256x240.png +0 -0
  122. data/public/assets/jquery-ui/ui-icons_469bdd_256x240-aceccf3311e1b369e71a4ac629953d61.png +0 -0
  123. data/public/assets/jquery-ui/ui-icons_469bdd_256x240.png +0 -0
  124. data/public/assets/jquery-ui/ui-icons_6da8d5_256x240-18148340aba4ce354c9d52c5aa2f5c0c.png +0 -0
  125. data/public/assets/jquery-ui/ui-icons_6da8d5_256x240.png +0 -0
  126. data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240-279edbd373e73b1ecd1ea7a6ba19750d.png +0 -0
  127. data/public/assets/jquery-ui/ui-icons_cd0a0a_256x240.png +0 -0
  128. data/public/assets/jquery-ui/ui-icons_d8e7f3_256x240-732b446e2e1d4f4fec4277e2632a9adf.png +0 -0
  129. data/public/assets/jquery-ui/ui-icons_d8e7f3_256x240.png +0 -0
  130. data/public/assets/jquery-ui/ui-icons_f9bd01_256x240-1ee933e5956743f5607f2075ed21fac5.png +0 -0
  131. data/public/assets/jquery-ui/ui-icons_f9bd01_256x240.png +0 -0
  132. data/public/assets/json2-fdda51ffce29dd4cb684dc7bd0aede01.js +157 -0
  133. data/public/assets/json2-fdda51ffce29dd4cb684dc7bd0aede01.js.gz +0 -0
  134. data/public/assets/json2.js +157 -0
  135. data/public/assets/json2.js.gz +0 -0
  136. data/public/assets/leaf_end-2ac151e8d7b4928bacb557f96cb5b517.png +0 -0
  137. data/public/assets/leaf_end.png +0 -0
  138. data/public/assets/leaf_end_filled-cdb0eb9ce60425bf0a1fd12226e502eb.png +0 -0
  139. data/public/assets/leaf_end_filled.png +0 -0
  140. data/public/assets/leaf_mid-966f99acaeaddfaedb6b602eb1eed7e0.png +0 -0
  141. data/public/assets/leaf_mid.png +0 -0
  142. data/public/assets/leaf_mid_filled-fecf059c72a649fe77052a886fb030d5.png +0 -0
  143. data/public/assets/leaf_mid_filled.png +0 -0
  144. data/public/assets/leaf_nothing-e8b5532117e55a184d93e8bf66afa20a.png +0 -0
  145. data/public/assets/leaf_nothing.png +0 -0
  146. data/public/assets/leaf_only-e4fe523e451ad9dea6bba08b44cf8039.png +0 -0
  147. data/public/assets/leaf_only.png +0 -0
  148. data/public/assets/leaf_only_filled-7b9a97903759b89facd5fb2e03ba14d1.png +0 -0
  149. data/public/assets/leaf_only_filled.png +0 -0
  150. data/public/assets/leaf_top-61fbce4d3adf2235964e828647a52149.png +0 -0
  151. data/public/assets/leaf_top.png +0 -0
  152. data/public/assets/leaf_top_filled-003d96425167d3b74e63eb75e12d163e.png +0 -0
  153. data/public/assets/leaf_top_filled.png +0 -0
  154. data/public/assets/manifest-c08ebf92c2ea89fbce8705f984a7c604.css +1139 -0
  155. data/public/assets/manifest-c08ebf92c2ea89fbce8705f984a7c604.css.gz +0 -0
  156. data/public/assets/manifest-c6d880245ce63929a5842e48cb7c65f2.js +21 -0
  157. data/public/assets/manifest-c6d880245ce63929a5842e48cb7c65f2.js.gz +0 -0
  158. data/public/assets/manifest.css +1139 -0
  159. data/public/assets/manifest.css.gz +0 -0
  160. data/public/assets/manifest.js +21 -0
  161. data/public/assets/manifest.js.gz +0 -0
  162. data/public/assets/manifest.yml +73 -0
  163. data/public/assets/minus-633f45b71e7552c36214c9d81fce94b0.gif +0 -0
  164. data/public/assets/minus.gif +0 -0
  165. data/public/assets/nothing-19b9650c540a8776b047d6dde27687b0.png +0 -0
  166. data/public/assets/nothing.png +0 -0
  167. data/public/assets/ok-96195c6d50075a63cbdfa11818301f56.png +0 -0
  168. data/public/assets/ok.png +0 -0
  169. data/public/assets/plus-dd3920a86d5ea72497854d875c6afc00.gif +0 -0
  170. data/public/assets/plus.gif +0 -0
  171. data/public/assets/rdf_flyer-b2cc2d8b2a537a9c74b39450f8e6b16f.gif +0 -0
  172. data/public/assets/rdf_flyer.gif +0 -0
  173. data/public/assets/red_arrow-875d1bca1c4b97ec82635af86032a024.png +0 -0
  174. data/public/assets/red_arrow.png +0 -0
  175. data/public/assets/shadow-2975795dc944082531617a0c3ad2da70.png +0 -0
  176. data/public/assets/shadow.png +0 -0
  177. data/public/assets/spinner-0b76e32ff4e68b1e8789b4d0fe991cd7.gif +0 -0
  178. data/public/assets/spinner.gif +0 -0
  179. data/public/assets/tokenizer_delete-94c9b41ce566e499de2090b552e0d167.png +0 -0
  180. data/public/assets/tokenizer_delete.png +0 -0
  181. data/public/assets/tokenizer_pencile-b508830af36466f05620d83c544b22ff.png +0 -0
  182. data/public/assets/tokenizer_pencile.png +0 -0
  183. data/public/assets/tokenizer_show-152443b9a6c0b058cfb51c51f567116f.png +0 -0
  184. data/public/assets/tokenizer_show.png +0 -0
  185. data/public/assets/top_01-fab0825c0529e87fddf883074490dc19.png +0 -0
  186. data/public/assets/top_01.png +0 -0
  187. data/public/assets/treeview-black-116394dbf5afda75949a9925de790795.gif +0 -0
  188. data/public/assets/treeview-black-line-142d898d1f095b3cec1a5dd204daae0d.gif +0 -0
  189. data/public/assets/treeview-black-line.gif +0 -0
  190. data/public/assets/treeview-black.gif +0 -0
  191. data/public/assets/treeview-default-01747815c9007458fc391092548255f8.gif +0 -0
  192. data/public/assets/treeview-default-line-9aecef4278b9e684f18f3c52e3607f80.gif +0 -0
  193. data/public/assets/treeview-default-line.gif +0 -0
  194. data/public/assets/treeview-default.gif +0 -0
  195. data/public/assets/treeview-famfamfam-c5f86a8a52aa48e87b4bd58878c81ad8.gif +0 -0
  196. data/public/assets/treeview-famfamfam-line-897ce097b7d84700985608f22e2403c3.gif +0 -0
  197. data/public/assets/treeview-famfamfam-line.gif +0 -0
  198. data/public/assets/treeview-famfamfam.gif +0 -0
  199. data/public/assets/treeview-gray-56089927c44332a8375be41ab13130c8.gif +0 -0
  200. data/public/assets/treeview-gray-line-d4be395725623b1f39a0964fa479774e.gif +0 -0
  201. data/public/assets/treeview-gray-line.gif +0 -0
  202. data/public/assets/treeview-gray.gif +0 -0
  203. data/public/assets/treeview-red-cb4ed4e5654d76aef755e5c55b63e91c.gif +0 -0
  204. data/public/assets/treeview-red-line-fdf843bbfba11d00897c7971dff7e806.gif +0 -0
  205. data/public/assets/treeview-red-line.gif +0 -0
  206. data/public/assets/treeview-red.gif +0 -0
  207. data/public/assets/trunk-5686782333e8b4c7e4468c452fb52cec.png +0 -0
  208. data/public/assets/trunk.png +0 -0
  209. data/public/assets/unfinished-1cb6bae22a5b855f4b51cb03a1cce928.png +0 -0
  210. data/public/assets/unfinished.png +0 -0
  211. data/test/integration/client_edit_concept_test.rb +0 -1
  212. data/test/integration/instance_configuration_test.rb +74 -0
  213. data/test/integration/untranslated_test.rb +1 -1
  214. data/test/integration_test_helper.rb +2 -0
  215. data/test/unit/concept_test.rb +1 -1
  216. data/test/unit/instance_configuration_test.rb +42 -0
  217. data/test/unit/skos_import_test.rb +4 -3
  218. data/vendor/assets/javascripts/json2.js +27 -25
  219. metadata +201 -19
  220. data/db/iqvoc_test.sqlite3 +0 -0
@@ -88,9 +88,10 @@ class SearchResultsController < ApplicationController
88
88
  end
89
89
 
90
90
  def self.prepare_basic_variables(controller)
91
- langs = (Iqvoc.available_languages + Iqvoc::Concept.labeling_class_names.values.flatten).uniq.each_with_object({}) do |lang_sym, hsh|
92
- lang_sym ||= "none"
93
- hsh[lang_sym.to_s] = I18n.t("languages.#{lang_sym.to_s}", :default => lang_sym.to_s)
91
+ label_langs = Iqvoc::Concept.labeling_class_names.values.flatten.map(&:to_s)
92
+ langs = (Iqvoc.available_languages + label_langs).uniq.each_with_object({}) do |lang, hsh|
93
+ lang ||= "none"
94
+ hsh[lang] = I18n.t("languages.#{lang}", :default => lang)
94
95
  end
95
96
  controller.instance_variable_set(:@available_languages, langs)
96
97
 
@@ -25,7 +25,7 @@ module ApplicationHelper
25
25
  end
26
26
 
27
27
  def options_for_language_select(selected = nil)
28
- locales_collection = Iqvoc.available_languages.map { |l| [l.to_s, l.to_s] }
28
+ locales_collection = Iqvoc.available_languages.map { |l| [l, l] }
29
29
 
30
30
  options_for_select(locales_collection, selected)
31
31
  end
@@ -46,7 +46,7 @@ module ConceptsHelper
46
46
  render_concept_association(res, concept, Collection::Member::Concept)
47
47
 
48
48
  Iqvoc::Concept.labeling_classes.each do |labeling_class, languages|
49
- (languages || Iqvoc::available_languages).each do |lang|
49
+ (languages || Iqvoc.available_languages).each do |lang|
50
50
  render_concept_association(res, concept, labeling_class, :lang => lang)
51
51
  end
52
52
  end
@@ -0,0 +1,22 @@
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
+ # NB: not to be used directly, but only through Iqvoc::InstanceConfiguration
18
+ class ConfigurationSetting < ActiveRecord::Base # TODO: make private, somehow?
19
+
20
+ validates_uniqueness_of :key
21
+
22
+ end
@@ -0,0 +1,15 @@
1
+ <h2><%= t("txt.views.instance_configuration.caption").titleize %></h2>
2
+
3
+ <%= form_tag(instance_configuration_path, :method => :put, :class => "form large-labels") do %>
4
+ <fieldset>
5
+ <ol>
6
+ <% @settings.each do |key, value| %>
7
+ <li>
8
+ <label><%= key %></label>
9
+ <%= text_field_tag "config[#{key}]", value %>
10
+ </li>
11
+ <% end %>
12
+ </ol>
13
+ </fieldset>
14
+ <%= submit_tag t("txt.common.save") %>
15
+ <% end %>
@@ -17,14 +17,14 @@
17
17
  <% Iqvoc::Concept.pref_labeling_languages.each do |lang| %>
18
18
  <li>
19
19
  <%= link_to t("languages.#{lang}"), params.merge(:lang => lang),
20
- :class => lang == I18n.locale ? "current" : nil %>
20
+ :class => lang == I18n.locale.to_s ? "current" : nil %>
21
21
  </li>
22
22
  <% end %>
23
23
  <% end %>
24
24
 
25
- <% if Iqvoc::available_languages.length > 1 %>
25
+ <% if Iqvoc.available_languages.length > 1 %>
26
26
  <li><h3><%= t("txt.views.lang_widget.secondary") %></h3></li>
27
- <% Iqvoc::available_languages.reject { |lang| lang == I18n.locale }.each do |lang| %>
27
+ <% Iqvoc.available_languages.reject { |lang| lang == I18n.locale.to_s }.each do |lang| %>
28
28
  <li>
29
29
  <label>
30
30
  <input type="checkbox" value="<%= lang %>"> <%= t("languages.#{lang}") %>
@@ -1 +1 @@
1
- <h1 class="header"><%= Iqvoc.title || t("txt.common.iqvoc_title") %></h1>
1
+ <h1 class="header"><%= Iqvoc.title || t("txt.common.iqvoc_title") %></h1>
@@ -21,7 +21,12 @@
21
21
  <%= link_to t("txt.views.navigation.users"), users_path %>
22
22
  </li>
23
23
  <% end %>
24
+ <% if can?(:manage, Iqvoc.config) %>
25
+ <li class="<%= params[:controller] == 'instance_configuration' ? 'active' : '' %>">
26
+ <%= link_to t("txt.views.navigation.instance_configuration"), instance_configuration_path %>
27
+ </li>
28
+ <% end %>
24
29
  <li class="<%= params[:controller] == 'pages' && params[:action] == 'about' ? 'active' : '' %>">
25
30
  <%= link_to t("txt.views.navigation.about"), about_path %>
26
31
  </li>
27
- </ul>
32
+ </ul>
@@ -8,13 +8,13 @@
8
8
  <title><%= Iqvoc.title || t("txt.common.iqvoc_title") %></title>
9
9
  <%= stylesheet_link_tag "blueprint/screen", :media => "screen, projection" %>
10
10
  <%= stylesheet_link_tag "blueprint/print", :media => "print" %>
11
- <!--[if lt IE 8]>
11
+ <!--[if lt IE 8]>
12
12
  <%= stylesheet_link_tag "blueprint/ie", :media => "screen, projection" %>
13
13
  <![endif]-->
14
14
  <%= stylesheet_link_tag "manifest" %>
15
- <!--[if (gte IE 6)&(lte IE 8)]>
16
- <%= stylesheet_link_tag "iqvoc/ie_fixes" %>
17
- <![endif]-->
15
+ <!--[if (gte IE 6)&(lte IE 8)]>
16
+ <%= stylesheet_link_tag "iqvoc/ie_fixes" %>
17
+ <![endif]-->
18
18
 
19
19
  <%= yield :head %>
20
20
  </head>
@@ -53,6 +53,13 @@
53
53
  </div>
54
54
  </div>
55
55
  </div>
56
+
57
+ <script>
58
+ // load JSON polyfill only if necessary
59
+ if(typeof JSON === "undefined") {
60
+ document.write('<%= javascript_include_tag("json2").sub("</", "<\\/").html_safe %>');
61
+ }
62
+ </script>
56
63
  <%= javascript_include_tag "manifest" %>
57
64
  <%= yield :scripts %>
58
65
  </body>
data/config/blazing.rb ADDED
@@ -0,0 +1,36 @@
1
+ #
2
+ # Blazing Configuration File
3
+ #
4
+
5
+ #
6
+ # Specify the location of your repository:
7
+ #
8
+ repository 'git@github.com:innoq/iqvoc.git'
9
+
10
+ #
11
+ # Define possible deploy targets:
12
+ #
13
+ target :"iqvoc.innoq.com", 'iqvoc@iqvoc.innoq.com:/var/www/iqvoc'
14
+ # target :staging, 'blazing@production.server.com:/where/your/code/is/shipped/to', :default => true, :some_option => 'foo' # note: options defined here will override options defined globally for a recipe
15
+
16
+ #
17
+ # Optional: RVM handling
18
+ #
19
+ # Use Ruby Enterprise Edition and gemset 123
20
+ rvm '1.9.3'
21
+
22
+ # Or use the rvmrc
23
+ # rvm :rvmrc
24
+ #
25
+
26
+ #
27
+ # Define Recipes to be used (See the README for available recipes).
28
+ # Recipes are run in the order they are specified
29
+ #
30
+ recipe :precompile_assets
31
+ recipe :passenger_restart
32
+
33
+ #
34
+ # Define a rake task that should be run after deployment. The rake task will run after the recipes have run.
35
+ #
36
+ rake "db:migrate db:seed RAILS_ENV=production"
data/config/database.yml CHANGED
@@ -1,13 +1,3 @@
1
- # MySQL. Versions 4.1 and 5.0 are recommended.
2
- #
3
- # Install the MYSQL driver
4
- # gem install mysql2
5
- #
6
- # Ensure the MySQL gem is defined in your Gemfile
7
- # gem 'mysql2'
8
- #
9
- # And be sure to use new-style password hashing:
10
- # http://dev.mysql.com/doc/refman/5.0/en/old-client.html
11
1
  development:
12
2
  adapter: mysql2
13
3
  encoding: utf8
@@ -16,11 +6,8 @@ development:
16
6
  pool: 5
17
7
  username: root
18
8
  password:
19
- socket: /tmp/mysql.sock
9
+ hostname: 127.0.0.1
20
10
 
21
- # Warning: The database defined as "test" will be erased and
22
- # re-generated from your development database when you run "rake".
23
- # Do not set this db to the same as development or production.
24
11
  test:
25
12
  adapter: mysql2
26
13
  encoding: utf8
@@ -29,7 +16,7 @@ test:
29
16
  pool: 5
30
17
  username: root
31
18
  password:
32
- socket: /tmp/mysql.sock
19
+ hostname: 127.0.0.1
33
20
 
34
21
  production:
35
22
  adapter: mysql2
@@ -39,4 +26,4 @@ production:
39
26
  pool: 5
40
27
  username: root
41
28
  password:
42
- socket: /tmp/mysql.sock
29
+ hostname: 127.0.0.1
data/config/deploy.rb CHANGED
@@ -69,4 +69,4 @@ namespace :deploy do
69
69
  end
70
70
  end
71
71
 
72
- after 'deploy:update_code', 'deploy:symlink_shared', 'assets:precompile'
72
+ after 'deploy:update_code', 'deploy:symlink_shared'
data/config/engine.rb CHANGED
@@ -9,11 +9,19 @@ require 'iq_rdf'
9
9
  require 'json'
10
10
  require 'rails_autolink'
11
11
 
12
+ require 'iqvoc/controller_extensions'
13
+
12
14
  module Iqvoc
13
15
 
14
16
  class Engine < Rails::Engine
15
17
  paths["lib/tasks"] << "lib/engine_tasks"
16
18
 
19
+ initializer "iqvoc.mixin_controller_extensions" do |app|
20
+ if const_defined?(:ApplicationController)
21
+ ApplicationController.send(:include, Iqvoc::ControllerExtensions)
22
+ end
23
+ end
24
+
17
25
  initializer "iqvoc.add_assets_to_precompilation" do |app|
18
26
  app.config.assets.precompile += Iqvoc.core_assets
19
27
  end
@@ -15,69 +15,11 @@
15
15
  # limitations under the License.
16
16
 
17
17
  require 'debug'
18
+ require 'iqvoc/environments/development'
18
19
 
19
20
  if Iqvoc.const_defined?(:Application)
20
21
  Iqvoc::Application.configure do
21
22
  # Settings specified here will take precedence over those in config/environment.rb
22
-
23
- # In the development environment your application's code is reloaded on
24
- # every request. This slows down response time but is perfect for development
25
- # since you don't have to restart the webserver when you make code changes.
26
- config.cache_classes = false
27
-
28
- # Log error messages when you accidentally call methods on nil.
29
- config.whiny_nils = true
30
-
31
- # Show full error reports and disable caching
32
- config.consider_all_requests_local = true
33
- config.action_controller.perform_caching = false
34
-
35
- # Don't care if the mailer can't send
36
- config.action_mailer.raise_delivery_errors = false
37
-
38
- # Print deprecation notices to the Rails logger
39
- config.active_support.deprecation = :log
40
-
41
- # Only use best-standards-support built into browsers
42
- config.action_dispatch.best_standards_support = :builtin
43
-
44
- # Do not compress assets
45
- config.assets.compress = false
46
-
47
- # Expands the lines which load the assets
48
- config.assets.debug = true
49
-
50
- # Raise exception on mass assignment protection for Active Record models
51
- config.active_record.mass_assignment_sanitizer = :logger
52
-
53
- # Log the query plan for queries taking more than this (works
54
- # with SQLite, MySQL, and PostgreSQL)
55
- config.active_record.auto_explain_threshold_in_seconds = 0.5
56
-
57
- # Prepend all log lines with the following tags
58
- # config.log_tags = [ :subdomain, :uuid ]
59
-
60
- # The default URI prefix for RDF data. This will be followed by a document
61
- # specific shnippet like (specimenType) and the id.
62
-
63
- # The JDBC driver url for the coinnection to the virtuoso triple store.
64
- # Login crdentials have to be stored here too. See
65
- # http://docs.openlinksw.com/virtuoso/VirtuosoDriverJDBC.html#jdbcurl4mat for
66
- # more details.
67
- # Example: "jdbc:virtuoso://localhost:1111/UID=dba/PWD=dba"
68
- # Use nil to disable virtuoso triple synchronization
69
- # Rails.application.config.virtuoso_jdbc_driver_url = "jdbc:virtuoso://virtuoso.dyndns.org:1111/UID=iqvoc/PWD=vocpass!/charset=UTF-8"
70
- config.virtuoso_jdbc_driver_url = nil
71
-
72
- # Set up the virtuoso synchronization (which is a triggered pull from the
73
- # virtuoso server) to be run in a new thread.
74
- # This is needed in environments where the webserver only runs in a single
75
- # process/thread (mostly in development environments).
76
- # When a synchronizaion would be triggered e.g. from a running
77
- # update action in the UPB, the update would trigger virtuoso to do a HTTP GET
78
- # back to the UPB to fetch the RDF data. But the only process in the UPB would be
79
- # blocked by the update... => Deadlock. You can avoid this by using the threaded
80
- # mode.
81
- config.virtuoso_sync_threaded = false
23
+ Iqvoc::Environments.setup_development(config)
82
24
  end
83
25
  end
@@ -32,7 +32,7 @@ if Iqvoc.const_defined?(:Application)
32
32
  # Disable Rails's static asset server
33
33
  # In production, Apache or nginx will already do this
34
34
  config.serve_static_assets = true
35
-
35
+
36
36
  # Compress JavaScripts and CSS
37
37
  config.assets.compress = false
38
38
 
@@ -14,69 +14,11 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
 
17
- # Makes Iqvoc available within the .configure block
18
- require "iqvoc"
17
+ require 'iqvoc/environments/production'
19
18
 
20
19
  if Iqvoc.const_defined?(:Application)
21
20
  Iqvoc::Application.configure do
22
21
  # Settings specified here will take precedence over those in config/environment.rb
23
-
24
- # The production environment is meant for finished, "live" apps.
25
- # Code is not reloaded between requests
26
- config.cache_classes = true
27
-
28
- # Full error reports are disabled and caching is turned on
29
- config.consider_all_requests_local = false
30
- config.action_controller.perform_caching = true
31
-
32
- # Specifies the header that your server uses for sending files
33
- config.action_dispatch.x_sendfile_header = "X-Sendfile"
34
-
35
- # For nginx:
36
- # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
37
-
38
- # If you have no front-end server that supports something like X-Sendfile,
39
- # just comment this out and Rails will serve the files
40
-
41
- # See everything in the log (default is :info)
42
- # config.log_level = :debug
43
-
44
- # Use a different logger for distributed setups
45
- # config.logger = SyslogLogger.new
46
-
47
- # Use a different cache store in production
48
- # config.cache_store = :mem_cache_store
49
-
50
- # Disable Rails's static asset server
51
- # In production, Apache or nginx will already do this
52
- config.serve_static_assets = false
53
-
54
- # Compress JavaScripts and CSS
55
- config.assets.compress = true
56
-
57
- # Don't fallback to assets pipeline if a precompiled asset is missed
58
- config.assets.compile = false
59
-
60
- # Generate digests for assets URLs
61
- config.assets.digest = true
62
-
63
-
64
- config.assets.precompile += Iqvoc.core_assets
65
-
66
- # Enable serving of images, stylesheets, and javascripts from an asset server
67
- # config.action_controller.asset_host = "http://assets.example.com"
68
-
69
- # Disable delivery errors, bad email addresses will be ignored
70
- # config.action_mailer.raise_delivery_errors = false
71
-
72
- # Enable threaded mode
73
- # config.threadsafe!
74
-
75
- # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
76
- # the I18n.default_locale when a translation can not be found)
77
- config.i18n.fallbacks = true
78
-
79
- # Send deprecation notices to registered listeners
80
- config.active_support.deprecation = :notify
22
+ Iqvoc::Environments.setup_production(config)
81
23
  end
82
24
  end
@@ -15,54 +15,11 @@
15
15
  # limitations under the License.
16
16
 
17
17
  require 'debug'
18
+ require 'iqvoc/environments/test'
18
19
 
19
20
  if Iqvoc.const_defined?(:Application)
20
21
  Iqvoc::Application.configure do
21
22
  # Settings specified here will take precedence over those in config/environment.rb
22
-
23
- # The test environment is used exclusively to run your application's
24
- # test suite. You never need to work with it otherwise. Remember that
25
- # your test database is "scratch space" for the test suite and is wiped
26
- # and recreated between test runs. Don't rely on the data there!
27
- config.cache_classes = true
28
-
29
- # Log error messages when you accidentally call methods on nil.
30
- config.whiny_nils = true
31
-
32
- # Show full error reports and disable caching
33
- config.consider_all_requests_local = true
34
- config.action_controller.perform_caching = false
35
-
36
- # Raise exceptions instead of rendering exception templates
37
- config.action_dispatch.show_exceptions = false
38
-
39
- # Disable request forgery protection in test environment
40
- config.action_controller.allow_forgery_protection = false
41
-
42
- # Tell Action Mailer not to deliver emails to the real world.
43
- # The :test delivery method accumulates sent emails in the
44
- # ActionMailer::Base.deliveries array.
45
- config.action_mailer.delivery_method = :test
46
-
47
- # Use SQL instead of Active Record's schema dumper when creating the test database.
48
- # This is necessary if your schema can't be completely dumped by the schema dumper,
49
- # like if you have constraints or database-specific column types
50
- # config.active_record.schema_format = :sql
51
-
52
- # Print deprecation notices to the stderr
53
- config.active_support.deprecation = :stderr
54
-
55
- # Configure static asset server for tests with Cache-Control for performance
56
- config.serve_static_assets = true
57
- config.static_cache_control = "public, max-age=3600"
58
-
59
- # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets
60
- config.assets.allow_debugging = true
61
-
62
- # Raise exception on mass assignment protection for Active Record models
63
- config.active_record.mass_assignment_sanitizer = :logger
64
-
65
- # Print deprecation notices to the stderr
66
- config.active_support.deprecation = :stderr
23
+ Iqvoc::Environments.setup_test(config)
67
24
  end
68
25
  end