refinerycms 0.9.7.1 → 0.9.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. data/Gemfile +2 -2
  2. data/bin/refinery +2 -2
  3. data/changelog.md +13 -0
  4. data/config.ru +2 -0
  5. data/db/migrate/20100522020225_rename_permissions_for_resources_plugin_to_files.rb +2 -2
  6. data/lib/gemspec.rb +3 -6
  7. data/public/javascripts/refinery/admin.js +8 -0
  8. data/public/stylesheets/refinery/refinery.css +24 -2
  9. data/vendor/plugins/authentication/app/models/user.rb +5 -5
  10. data/vendor/plugins/authentication/app/views/users/forgot.html.erb +3 -3
  11. data/vendor/plugins/authentication/app/views/users/reset.html.erb +2 -2
  12. data/vendor/plugins/authentication/config/locales/da.yml +12 -0
  13. data/vendor/plugins/authentication/config/locales/de.yml +2 -0
  14. data/vendor/plugins/authentication/config/locales/en.yml +5 -0
  15. data/vendor/plugins/authentication/config/locales/es.yml +15 -3
  16. data/vendor/plugins/authentication/config/locales/fr.yml +2 -0
  17. data/vendor/plugins/authentication/config/locales/it.yml +12 -0
  18. data/vendor/plugins/authentication/config/locales/nb.yml +12 -0
  19. data/vendor/plugins/authentication/config/locales/nl.yml +12 -0
  20. data/vendor/plugins/authentication/config/locales/pt-BR.yml +36 -5
  21. data/vendor/plugins/authentication/lib/authenticated_system.rb +1 -1
  22. data/vendor/plugins/dashboard/app/helpers/admin/dashboard_helper.rb +8 -2
  23. data/vendor/plugins/dashboard/app/views/admin/dashboard/index.html.erb +11 -4
  24. data/vendor/plugins/dashboard/config/locales/da.yml +4 -2
  25. data/vendor/plugins/dashboard/config/locales/de.yml +4 -2
  26. data/vendor/plugins/dashboard/config/locales/en.yml +7 -2
  27. data/vendor/plugins/dashboard/config/locales/es.yml +8 -2
  28. data/vendor/plugins/dashboard/config/locales/fr.yml +4 -2
  29. data/vendor/plugins/dashboard/config/locales/it.yml +4 -2
  30. data/vendor/plugins/dashboard/config/locales/nb.yml +4 -2
  31. data/vendor/plugins/dashboard/config/locales/nl.yml +4 -2
  32. data/vendor/plugins/dashboard/config/locales/pt-BR.yml +10 -3
  33. data/vendor/plugins/dashboard/config/locales/sl.yml +4 -2
  34. data/vendor/plugins/i18n/lib/i18n.rb +30 -13
  35. data/vendor/plugins/i18n/lib/i18n_filter.rb +5 -5
  36. data/vendor/plugins/images/app/views/admin/images/index.html.erb +1 -1
  37. data/vendor/plugins/images/config/locales/es.yml +4 -7
  38. data/vendor/plugins/images/config/locales/pt-BR.yml +1 -1
  39. data/vendor/plugins/inquiries/app/controllers/admin/inquiry_settings_controller.rb +5 -0
  40. data/vendor/plugins/inquiries/config/locales/da.yml +4 -3
  41. data/vendor/plugins/inquiries/config/locales/de.yml +3 -2
  42. data/vendor/plugins/inquiries/config/locales/en.yml +1 -0
  43. data/vendor/plugins/inquiries/config/locales/es.yml +3 -2
  44. data/vendor/plugins/inquiries/config/locales/fr.yml +3 -2
  45. data/vendor/plugins/inquiries/config/locales/it.yml +3 -2
  46. data/vendor/plugins/inquiries/config/locales/nb.yml +3 -3
  47. data/vendor/plugins/inquiries/config/locales/nl.yml +3 -2
  48. data/vendor/plugins/inquiries/config/locales/pt-BR.yml +23 -19
  49. data/vendor/plugins/pages/config/locales/pt-BR.yml +11 -1
  50. data/vendor/plugins/pages/config/locales/sl.yml +1 -1
  51. data/vendor/plugins/refinery/app/views/layouts/admin.html.erb +1 -1
  52. data/vendor/plugins/refinery/app/views/shared/_site_bar.html.erb +1 -2
  53. data/vendor/plugins/refinery/app/views/shared/admin/_search.html.erb +4 -1
  54. data/vendor/plugins/refinery/config/locales/da.yml +5 -3
  55. data/vendor/plugins/refinery/config/locales/de.yml +5 -3
  56. data/vendor/plugins/refinery/config/locales/en.yml +5 -3
  57. data/vendor/plugins/refinery/config/locales/es.yml +5 -3
  58. data/vendor/plugins/refinery/config/locales/fr.yml +2 -3
  59. data/vendor/plugins/refinery/config/locales/it.yml +5 -3
  60. data/vendor/plugins/refinery/config/locales/nb.yml +5 -3
  61. data/vendor/plugins/refinery/config/locales/nl.yml +2 -3
  62. data/vendor/plugins/refinery/config/locales/pt-BR.yml +8 -2
  63. data/vendor/plugins/refinery/config/locales/sl.yml +2 -4
  64. data/vendor/plugins/refinery/lib/generators/refinery/templates/migration.rb +1 -1
  65. data/vendor/plugins/refinery/lib/generators/refinery/templates/views/admin/index.html.erb +1 -1
  66. data/vendor/plugins/refinery/lib/refinery.rb +1 -1
  67. data/vendor/plugins/refinery/lib/refinery/application_controller.rb +3 -3
  68. data/vendor/plugins/refinery_settings/app/views/admin/refinery_settings/index.html.erb +1 -1
  69. data/vendor/plugins/refinery_settings/config/locales/sl.yml +0 -1
  70. data/vendor/plugins/resources/app/views/admin/resources/index.html.erb +1 -1
  71. data/vendor/plugins/resources/config/locales/da.yml +0 -2
  72. data/vendor/plugins/resources/config/locales/en.yml +4 -3
  73. data/vendor/plugins/resources/config/locales/es.yml +0 -2
  74. data/vendor/plugins/resources/config/locales/fr.yml +0 -2
  75. data/vendor/plugins/resources/config/locales/it.yml +0 -1
  76. data/vendor/plugins/resources/config/locales/nb.yml +0 -2
  77. data/vendor/plugins/resources/config/locales/nl.yml +0 -2
  78. data/vendor/plugins/resources/config/locales/pt-BR.yml +0 -2
  79. data/vendor/plugins/resources/config/locales/sl.yml +0 -2
  80. data/vendor/plugins/translate/tasks/translate.rake +20 -9
  81. metadata +5 -9
  82. data/bin/refinery-update-core +0 -126
  83. data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/_inquiry_setting.html.erb +0 -11
  84. data/vendor/plugins/inquiries/app/views/admin/inquiry_settings/index.html.erb +0 -21
