refinerycms 0.9.7.5 → 0.9.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. data/Gemfile +4 -4
  2. data/bin/refinery +3 -141
  3. data/bin/refinery-upgrade-096-to-097 +39 -32
  4. data/bin/refinerycms +150 -0
  5. data/changelog.md +25 -12
  6. data/db/schema.rb +1 -1
  7. data/features/refinery/site_bar.feature +5 -4
  8. data/features/step_definitions/refinery/page_steps.rb +6 -2
  9. data/lib/gemspec.rb +1 -1
  10. data/lib/refinery/tasks/refinery.rake +24 -18
  11. data/lib/tasks/rspec.rake +0 -1
  12. data/public/javascripts/refinery/admin.js +3 -9
  13. data/public/javascripts/refinery/boot_wym.js +3 -3
  14. data/public/javascripts/wymeditor/jquery.refinery.wymeditor.js +5 -5
  15. data/public/javascripts/wymeditor/lang/pt-br.js +44 -43
  16. data/public/stylesheets/refinery/refinery.css +37 -34
  17. data/readme.md +3 -6
  18. data/test/test_helper.rb +1 -1
  19. data/test/unit/image_test.rb +6 -2
  20. data/vendor/plugins/authentication/app/controllers/users_controller.rb +4 -5
  21. data/vendor/plugins/authentication/config/locales/pt-BR.yml +22 -19
  22. data/vendor/plugins/dashboard/config/locales/pt-BR.yml +2 -1
  23. data/vendor/plugins/images/app/controllers/admin/images_controller.rb +9 -5
  24. data/vendor/plugins/images/app/models/image.rb +15 -3
  25. data/vendor/plugins/images/app/views/admin/images/{_existing_image.erb → _existing_image.html.erb} +2 -2
  26. data/vendor/plugins/images/app/views/admin/images/index.html.erb +8 -4
  27. data/vendor/plugins/images/app/views/admin/images/insert.html.erb +28 -9
  28. data/vendor/plugins/images/config/locales/en.yml +5 -1
  29. data/vendor/plugins/images/config/locales/es.yml +1 -1
  30. data/vendor/plugins/images/config/locales/nl.yml +1 -1
  31. data/vendor/plugins/images/config/locales/pt-BR.yml +6 -2
  32. data/vendor/plugins/inquiries/app/views/admin/inquiries/index.html.erb +1 -1
  33. data/vendor/plugins/inquiries/app/views/admin/inquiries/show.html.erb +2 -2
  34. data/vendor/plugins/inquiries/app/views/admin/inquiries/spam.html.erb +1 -1
  35. data/vendor/plugins/inquiries/config/locales/en.yml +1 -0
  36. data/vendor/plugins/inquiries/config/locales/pt-BR.yml +12 -9
  37. data/vendor/plugins/pages/app/controllers/admin/{page_dialogs_controller.rb → pages_dialogs_controller.rb} +8 -6
  38. data/vendor/plugins/pages/app/models/page.rb +1 -1
  39. data/vendor/plugins/pages/app/views/admin/{page_dialogs → pages_dialogs}/_page_link.html.erb +0 -0
  40. data/vendor/plugins/pages/app/views/admin/{page_dialogs → pages_dialogs}/link_to.html.erb +11 -9
  41. data/vendor/plugins/pages/config/locales/en.yml +1 -1
  42. data/vendor/plugins/pages/config/locales/pt-BR.yml +27 -0
  43. data/vendor/plugins/pages/config/locales/sl.yml +1 -1
  44. data/vendor/plugins/pages/config/routes.rb +5 -3
  45. data/vendor/plugins/pages/rails/init.rb +1 -1
  46. data/vendor/plugins/refinery/app/views/shared/admin/_form_actions.html.erb +19 -12
  47. data/vendor/plugins/refinery/app/views/shared/admin/_image_picker.html.erb +15 -5
  48. data/vendor/plugins/refinery/config/locales/pt-BR.yml +2 -0
  49. data/vendor/plugins/refinery/lib/refinery.rb +1 -1
  50. data/vendor/plugins/refinery/lib/refinery/admin_base_controller.rb +0 -1
  51. data/vendor/plugins/refinery/lib/refinery/initializer.rb +2 -2
  52. data/vendor/plugins/refinery/lib/refinery/link_renderer.rb +6 -2
  53. data/vendor/plugins/refinery/lib/tasks/refinery.rake +1 -1
  54. data/vendor/plugins/refinery_dialogs/app/controllers/admin/dialogs_controller.rb +2 -4
  55. data/vendor/plugins/refinery_settings/app/controllers/admin/refinery_settings_controller.rb +2 -2
  56. data/vendor/plugins/refinery_settings/config/locales/pt-BR.yml +17 -17
  57. data/vendor/plugins/resources/app/controllers/admin/resources_controller.rb +4 -0
  58. data/vendor/plugins/resources/app/models/resource.rb +2 -6
  59. data/vendor/plugins/resources/app/views/admin/resources/_existing_resource.html.erb +3 -3
  60. data/vendor/plugins/resources/app/views/admin/resources/_form.html.erb +8 -5
  61. data/vendor/plugins/resources/app/views/admin/resources/insert.html.erb +33 -10
  62. data/vendor/plugins/resources/config/locales/da.yml +1 -1
  63. data/vendor/plugins/resources/config/locales/pt-BR.yml +4 -3
  64. metadata +15 -12
  65. data/vendor/plugins/authentication/test/functional/admin/base_controller_test.rb +0 -8
  66. data/vendor/plugins/authentication/test/functional/admin/dashboard_controller_test.rb +0 -8
  67. data/vendor/plugins/authentication/test/functional/admin/pages_controller_test.rb +0 -8
  68. data/vendor/plugins/authentication/test/test_helper.rb +0 -38
