alchemy_cms 2.1.beta6 → 2.1.rc2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -1
- data/Gemfile +10 -2
- data/Guardfile +16 -0
- data/README.md +3 -3
- data/Rakefile +0 -5
- data/alchemy_cms.gemspec +1 -9
- data/app/assets/javascripts/alchemy/alchemy.base.js +5 -4
- data/app/assets/javascripts/alchemy/{alchemy.dragndrop.js.erb → alchemy.dragndrop.js} +0 -0
- data/app/assets/javascripts/alchemy/alchemy.elements_window.js +96 -0
- data/app/assets/javascripts/alchemy/alchemy.image_cropper.js +48 -50
- data/app/assets/javascripts/alchemy/alchemy.jquery_loader.js +41 -0
- data/app/assets/javascripts/alchemy/alchemy.js +2 -0
- data/app/assets/javascripts/alchemy/alchemy.menubar.js +55 -0
- data/app/assets/javascripts/alchemy/alchemy.preview.js +94 -139
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js +98 -0
- data/app/assets/javascripts/alchemy/alchemy.windows.js +1 -174
- data/app/assets/javascripts/alchemy/menubar.js +2 -0
- data/app/assets/javascripts/alchemy/preview.js +2 -1
- data/app/assets/stylesheets/alchemy/_defaults.scss +7 -8
- data/app/assets/stylesheets/alchemy/base.css.scss +29 -33
- data/app/assets/stylesheets/alchemy/elements.css.scss +4 -4
- data/app/assets/stylesheets/alchemy/jquery-ui.alchemy.css.scss +1 -1
- data/app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss +1 -1
- data/app/assets/stylesheets/alchemy/jquery.sb.css.scss +19 -4
- data/app/assets/stylesheets/alchemy/menubar.css.scss +85 -0
- data/app/assets/stylesheets/alchemy/standard_set.css +3 -5
- data/app/assets/stylesheets/alchemy/tinymce_content.css.scss +1 -1
- data/app/assets/stylesheets/alchemy/tinymce_dialog.css.scss +1 -1
- data/app/controllers/alchemy/admin/attachments_controller.rb +2 -18
- data/app/controllers/alchemy/admin/base_controller.rb +1 -1
- data/app/controllers/alchemy/admin/elements_controller.rb +2 -2
- data/app/controllers/alchemy/admin/essence_files_controller.rb +4 -2
- data/app/controllers/alchemy/admin/pictures_controller.rb +6 -20
- data/app/controllers/alchemy/admin/resources_controller.rb +7 -5
- data/app/controllers/alchemy/base_controller.rb +14 -4
- data/app/controllers/alchemy/messages_controller.rb +4 -4
- data/app/controllers/alchemy/pages_controller.rb +51 -32
- data/app/controllers/alchemy/pictures_controller.rb +0 -3
- data/app/controllers/alchemy/user_sessions_controller.rb +1 -1
- data/app/helpers/alchemy/admin/base_helper.rb +6 -4
- data/app/helpers/alchemy/base_helper.rb +26 -0
- data/app/helpers/alchemy/pages_helper.rb +42 -22
- data/app/models/alchemy/attachment.rb +10 -2
- data/app/models/alchemy/cell.rb +1 -0
- data/app/models/alchemy/content.rb +8 -6
- data/app/models/alchemy/element.rb +1 -1
- data/app/models/alchemy/essence_audio.rb +1 -8
- data/app/models/alchemy/essence_date.rb +2 -9
- data/app/models/alchemy/essence_file.rb +1 -8
- data/app/models/alchemy/essence_flash.rb +0 -7
- data/app/models/alchemy/essence_html.rb +1 -8
- data/app/models/alchemy/essence_picture.rb +0 -11
- data/app/models/alchemy/essence_richtext.rb +4 -12
- data/app/models/alchemy/essence_text.rb +1 -13
- data/app/models/alchemy/essence_video.rb +1 -8
- data/app/models/alchemy/page.rb +28 -22
- data/app/models/alchemy/picture.rb +19 -0
- data/app/sweepers/alchemy/pages_sweeper.rb +17 -6
- data/app/sweepers/alchemy/pictures_sweeper.rb +1 -3
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +2 -2
- data/app/views/alchemy/admin/attachments/_attachment.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +2 -2
- data/app/views/alchemy/admin/attachments/_files_list.html.erb +13 -11
- data/app/views/alchemy/admin/attachments/create.js.erb +1 -1
- data/app/views/alchemy/admin/attachments/edit.html.erb +2 -2
- data/app/views/alchemy/admin/elements/_new_element_form.html.erb +1 -2
- data/app/views/alchemy/admin/elements/new.html.erb +1 -1
- data/app/views/alchemy/admin/essence_files/edit.html.erb +32 -32
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +29 -29
- data/app/views/alchemy/admin/essence_pictures/update.js.erb +13 -12
- data/app/views/alchemy/admin/pages/_create_language_form.html.erb +4 -1
- data/app/views/alchemy/admin/pages/_new_page_form.html.erb +1 -1
- data/app/views/alchemy/admin/pages/edit.html.erb +8 -8
- data/app/views/alchemy/admin/pages/index.html.erb +1 -1
- data/app/views/alchemy/admin/pages/new.html.erb +1 -1
- data/app/views/alchemy/admin/pages/update.js.erb +19 -12
- data/app/views/alchemy/admin/pictures/_picture.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_pictures_list.html.erb +8 -6
- data/app/views/alchemy/admin/pictures/show_in_window.html.erb +6 -1
- data/app/views/alchemy/admin/resources/_table.html.erb +1 -1
- data/app/views/alchemy/admin/users/_table.html.erb +13 -13
- data/app/views/alchemy/admin/users/_user.html.erb +1 -1
- data/app/views/alchemy/admin/users/index.html.erb +2 -2
- data/app/views/alchemy/elements/_contactform_view.html.erb +78 -78
- data/app/views/alchemy/elements/_download_editor.html.erb +1 -0
- data/app/views/alchemy/elements/_download_view.html.erb +3 -0
- data/app/views/alchemy/essences/_essence_date_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_file_editor.html.erb +1 -0
- data/app/views/alchemy/essences/_essence_file_view.html.erb +6 -2
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +3 -2
- data/app/views/alchemy/essences/_essence_picture_view.html.erb +1 -1
- data/app/views/alchemy/navigation/_link.html.erb +1 -2
- data/app/views/alchemy/notifications/admin_user_created.text.erb +7 -7
- data/app/views/alchemy/notifications/registered_user_created.text.erb +5 -5
- data/app/views/alchemy/user_sessions/login.html.erb +34 -35
- data/app/views/layouts/alchemy/login.html.erb +3 -8
- data/app/views/layouts/alchemy/pages.html.erb +1 -0
- data/bin/alchemy +43 -75
- data/config/alchemy/config.yml +10 -0
- data/config/alchemy/elements.yml +5 -0
- data/config/alchemy/page_layouts.yml +1 -1
- data/config/locales/alchemy.de.yml +21 -8
- data/config/locales/alchemy.en.yml +20 -4
- data/config/routes.rb +25 -20
- data/db/migrate/{20111116125112_namespace_models.rb → 20111116125112_namespace_alchemy_models.rb} +1 -1
- data/lib/alchemy/capistrano.rb +4 -17
- data/lib/alchemy/engine.rb +2 -0
- data/lib/alchemy/essence.rb +29 -41
- data/lib/alchemy/i18n.rb +1 -1
- data/lib/alchemy/mount_point.rb +10 -0
- data/lib/alchemy/page_layout.rb +7 -7
- data/lib/alchemy/seeder.rb +85 -47
- data/lib/alchemy/upgrader.rb +115 -0
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +4 -3
- data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +6 -2
- data/lib/tasks/ferret.rake +12 -0
- data/lib/tasks/install.rake +16 -105
- data/lib/tasks/routes.rake +29 -0
- data/lib/tasks/upgrade.rake +5 -67
- data/spec/controllers/admin/pages_controller_spec.rb +1 -1
- data/spec/controllers/pages_controller_spec.rb +31 -0
- data/spec/factories.rb +24 -15
- data/spec/helpers/admin/base_helper_spec.rb +0 -7
- data/spec/helpers/pages_helper_spec.rb +54 -29
- data/spec/helpers/url_helpers_spec.rb +40 -0
- data/spec/integration/admin/pages_controller_spec.rb +3 -3
- data/spec/integration/pages_controller_spec.rb +80 -6
- data/spec/integration/security_spec.rb +2 -2
- data/spec/models/content_spec.rb +24 -0
- data/spec/models/page_spec.rb +174 -47
- data/spec/models/picture_spec.rb +54 -0
- data/spec/page_layout_spec.rb +2 -2
- data/spec/routing_spec.rb +205 -1
- data/spec/spec_helper.rb +53 -32
- metadata +51 -46
- data/lib/alchemy/file_utilz.rb +0 -73
data/lib/alchemy/file_utilz.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
|
3
|
-
module Alchemy
|
4
|
-
class FileUtilz
|
5
|
-
# A general purpose method to mirror a directory (+source+) into a destination
|
6
|
-
# directory, including all files and subdirectories. Files will not be mirrored
|
7
|
-
# if they are identical already (checked via FileUtils#identical?).
|
8
|
-
#
|
9
|
-
# Copyright (c) 2008 James Adam (The MIT License)
|
10
|
-
|
11
|
-
# added: do mirroring with backup saving turned on
|
12
|
-
def self.mirror_with_backup(source, destination)
|
13
|
-
self.mirror_files(source, destination, true)
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.mirror_files(source, destination, create_backups = false)
|
17
|
-
# TODO: use Rake::FileList#pathmap?
|
18
|
-
if File.directory?(source)
|
19
|
-
source_files = Dir[source + "/**/*"]
|
20
|
-
source_dirs = source_files.select { |d| File.directory?(d) }
|
21
|
-
source_files -= source_dirs
|
22
|
-
elsif File.exist? source
|
23
|
-
source_dirs = []
|
24
|
-
source_files = [source]
|
25
|
-
source = File.dirname source
|
26
|
-
else
|
27
|
-
puts "Could not mirror #{source} - entity does not exist"
|
28
|
-
return
|
29
|
-
end
|
30
|
-
|
31
|
-
unless source_files.empty?
|
32
|
-
base_target_dir = File.join(destination)
|
33
|
-
base_target_dir = File.dirname base_target_dir unless File.directory? base_target_dir
|
34
|
-
FileUtils.mkdir_p(base_target_dir)
|
35
|
-
end
|
36
|
-
|
37
|
-
base_target_dir ||= File.join(destination)
|
38
|
-
|
39
|
-
source_dirs.each do |dir|
|
40
|
-
# strip down these paths so we have simple, relative paths we can
|
41
|
-
# add to the destination
|
42
|
-
target_dir = File.join(base_target_dir, dir.gsub(source, ''))
|
43
|
-
begin
|
44
|
-
FileUtils.mkdir_p(target_dir)
|
45
|
-
rescue Exception => e
|
46
|
-
raise "Could not create directory #{target_dir}: \n" + e
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
source_files.each do |file|
|
51
|
-
begin
|
52
|
-
target = File.join(base_target_dir, file.gsub(source, ''))
|
53
|
-
unless File.exist?(target) && self.same_contents(file, target)
|
54
|
-
# WAS FileUtils.identical?(file, target), but we want to test contents too
|
55
|
-
if create_backups && File.exist?(target)
|
56
|
-
File.rename(target, target + '~')
|
57
|
-
end
|
58
|
-
FileUtils.cp(file, target)
|
59
|
-
end
|
60
|
-
rescue Exception => e
|
61
|
-
raise "Could not copy #{file} to #{target}: \n" + e
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# for windows users...
|
67
|
-
def self.same_contents(source,destination)
|
68
|
-
File.read(source) == File.read(destination)
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|