@@ -8,22 +8,21 @@ nl:
8
8
  menu:
9
9
  reorder_menu: Wijzig menu volgorde
10
10
  reorder_menu_done: Ik ben klaar met het wijzigen van de volgorde
11
- log_out: Afmelden
12
11
  search: Zoek naar
13
12
  search_submit: Zoek
14
13
  search_results_for: "Zoekresultaten voor '{{query}}'"
15
- no_results_found: "Excuses, geen resultaten gevonden"
14
+ search_no_results: "Excuses, geen resultaten gevonden"
16
15
  refinery:
17
16
  other: "Ander {{what}}"
18
17
  reorder: "Wijzig volgorde huidige {{what}}"
19
18
  reorder_done: "Klaar met wijzigen van de volgorde van {{what}}"
20
- search_no_results: "Excuses, geen resultaten gevonden"
21
19
  crudify:
22
20
  created: "{{what}} is met success aangemaakt"
23
21
  updated: "{{what}} is met success aangepast"
24
22
  destroyed: "{{what}} is met success verwijderd"
25
23
  shared:
26
24
  site_bar:
25
+ log_out: Afmelden
27
26
  switch_to_your_website: Ga naar de website
28
27
  switch_to_your_website_editor: Ga terug naar de editor
29
28
  admin:
@@ -8,12 +8,14 @@ pt-BR:
8
8
  menu:
9
9
  reorder_menu: Reordenar menu
10
10
  reorder_menu_done: "Terminei de reordenar o menu"
11
- log_out: Deslogar
12
11
  search: Procurar
13
12
  search_submit: Ir
14
13
  search_results_for: "Resultados da busca por '{{query}}'"
15
- no_results_found: "Desculpe, nenhum resultado foi encontrado"
14
+ search_no_results: "Desculpe, nenhum resultado foi encontrado"
16
15
  refinery:
16
+ other: "Outras {{what}}"
17
+ reorder: "{{what}} Reordenar"
18
+ reorder_done: "Reordenação {{what}} feito"
17
19
  crudify:
18
20
  created: "{{what}} foi criado com sucesso"
19
21
  updated: "{{what}} foi atualizado com sucesso"
@@ -23,6 +25,10 @@ pt-BR:
23
25
  view_public_site: Ver site público
24
26
  welcome_to_refinery: Bem-vindo ao Refinery
25
27
  shared:
28
+ site_bar:
29
+ log_out: Deslogar
30
+ switch_to_your_website: Mudar para o seu website
31
+ switch_to_your_website_editor: Mudar para o editor do seu website
26
32
  admin:
27
33
  message:
28
34
  close: Fechar
@@ -8,11 +8,10 @@ sl:
8
8
  menu:
9
9
  reorder_menu: Spremeni vrsti red zavihkov
10
10
  reorder_menu_done: "Končaj s prerazporeditvijo zavihkov."
11
- log_out: Odjavi se
12
11
  search: Išči
13
12
  search_submit: Pojdi
14
13
  search_results_for: Iskalni rezultati za {{query}}
15
- no_results_found: "Oprostite, ni bilo zadetkov"
14
+ search_no_results: Oprostite! Ni bilo zadetkov.
16
15
  images:
17
16
  existing_image:
18
17
  submit_insert: Vstavi
@@ -20,13 +19,13 @@ sl:
20
19
  other: "Drugo {{what}}"
21
20
  reorder: "Spremeni vrstni red {{what}}"
22
21
  reorder_done: "Končaj s prerazporeditvijo {{what}}"
23
- search_no_results: "Oprostite, ni bilo zadetkov"
24
22
  crudify:
25
23
  created: "{{what}} je bil uspešno ustvarjen"
26
24
  updated: "{{what}} je bil uspešno ustvarjen"
27
25
  destroyed: "{{what}} je bil uspešno odstranjen"
28
26
  shared:
29
27
  site_bar:
28
+ log_out: Odjavite se
30
29
  switch_to_your_website: "Preklopite na vašo spletno stran"
31
30
  switch_to_your_website_editor: "Preklopite na urejevalnik spletne strani"
32
31
  admin:
@@ -58,4 +57,3 @@ sl:
58
57
  message:
59
58
  close: Zapri
60
59
  close_this_message: Zapri to sporočilo
61
-
@@ -23,7 +23,7 @@ class <%= migration_name %> < ActiveRecord::Migration
23
23
  end
24
24
 
25
25
  def self.down
26
- UserPlugin.destroy_all({:title => "<%= class_name.pluralize.underscore.titleize %>"})
26
+ UserPlugin.destroy_all({:name => "<%= class_name.pluralize.underscore.titleize %>"})
27
27
 
28
28
  Page.find_all_by_link_url("/<%= plural_name %>").each do |page|
29
29
  page.link_url, page.menu_match = nil
@@ -20,7 +20,7 @@
20
20
  <%% if @<%= plural_name %>.any? %>
21
21
  <%%= render :partial => "<%= singular_name %>", :collection => @<%= plural_name %> %>
22
22
  <%% else %>
23
- <p><%%= t('.search_no_results') %></p>
23
+ <p><%%= t('admin.search_no_results') %></p>
24
24
  <%% end %>
25
25
  <%% else %>
26
26
  <%% if @<%= plural_name %>.any? %>
@@ -27,7 +27,7 @@ module Refinery
27
27
  MAJOR = 0
28
28
  MINOR = 9
29
29
  TINY = 7
30
- BUILD = 1
30
+ BUILD = 2
31
31
 
32
32
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
33
33
 