@@ -79,6 +79,10 @@ protected
79
79
  @current_link = params[:current_link]
80
80
  end
81
81
 
82
+ def restrict_controller
83
+ super unless action_name == 'insert'
84
+ end
85
+
82
86
  def paginate_resources(conditions={})
83
87
  @resources = Resource.paginate :page => (@paginate_page_number ||= params[:page]),
84
88
  :conditions => conditions,
@@ -8,9 +8,8 @@ class Resource < ActiveRecord::Base
8
8
  :max_size => MAX_SIZE_IN_MB.megabytes,
9
9
  :path_prefix => (Refinery.s3_backend ? nil : 'public/system/resources')
10
10
 
11
- # TODO acts_as_indexed for resources?
12
- #acts_as_indexed :fields => [:title, :type_of_content],
13
- # :index_file => [RAILS_ROOT,"tmp","index"]
11
+ # Docs for acts_as_indexed http://github.com/dougal/acts_as_indexed
12
+ acts_as_indexed :fields => [:filename, :title, :type_of_content]
14
13
 
15
14
  # we could use validates_as_attachment but it produces 4 odd errors like
16
15
  # "size is not in list". So we basically here enforce the same validation
@@ -32,9 +31,6 @@ class Resource < ActiveRecord::Base
32
31
  end
33
32
  end
34
33
 
35
- # Docs for acts_as_indexed http://github.com/dougal/acts_as_indexed
36
- acts_as_indexed :fields => [:title, :type_of_content]
37
-
38
34
  # when a dialog pops up with images, how many images per page should there be
39
35
  PAGES_PER_DIALOG = 12
40
36
 
@@ -6,8 +6,7 @@
6
6
  <% @resources.each do |resource| -%>
7
7
  <% resource_linked = (resource.public_filename == params[:current_link]) if params[:current_link].present? %>
8
8
  <li<%= " class='linked'" if resource_linked %>>
9
- <%= link_to "#{resource.title} (#{resource.public_filename})",
10
- resource.public_filename,
9
+ <%= link_to "#{resource.title} (#{resource.public_filename})", resource.public_filename,
11
10
  :title => t('.link_to_resource'),
12
11
  :rel => resource.title,
13
12
  :class => 'page_link',
@@ -21,7 +20,8 @@
21
20
  <%= render :partial => "/shared/admin/form_actions",