@@ -86,11 +86,11 @@ protected
86
86
  if ::Refinery::I18n.enabled?
87
87
  if ::Refinery::I18n.has_locale?(locale = params[:locale].try(:to_sym))
88
88
  ::I18n.locale = locale
89
- elsif locale.present? and ::Refinery::I18n.current_locale != ::I18n.default_locale
90
- params[:locale] = I18n.locale = I18n.default_locale
89
+ elsif locale.present? and locale != ::Refinery::I18n.default_frontend_locale
90
+ params[:locale] = I18n.locale = ::Refinery::I18n.default_frontend_locale
91
91
  redirect_to(params, :message => "The locale '#{locale.to_s}' is not supported.") and return
92
92
  else
93
- ::I18n.locale = ::Refinery::I18n.current_locale
93
+ ::I18n.locale = ::Refinery::I18n.default_frontend_locale
94
94
  end
95
95
  end
96
96
  end
@@ -15,7 +15,7 @@
15
15
  <% else %>
16
16
  <p>
17
17
  <% if searching? %>
18
- <%= t('admin.no_results_found') %>
18
+ <%= t('admin.search_no_results') %>
19
19
  <% else %>
20
20
  <strong>
21
21
  <%= t('.empty_set') %>
@@ -18,7 +18,6 @@ sl:
18
18
  create_first: "Kliknite '{{link}}' da boste dodali vašo prvo nastavitev."
19
19
  form:
20
20
  restart_may_be_in_order: "<strong>Prosimo upoštevajte</strong> da boste morali včasih ponovno zagnati spletno stran, da bo nastavitev stopila v veljavo."
21
- no_results_found: "Oprostite, ni bilo zadetkov"
22
21
  plugins:
23
22
  refinery_settings:
24
23
  title: Nastavitve
@@ -10,7 +10,7 @@
10
10
  </div>
11
11
  <div id='records' class='files'>
12
12
  <% if searching? %>
13
- <h2><%= t('admin.search_results', :query => params[:search]) %></h2>
13
+ <h2><%= t('admin.search_results_for', :query => params[:search]) %></h2>
14
14
  <% if @resources.any? %>
15
15
  <%= render :partial => "resource", :collection => @resources %>
16
16
  <% else %>
@@ -20,8 +20,6 @@ da:
20
20
  title: Slet fil
21
21
  index:
22
22
  upload_new: Upload en fil
23
- search_results: Søgeresultat
24
- search_no_results: Desværre, din søgning gav ingen resultater.
25
23
  no_files_yet: Der er ingen filer endnu. Klik på "Upload fil" for at oprette den første.
26
24
  insert:
27
25
  existing_file: Eksisterende fil
@@ -22,11 +22,12 @@ en:
22
22
  upload_new: Upload New File
23
23
  no_files_yet: There are no files yet. Click "Upload New Files" to add your first file.
24
24
  insert:
25
- existing_file: Existing File
25
+ existing: Existing File
26
26
  new: New File
27
- link_to_resource: 'Link to this Resource'
28
27
  previous: Previous
29
28
  next: Next
30
- submit_insert: Insert
31
29
  or: or
32
30
  cancel: Cancel
31
+ existing_resource:
32
+ link_to_resource: 'Link to this Resource'
33
+ submit_insert: Insert
@@ -20,8 +20,6 @@ es:
20
20
  title: Borrar este archivo completamente
21
21
  index:
22
22
  upload_new: Subir nuevo archivo
23
- search_results: Resultados de la busqueda '{{results}}'
24
- search_no_results: Disculpe no se encontro nada en la busqueda.
25
23
  no_files_yet: No hay archivos aun. Click "Subir nuevo archivo" para agregar tu primer archivo.
26
24
  insert:
27
25
  existing_file: Archivos existentes
@@ -20,8 +20,6 @@ fr:
20
20
  title: Supprimer ce fichier pour toujours
21
21
  index:
22
22
  upload_new: Télécharger un Nouveau Fichier
23
- search_results: "Résultat de recherche pour '{{results}}'"
24
- search_no_results: "Désolé, aucun résultat trouvé."
25
23
  no_files_yet: "Il n'y a pas encore de fichier. Cliquer 'Télécharger un Nouveau Fichier' pour ajouté votre premier fichier."
26
24
  insert:
27
25
  existing_file: Fichier existant
@@ -20,7 +20,6 @@ it:
20
20
  title: Rimuovere questo file per sempre
21
21
  index:
22
22
  upload_new: Upload File Nuovo
23
- search_no_results: Nessun risultato per.
24
23
  no_files_yet: Non ci sono ancora i file. Fai clic su "Upload New File" per aggiungere il primo file.
25
24
  insert:
26
25
  existing_file: File esistente
@@ -20,8 +20,6 @@ nb:
20
20
  title: Fjern denne filen for alltid
21
21
  index:
22
22
  upload_new: Last Opp Ny Fil
23
- search_results: "Søkeresultat for '{{results}}'"
24
- search_no_results: "Beklager, ingen resultat funnet."
25
23
  no_files_yet: Det er ingen filer her enda. Trykk "Last Opp Ny Fil" for å legge til din første fil.
26
24
  insert:
27
25
  existing_file: Eksisterende Fil
@@ -20,8 +20,6 @@ nl:
20
20
  title: Verwijder dit bestand permanent.
21
21
  index:
22
22
  upload_new: Upload een nieuw bestand.
23
- search_results: Zoekresultaten voor '{{search_string}}'
24
- search_no_results: Sorry, er zijn zoekresultaten gevonden.
25
23
  no_files_yet: Er zijn nog geen bestanden. Klik op "Upload een nieuw bestand" om uw eerste bestand toe te voegen.
26
24
  insert:
27
25
  existing_file: Bestaand bestand
@@ -20,8 +20,6 @@ pt-BR:
20
20
  title: Remover este arquivo para sempre
21
21
  index:
22
22
  upload_new: Enviar Novo Arquivo
23
- search_results: Resultados da busca por '{{results}}'
24
- search_no_results: Desculpe, nenhum resultado encontrado.
25
23
  no_files_yet: Ainda não existem arquivos. Clique em "Enviar Novo Arquivo" para adicionar seu primeiro arquivo.
26
24
  insert:
27
25
  existing_file: Arquivo Existente
@@ -20,8 +20,6 @@ sl:
20
20
  title: Odstrani datoteko
21
21
  index:
22
22
  upload_new: Prenesi Novo Datoteko
23
- search_results: Iskalni rezultati za '{{results}}'
24
- search_no_results: Oprostite! Ni bilo zadetkov.
25
23
  no_files_yet: Trenutno še ni nobene datoteke. Za prenos prve datoteke kliknite "Prenesi Novo Datoteko".
26
24
  insert:
27
25
  existing_file: Obstoječo Datoteko
@@ -48,16 +48,24 @@ namespace :translate do
48
48
  locale_hash = locale_hash.deep_merge(yaml[locale.to_s])
49
49
  end
50
50
 
51
- lookup_pattern = Translate::Keys.new.send(:i18n_lookup_pattern)
52
- (Dir.glob(File.join("app", "**","*.{erb,rb,rhtml}")) + Dir.glob(File.join("vendor", "plugins", "**", "*.{erb,rb,rhtml}"))).each do |file_name|
53
- next if file_name =~ /translate\/spec/
51
+ lookup_pattern = /\b(?:I18n\.t|I18n\.translate|t)(?:\s|\():?'([a-z0-9_]*.[a-z0-9_.]+)'\)?/
52
+ (Dir.glob(File.join("app", "**","*.{erb,rb}")) + Dir.glob(File.join("vendor", "plugins", "**", "app", "**", "*.{erb,rb}"))).each do |file_name|
54
53
  File.open(file_name, "r+").each do |line|
55
54
  line.scan(lookup_pattern) do |key_string|