22
21
  :locals => {
23
22
  :f => nil,
24
- :cancel_url => '',
23
+ :cancel_text => ,
24
+ :cancel_url => admin_resources_url,
25
25
  :submit_button_text => t('.submit_insert'),
26
26
  :hide_cancel => false,
27
27
  :hide_delete => true,
@@ -3,15 +3,18 @@
3
3
  <%= f.error_messages %>
4
4
 
5
5
  <div class='field'>
6
- <% if action_name =~ /(edit)|(update)/ -%>
7
- <%= link_to t('.download_current'), @resource.public_filename, {:title => @resource.title} -%>
6
+ <% if action_name =~ /(edit)|(update)/ %>
7
+ <%= link_to t('.download_current'), @resource.public_filename,
8
+ :title => @resource.title %>
8
9
  <em><%= t('.or')%></em><%=t('.replace') %>
9
- <% end -%>
10
- <%= f.file_field :uploaded_data -%>
10
+ <% end %>
11
+ <%= f.file_field :uploaded_data %>
11
12
  </div>
12
13
 
13
14
  <div class='field'>
14
- <label><%= t('.maximum_file_size', :megabytes => (Resource.attachment_options[:max_size] / 1024 / 1024)) %></label>
15
+ <label>
16
+ <%= t('.maximum_file_size', :megabytes => (Resource.attachment_options[:max_size] / 1024 / 1024)) %>
17
+ </label>
15
18
  </div>
16
19
 
17
20
  <%= render :partial => "/shared/admin/form_actions",
@@ -1,23 +1,46 @@
1
+ <% user_can_modify_resources = Refinery::Plugins.active.names.include?("refinery_files") %>
1
2
  <div class='clearfix'>
2
3
  <div id='dialog_menu_left'>
3
- <% if @resources.any? %>
4
+ <% if (any_resources = @resources.any?) %>
4
5
  <span id='existing_resource_radio' class='radio<%= " selected_radio" if @resource.errors.empty? %>'>
5
6
  <input type='radio' name='resource_type' value='existing_resource' id='resource_type_existing' <%= "checked='true'" if @resource.errors.empty? %> />
6
- <label for='resource_type_existing' class='stripped'><%=t('.existing')%></label>
7
+ <label for='resource_type_existing' class='stripped'>
8
+ <%=t('.existing')%>
9
+ </label>
10
+ </span>
11
+ <% end %>
12
+ <% if user_can_modify_resources %>
13
+ <span id='upload_resource_radio' class='radio<%= " selected_radio" if @resource.errors.any? or @resources.empty? %>'>
14
+ <input type='radio' name='resource_type' value='upload_resource' id='resource_type_upload' <%= "checked='true'" if @resources.empty? or @resource.errors.any? %> />
15
+ <label for='resource_type_upload' class='stripped'>
16
+ <%= t('.new') %>
17
+ </label>
7
18
  </span>
8
19
  <% end %>
9
- <span id='upload_resource_radio' class='radio<%= " selected_radio" if @resource.errors.any? or @resources.empty? %>'>
10
- <input type='radio' name='resource_type' value='upload_resource' id='resource_type_upload' <%= "checked='true'" if @resources.empty? or @resource.errors.any? %> />
11
- <label for='resource_type_upload' class='stripped'><%= t('.new') %></label>
12
- </span>
13
20
  </div>
14
21
 
15
22
  <div id='dialog_main'>
16
- <%= render :partial => 'existing_resource' if @resources.any? %>
23
+ <% if any_resources or user_can_modify_images %>
24
+ <%= render :partial => 'existing_resource' if any_resources %>
17
25
 
18
- <div id='upload_resource_area' class='dialog_area' <%= "style='display:none;'" if @resources.any? and @resource.errors.empty? %>>
19
- <%= render :partial => "form", :locals => {:insert => true} %>
20
- </div>
26
+ <% if user_can_modify_resources %>
27
+ <div id='upload_resource_area' class='dialog_area' <%= "style='display:none;'" if any_resources and @resource.errors.empty? %>>
28
+ <%= render :partial => "form", :locals => {:insert => true} %>
29
+ </div>
30
+ <% end %>
31
+ <% else %>
32
+ <% flash.now[:error] = t('admin.resources.index.no_files_yet').split('.').first.html_safe + "." %>
33
+ <%= render :partial => "/shared/admin/form_actions",
34
+ :locals => {
35
+ :f => nil,
36
+ :cancel_url => '',
37
+ :hide_cancel => false,
38
+ :hide_delete => true,
39
+ :hide_submit => true,
40
+ :cancel_button_text => t('shared.admin.message.close'),
41
+ :cancel_title => ''
42
+ } %>
43
+ <% end %>
21
44
  </div>
22
45
  </div>
23
46
 
@@ -16,7 +16,7 @@ da:
16
16
  download: Download fil ({{size}})
17
17
  edit: Redigér fil
18
18
  delete:
19
- message: Er du sikker på du vil slette filen '{{title}}'?
19
+ message: "Er du sikker på du vil slette filen '{{title}}'?"
20
20
  title: Slet fil
21
21
  index:
22
22
  upload_new: Upload en fil
@@ -22,11 +22,12 @@ pt-BR:
22
22
  upload_new: Enviar Novo Arquivo
23
23
  no_files_yet: Ainda não existem arquivos. Clique em "Enviar Novo Arquivo" para adicionar seu primeiro arquivo.
24
24
  insert:
25
- existing_file: Arquivo Existente
25
+ existing: Arquivo Existente
26
26
  new: Novo Arquivo
27
- link_to_resource: 'Link para este Recurso'
28
27
  previous: Anterior
29
28
  next: Próximo
30
- submit_insert: Inserir
31
29
  or: ou
32
30
  cancel: Cancelar
31
+ existing_resource:
32
+ link_to_resource: Link para este Recurso
33
+ submit_insert: Inserir
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 9
8
9
  - 7
9
- - 5
10
- version: 0.9.7.5
10
+ - 6
11
+ version: 0.9.7.6
11
12
  platform: ruby
12
13
  authors:
13
14
  - Resolve Digital
@@ -17,7 +18,7 @@ autorequire:
17
18
  bindir: bin
18
19
  cert_chain: []
19
20
 
20
- date: 2010-07-08 00:00:00 +12:00
21
+ date: 2010-07-15 00:00:00 +12:00
21
22
  default_executable:
22
23
  dependencies: []
23
24
 
@@ -26,6 +27,7 @@ email: info@refinerycms.com
26
27
  executables:
27
28
  - refinery
28
29
  - refinery-upgrade-096-to-097
30
+ - refinerycms
29
31
  extensions: []
30
32
 
31
33
  extra_rdoc_files: []
@@ -47,6 +49,7 @@ files:
47
49
  - app/helpers/application_helper.rb
48
50
  - bin/refinery
49
51
  - bin/refinery-upgrade-096-to-097
52
+ - bin/refinerycms
50
53
  - config/acts_as_indexed_config.rb
51
54
  - config/amazon_s3.yml.example
52
55
  - config/application.rb
@@ -701,10 +704,6 @@ files:
701
704
  - vendor/plugins/authentication/Rakefile
702
705
  - vendor/plugins/authentication/README
703
706
  - vendor/plugins/authentication/readme.md
704
- - vendor/plugins/authentication/test/functional/admin/base_controller_test.rb
705
- - vendor/plugins/authentication/test/functional/admin/dashboard_controller_test.rb
706
- - vendor/plugins/authentication/test/functional/admin/pages_controller_test.rb
707
- - vendor/plugins/authentication/test/test_helper.rb
708
707
  - vendor/plugins/authentication/test/unit/user_mailer_test.rb
709
708
  - vendor/plugins/dashboard/app/controllers/admin/dashboard_controller.rb
710
709
  - vendor/plugins/dashboard/app/helpers/admin/dashboard_helper.rb
@@ -816,7 +815,7 @@ files:
816
815
  - vendor/plugins/images/app/controllers/admin/images_controller.rb
817
816
  - vendor/plugins/images/app/helpers/admin/images_helper.rb
818
817
  - vendor/plugins/images/app/models/image.rb
819
- - vendor/plugins/images/app/views/admin/images/_existing_image.erb
818
+ - vendor/plugins/images/app/views/admin/images/_existing_image.html.erb
820
819
  - vendor/plugins/images/app/views/admin/images/_form.html.erb
821
820
  - vendor/plugins/images/app/views/admin/images/_grid_view.html.erb
822
821
  - vendor/plugins/images/app/views/admin/images/_list_view.html.erb
@@ -879,16 +878,14 @@ files:
879
878
  - vendor/plugins/model_translations/README.rdoc
880
879
  - vendor/plugins/model_translations/test/model_translations_test.rb
881
880
  - vendor/plugins/model_translations/test/test_helper.rb
882
- - vendor/plugins/pages/app/controllers/admin/page_dialogs_controller.rb
883
881
  - vendor/plugins/pages/app/controllers/admin/page_parts_controller.rb
884
882
  - vendor/plugins/pages/app/controllers/admin/pages_controller.rb
883
+ - vendor/plugins/pages/app/controllers/admin/pages_dialogs_controller.rb
885
884
  - vendor/plugins/pages/app/controllers/pages_controller.rb
886
885
  - vendor/plugins/pages/app/helpers/pages_helper.rb
887
886
  - vendor/plugins/pages/app/models/page.rb
888
887
  - vendor/plugins/pages/app/models/page_part.rb
889
888
  - vendor/plugins/pages/app/presenters/page_presenter.rb
890
- - vendor/plugins/pages/app/views/admin/page_dialogs/_page_link.html.erb
891
- - vendor/plugins/pages/app/views/admin/page_dialogs/link_to.html.erb
892
889
  - vendor/plugins/pages/app/views/admin/pages/_form.html.erb
893
890
  - vendor/plugins/pages/app/views/admin/pages/_form_advanced_options.html.erb
894
891
  - vendor/plugins/pages/app/views/admin/pages/_form_advanced_options_seo.html.erb
@@ -900,6 +897,8 @@ files:
900
897
  - vendor/plugins/pages/app/views/admin/pages/edit.html.erb
901
898
  - vendor/plugins/pages/app/views/admin/pages/index.html.erb
902
899
  - vendor/plugins/pages/app/views/admin/pages/new.html.erb
900
+ - vendor/plugins/pages/app/views/admin/pages_dialogs/_page_link.html.erb
901
+ - vendor/plugins/pages/app/views/admin/pages_dialogs/link_to.html.erb
903
902
  - vendor/plugins/pages/app/views/pages/home.html.erb
904
903
  - vendor/plugins/pages/app/views/pages/show.html.erb
905
904
  - vendor/plugins/pages/config/locales/da.yml
@@ -1073,23 +1072,27 @@ rdoc_options: []
1073
1072
  require_paths:
1074
1073
  - lib
1075
1074
  required_ruby_version: !ruby/object:Gem::Requirement
1075
+ none: false
1076
1076
  requirements:
1077
1077
  - - ">="
1078
1078
  - !ruby/object:Gem::Version
1079
+ hash: 3
1079
1080
  segments:
1080
1081
  - 0
1081
1082
  version: "0"
1082
1083
  required_rubygems_version: !ruby/object:Gem::Requirement
1084
+ none: false
1083
1085
  requirements:
1084
1086
  - - ">="
1085
1087
  - !ruby/object:Gem::Version
1088
+ hash: 3
1086
1089
  segments:
1087
1090
  - 0
1088
1091
  version: "0"
1089
1092
  requirements: []
1090
1093
 
1091
1094
  rubyforge_project:
1092
- rubygems_version: 1.3.6
1095
+ rubygems_version: 1.3.7
1093
1096
  signing_key:
1094
1097
  specification_version: 3
1095
1098
  summary: A beautiful open source Ruby on Rails content manager for small business.
@@ -1,8 +0,0 @@
1
- require 'test_helper'
2
-
3
- class Admin::BaseControllerTest < ActionController::TestCase
4
- # Replace this with your real tests.
5
- def test_truth
6
- assert true
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- require 'test_helper'
2
-
3
- class Admin::DashboardControllerTest < ActionController::TestCase
4
- # Replace this with your real tests.
5
- def test_truth
6
- assert true
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- require 'test_helper'
2
-
3
- class Admin::PagesControllerTest < ActionController::TestCase
4
- # Replace this with your real tests.
5
- def test_truth
6
- assert true
7
- end
8
- end
@@ -1,38 +0,0 @@
1
- ENV["RAILS_ENV"] = "test"
2
- require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
- require 'test_help'
4
-
5
- class Test::Unit::TestCase
6
- # Transactional fixtures accelerate your tests by wrapping each test method
7
- # in a transaction that's rolled back on completion. This ensures that the
8
- # test database remains unchanged so your fixtures don't have to be reloaded
9
- # between every test method. Fewer database queries means faster tests.
10
- #
11
- # Read Mike Clark's excellent walkthrough at
12
- # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
13
- #
14
- # Every Active Record database supports transactions except MyISAM tables
15
- # in MySQL. Turn off transactional fixtures in this case; however, if you
16
- # don't care one way or the other, switching from MyISAM to InnoDB tables
17
- # is recommended.
18
- #
19
- # The only drawback to using transactional fixtures is when you actually
20
- # need to test transactions. Since your test is bracketed by a transaction,
21
- # any transactions started in your code will be automatically rolled back.
22
- self.use_transactional_fixtures = true
23
-
24
- # Instantiated fixtures are slow, but give you @david where otherwise you
25
- # would need people(:david). If you don't want to migrate your existing
26
- # test cases which use the @david style and don't mind the speed hit (each
27
- # instantiated fixtures translates to a database query per test method),
28
- # then set this back to true.
29
- self.use_instantiated_fixtures = false
30
-
31
- # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
32
- #
33
- # Note: You'll currently still have to declare fixtures explicitly in integration tests
34
- # -- they do not yet inherit this setting
35
- fixtures :all
36
-
37
- # Add more helper methods to be used by all tests here...
38
- end