56
- result << "#{key_string} in \t #{file_name} \t is not in any #{locale} locale file" unless key_exist?(key_string.first.split("."), locale_hash)
55
+ # qualify the namespace if beginning with . like t('.log_out')
56
+ if key_string.first =~ /^\./
57
+ namespace = file_name.gsub(/vendor\/plugins\/.+?\//, "").gsub(/^app\/(models|views|controllers|helpers)\//, '').split('/')
58
+ namespace = namespace | [namespace.pop.gsub(/^\_/, '').split('.').first]
59
+ key_string = ["#{namespace.join('.')}#{key_string.first}"]
60
+ end
61
+
62
+ unless key_exist?(key_string.first.split("."), locale_hash)
63
+ result << "#{key_string} in \t #{file_name} \t is not in any #{locale} locale file"
64
+ end
57
65
  end
58
- end
66
+ end unless file_name =~ /translate\/spec/
59
67
  end
60
- puts !result.empty? ? result.join("\n") : "No missing translations for locale: #{locale}"
68
+ puts result.empty? ? "No missing translations for locale: #{locale}" : "#{result.join("\n")}\n\nNumber of missing translations for #{locale}: #{result.length}"
61
69
  end
62
70
 
63
71
  desc "Show I18n keys that are missing in the specified locale YAML file. Defaults to I18n.default_locale, unless LOCALE env is specified"
@@ -68,17 +76,20 @@ namespace :translate do
68
76
 
69
77
  desc "Show I18n keys that are missing in all locale YAML files."
70
78
  task :lost_in_translation_all => :environment do
71
- I18n.available_locales.each do |locale|
79
+ ::Refinery::I18n.locales.keys.each do |locale|
72
80
  find_missing_translations(locale)
81
+ puts "--"
73
82
  end
74
83
  end
75
84
 
76
- def key_exist?(key_arr,locale_hash)
85
+ def key_exist?(key_arr, locale_hash)
77
86
  key = key_arr.slice!(0)
78
87
  if key
79
- key_exist?(key_arr, locale_hash[key]) if (locale_hash && locale_hash.include?(key))
88
+ key_exist?(key_arr, locale_hash[key]) if locale_hash && locale_hash.include?(key)
80
89
  elsif locale_hash
81
90
  true
91
+ else
92
+ false
82
93
  end
83
94
  end
84
95
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 7
10
- - 1
11
- version: 0.9.7.1
10
+ - 2
11
+ version: 0.9.7.2
12
12
  platform: ruby
13
13
  authors:
14
14
  - Resolve Digital
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2010-07-03 00:00:00 +12:00
21
+ date: 2010-07-06 00:00:00 +12:00
22
22
  default_executable:
23
23
  dependencies: []
24
24
 
@@ -26,7 +26,6 @@ description: A beautiful open source Ruby on Rails content manager for small bus
26
26
  email: info@refinerycms.com
27
27
  executables:
28
28
  - refinery
29
- - refinery-update-core
30
29
  extensions: []
31
30
 
32
31
  extra_rdoc_files: []
@@ -37,8 +36,8 @@ files:
37
36
  - Gemfile
38
37
  - Rakefile
39
38
  - changelog.md
40
- - readme.md
41
39
  - license.md
40
+ - readme.md
42
41
  - todo.md
43
42
  - public/.htaccess
44
43
  - config.ru
@@ -47,7 +46,6 @@ files:
47
46
  - app/controllers/application_controller.rb
48
47
  - app/helpers/application_helper.rb
49
48
  - bin/refinery
50
- - bin/refinery-update-core
51
49
  - config/acts_as_indexed_config.rb
52
50
  - config/amazon_s3.yml.example
53
51
  - config/application.rb
@@ -852,11 +850,9 @@ files:
852
850
  - vendor/plugins/inquiries/app/views/admin/inquiries/show.html.erb
853
851
  - vendor/plugins/inquiries/app/views/admin/inquiries/spam.html.erb
854
852
  - vendor/plugins/inquiries/app/views/admin/inquiry_settings/_confirmation_email_form.html.erb
855
- - vendor/plugins/inquiries/app/views/admin/inquiry_settings/_inquiry_setting.html.erb
856
853
  - vendor/plugins/inquiries/app/views/admin/inquiry_settings/_notification_recipients_form.html.erb
857
854
  - vendor/plugins/inquiries/app/views/admin/inquiry_settings/_subject_form.html.erb
858
855
  - vendor/plugins/inquiries/app/views/admin/inquiry_settings/edit.html.erb
859
- - vendor/plugins/inquiries/app/views/admin/inquiry_settings/index.html.erb
860
856
  - vendor/plugins/inquiries/app/views/inquiries/new.html.erb
861
857
  - vendor/plugins/inquiries/app/views/inquiries/thank_you.html.erb
862
858
  - vendor/plugins/inquiries/app/views/inquiry_mailer/confirmation.html.erb
@@ -1,126 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'pathname'
3
- require 'fileutils'
4
- refinery_root = (defined?(REFINERY_ROOT) && REFINERY_ROOT.is_a?(Pathname) ? REFINERY_ROOT : Pathname.new(File.expand_path(File.dirname(__FILE__) << "/..")))
5
- rails_root = (defined?(RAILS_ROOT) ? RAILS_ROOT : ARGV.first)
6
- unless rails_root.nil? or rails_root.length == 0
7
- # ensure asset directories exist.
8
- dirs = [%w(public stylesheets), %w(public javascripts), %w(db migrate)]
9
- FileUtils::makedirs dirs.map {|dir| File.join(rails_root, dir) }
10
-
11
- # copy in the new assets.
12
- assets = [%w(public stylesheets refinery), %w(public javascripts refinery), %w(public javascripts wymeditor), %w(VERSION), %w(public images wymeditor skins refinery), %w(public images refinery), %w(public stylesheets wymeditor skins refinery), %w(public javascripts jquery)]
13
- assets.each do |asset|
14
- FileUtils::rm_rf File.join(rails_root, asset), :secure => true # ensure the destination is clear.
15
- FileUtils::cp_r File.join(refinery_root, asset), File.join(rails_root, asset) # copy the new assets into the project.
16
- end
17
-
18
- # copy in any new migrations.
19
- FileUtils::cp Dir[File.join(%W(#{refinery_root} db migrate *.rb))], File.join(%W(#{rails_root} db migrate))
20
-
21
- # replace rakefile and gemfile.
22
- FileUtils::cp File.join(%W(#{refinery_root} Rakefile)), File.join(%W(#{rails_root} Rakefile))
23
- unless File.exist?(File.join("%W(#{rails_root} Gemfile)"))
24
- FileUtils::cp File.join(%W(#{refinery_root} Gemfile)), File.join(%W(#{rails_root} Gemfile))
25
- else
26
- # TODO only override refinery gems here.
27
- end
28
-
29
- # read in the Gemfile and write it back out with the refinerycms gem enabled.
30
- lines = File.open(File.join(%W(#{rails_root} Gemfile)), "r").read.split("\n")
31
- lines.each do |line|
32
- line.gsub!("#gem 'refinerycms'", "gem 'refinerycms'")
33
- end
34
- # write the new content into the file.
35
- File.open(File.join(%W(#{rails_root} Gemfile)), "w").puts(lines.join("\n"))
36
-
37
- # replace the preinitializer.
38
- FileUtils::cp File.join(%W(#{refinery_root} config preinitializer.rb)), File.join(%W(#{rails_root} config preinitializer.rb))
39
-
40
- # replace the boot file.
41
- FileUtils::cp File.join(%W(#{refinery_root} config boot.rb)), File.join(%W(#{rails_root} config boot.rb))
42
-
43
- # copy the lib/refinery directory in
44
- FileUtils::cp_r File.join(%W(#{refinery_root} lib refinery)), File.join(rails_root, "lib")
45
-
46
- # get current secret key
47
- unless File.exist?(File.join(%W(#{rails_root} config application.rb)))
48
- lines = File.open(File.join(%W(#{rails_root} config environment.rb)), "r").read.split("\n")
49
- else
50
- lines = File.open(File.join(%W(#{rails_root} config application.rb)), "r").read.split("\n")
51
- end
52
-
53
- secret_key = ""
54
- lines.each do |line|
55
- match = line.scan(/(:secret)([^']*)([\'])([^\']*)/).flatten.last
56
- secret_key = match unless match.nil?
57
- end
58
-
59
- # read in the config files
60
- if File.exist?(File.join(%W(#{rails_root} config application.rb)))
61
- FileUtils::cp File.join(%W(#{refinery_root} config environment.rb)), File.join(%W(#{rails_root} config environment.rb))
62
- else
63
- # write the new content into the file.
64
- FileUtils::cp File.join(%W(#{refinery_root} config application.rb)), File.join(%W(#{rails_root} config application.rb))
65
-
66
- app_rb_lines = File.open(File.join(%W(#{rails_root} config application.rb)), "r").read.split("\n")
67
- app_rb_lines.each do |line|
68
- match = line.scan(/(:secret)([^']*)([\'])([^\']*)/).flatten.last
69
- line.gsub!(match, secret_key) unless match.nil?
70
- end
71
-
72
- # write the new content into the file.
73
- File.open(File.join(%W(#{rails_root} config application.rb)), "w").puts(app_rb_lines.join("\n"))
74
-
75
- FileUtils::cp File.join(%W(#{refinery_root} config environment.rb)), File.join(%W(#{rails_root} config environment.rb))
76
- end
77
-
78
- unless File.exist?(File.join(%W(#{rails_root} config settings.rb)))
79
- FileUtils::cp(File.join(%W(#{refinery_root} config settings.rb)), File.join(%W(#{rails_root} config settings.rb)))
80
- end
81
-
82
- app_config_file = "application.rb"
83
-
84
- app_config = File.open(File.join(%W(#{rails_root} config #{app_config_file})), "r").read
85
-
86
- # copy new jquery javascripts.
87
- FileUtils.cp File.join(%W(#{refinery_root} public javascripts jquery.js)), File.join(%W(#{rails_root} public javascripts jquery.js)) if File.exist?(File.join(%W(#{refinery_root} public javascripts jquery.js)))
88
- FileUtils.cp File.join(%W(#{refinery_root} public javascripts jquery-min.js)), File.join(%W(#{rails_root} public javascripts jquery-min.js)) if File.exist?(File.join(%W(#{refinery_root} public javascripts jquery-min.js)))
89
- FileUtils.cp File.join(%W(#{refinery_root} public javascripts jquery-ui.js)), File.join(%W(#{rails_root} public javascripts jquery-ui.js)) if File.exist?(File.join(%W(#{refinery_root} public javascripts jquery-ui.js)))
90
- FileUtils.cp File.join(%W(#{refinery_root} public javascripts jquery-ui-custom-min.js)), File.join(%W(#{rails_root} public javascripts jquery-ui-custom-min.js)) if File.exist?(File.join(%W(#{refinery_root} public javascripts jquery-ui-custom-min.js)))
91
-
92
- # backup app's config file and replace it, if required.
93
- environment_updated = false
94
- matcher = /(#===REFINERY REQUIRED GEMS===)(.+?)(#===REFINERY END OF REQUIRED GEMS===)/m
95
- unless (app_refinery_gems_section = app_config.scan(matcher).join("")).length == 0
96
- # backup the config file.
97
- FileUtils.cp File.join(%W(#{rails_root} config #{app_config_file})), File.join(%W(#{rails_root} config #{app_config_file.gsub(".rb", "")}.autobackupbyrefinery.rb))
98
-
99
- # copy the new config file.
100
- FileUtils.cp File.join(%W(#{refinery_root} config #{app_config_file})), File.join(%W(#{rails_root} config #{app_config_file}))
101
-
102
- # Write the secret key back into the file.
103
-
104
-
105
- environment_updated = true
106
- end
107
-
108
- unless ARGV.include?("--from-refinery-installer")
109
- puts "---------"
110
- puts "Copied new Refinery core assets."
111
- if environment_updated
112
- puts "I've made a backup of your current config/#{app_config_file} file as it has been updated with the latest Refinery requirements."
113
- puts "The backup is located at config/#{app_config_file.gsub(".rb", "")}.autobackupbyrefinery.rb incase you need it."
114
- end
115
- puts ""
116
- puts "=== ACTION REQUIRED ==="
117
- puts "Please run 'rake db:migrate' to ensure your database is at the correct version."
118
- puts "Please also run 'rake gems:install' to ensure you have the currently specified gems." if environment_updated
119
- puts "It may also be necessary to run 'bundle install' in order to get the latest gems."
120
- puts ""
121
- end
122
- else
123
- unless ARGV.include?("--from-refinery-installer")
124
- puts "Please specify the path of the refinery project that you want to update, i.e. refinery-update-core /path/to/project"
125
- end
126
- end