alchemy_cms 2.2.rc15 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +4 -2
- data/Gemfile +1 -1
- data/README.md +3 -5
- data/app/assets/javascripts/alchemy/alchemy.custom.js +1 -0
- data/app/assets/javascripts/alchemy/alchemy.js +1 -0
- data/app/assets/javascripts/alchemy/alchemy.windows.js +3 -3
- data/app/assets/stylesheets/alchemy/alchemy.css +1 -0
- data/app/assets/stylesheets/alchemy/base.css.scss +6 -0
- data/app/assets/stylesheets/alchemy/custom.css +1 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +1 -2
- data/app/controllers/alchemy/pages_controller.rb +1 -1
- data/app/helpers/alchemy/pages_helper.rb +1 -1
- data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
- data/lib/alchemy/capistrano.rb +14 -7
- data/lib/alchemy/version.rb +1 -1
- data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +39 -26
- data/spec/controllers/admin/pages_controller_spec.rb +0 -5
- data/spec/integration/admin/pages_controller_spec.rb +8 -8
- data/spec/spec_helper.rb +2 -2
- metadata +10 -5
data/.travis.yml
CHANGED
@@ -7,10 +7,12 @@ rvm:
|
|
7
7
|
- rbx-19mode
|
8
8
|
branches:
|
9
9
|
only:
|
10
|
-
-
|
10
|
+
- 2.2-stable
|
11
11
|
before_script:
|
12
|
+
- "export DISPLAY=:99.0"
|
13
|
+
- "sh -e /etc/init.d/xvfb start"
|
12
14
|
- "sh -c 'cd spec/dummy && RAILS_ENV=test bundle exec rake db:create db:schema:load --trace'"
|
13
|
-
script: "bundle exec rspec spec"
|
15
|
+
script: "bundle exec rspec spec --format=doc"
|
14
16
|
env:
|
15
17
|
- DB=mysql
|
16
18
|
- DB=postgresql
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -33,9 +33,7 @@ Features
|
|
33
33
|
Rails Version
|
34
34
|
-------------
|
35
35
|
|
36
|
-
This
|
37
|
-
|
38
|
-
**This branch is a beta development branch. For productive environments use the current rubygems version, or the latest stable tag.**
|
36
|
+
This version of Alchemy runs with Rails 3.2 only.
|
39
37
|
|
40
38
|
If you are looking for a Rails 3.1 compatible version check the 2.1-stable branch.
|
41
39
|
|
@@ -53,7 +51,7 @@ Installation
|
|
53
51
|
|
54
52
|
Use the installer (recommended):
|
55
53
|
|
56
|
-
gem install alchemy_cms
|
54
|
+
gem install alchemy_cms
|
57
55
|
alchemy new my_magicpage
|
58
56
|
|
59
57
|
Start the local server:
|
@@ -81,7 +79,7 @@ Add to existing Rails project
|
|
81
79
|
|
82
80
|
In your Gemfile:
|
83
81
|
|
84
|
-
gem 'alchemy_cms', :git => 'git://github.com/magiclabs/alchemy_cms.git'
|
82
|
+
gem 'alchemy_cms', :git => 'git://github.com/magiclabs/alchemy_cms.git'
|
85
83
|
|
86
84
|
Run in terminal:
|
87
85
|
|
@@ -0,0 +1 @@
|
|
1
|
+
// You can overwrite this file in your app or engine to customize javascript available in Alchemy's backend.
|
@@ -32,12 +32,12 @@ if (typeof(Alchemy) === 'undefined') {
|
|
32
32
|
|
33
33
|
AjaxErrorHandler: function($dialog, status, textStatus, errorThrown) {
|
34
34
|
var $div = $('<div class="with_padding" />');
|
35
|
-
var $errorDiv = $('<div id="errorExplanation" />');
|
35
|
+
var $errorDiv = $('<div id="errorExplanation" class="ajax_status_code_' + status + '" />');
|
36
36
|
$dialog.html($div);
|
37
37
|
$div.append($errorDiv);
|
38
38
|
if (status === 0) {
|
39
|
-
$errorDiv.append('<h2>The server does not respond
|
40
|
-
$errorDiv.append('<p>Please
|
39
|
+
$errorDiv.append('<h2>The server does not respond.</h2>');
|
40
|
+
$errorDiv.append('<p>Please check server and try again.</p>');
|
41
41
|
} else {
|
42
42
|
$errorDiv.append('<h2>' + errorThrown + ' (' + status + ')</h2>');
|
43
43
|
$errorDiv.append('<p>Please check log and try again.</p>');
|
@@ -754,6 +754,12 @@ div#toolbar_buttons_right {
|
|
754
754
|
border: 1px solid #d08f91;
|
755
755
|
color: #690001;
|
756
756
|
@include rounded-corner;
|
757
|
+
|
758
|
+
&.ajax_status_code_0 {
|
759
|
+
border-color: #c4c19c;
|
760
|
+
color: #726d23;
|
761
|
+
background-color: #f3f0c1;
|
762
|
+
}
|
757
763
|
}
|
758
764
|
|
759
765
|
#errorExplanation h2 {
|
@@ -0,0 +1 @@
|
|
1
|
+
/* You can overwrite this file in your app or engine to customize stylesheets available in Alchemy's backend. */
|
@@ -235,8 +235,7 @@ module Alchemy
|
|
235
235
|
private
|
236
236
|
|
237
237
|
def load_page
|
238
|
-
@page
|
239
|
-
@page ||= Page.find_by_id(params[:id])
|
238
|
+
@page = Page.find_by_id(params[:id])
|
240
239
|
raise ActiveRecord::RecordNotFound if @page.nil?
|
241
240
|
end
|
242
241
|
|
@@ -17,7 +17,7 @@ module Alchemy
|
|
17
17
|
caches_action(:show,
|
18
18
|
:cache_path => proc { @page.cache_key(request) },
|
19
19
|
:if => proc {
|
20
|
-
if Alchemy::Config.get(:cache_pages)
|
20
|
+
if @page && Alchemy::Config.get(:cache_pages)
|
21
21
|
pagelayout = PageLayout.get(@page.page_layout)
|
22
22
|
pagelayout['cache'].nil? || pagelayout['cache']
|
23
23
|
else
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<li id="page_<%= page.id %>" class="
|
1
|
+
<li id="page_<%= page.id %>" class="<%= "page_level_#{page.level} #{page.page_layout}" %>">
|
2
2
|
<div class="sitemap_page<%= page.locked ? ' locked' : '' %>">
|
3
3
|
<div class="sitemap_left_images">
|
4
4
|
<%= sitemapFolderLink(page) unless page.children.blank? || @sorting %>
|
data/lib/alchemy/capistrano.rb
CHANGED
@@ -42,17 +42,24 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
42
42
|
|
43
43
|
desc "Creates the database.yml file"
|
44
44
|
task :create do
|
45
|
-
|
45
|
+
db_adapter = Capistrano::CLI.ui.ask("Please enter database adapter (Options: mysql2, or postgresql. Default mysql2): ")
|
46
|
+
db_adapter = db_adapter.empty? ? 'mysql2' : db_adapter.gsub(/^mysql$/, 'mysql2')
|
47
|
+
db_name = Capistrano::CLI.ui.ask("Please enter database name: ")
|
48
|
+
db_username = Capistrano::CLI.ui.ask("Please enter database username: ")
|
49
|
+
db_password = Capistrano::CLI.ui.ask("Please enter database password: ")
|
50
|
+
default_db_host = db_adapter == 'mysql2' ? 'localhost' : '127.0.0.1'
|
51
|
+
db_host = Capistrano::CLI.ui.ask("Please enter database host (Default: #{default_db_host}): ")
|
52
|
+
db_host = db_host.empty? ? default_db_host : db_host
|
53
|
+
db_config = ERB.new <<-EOF
|
46
54
|
production:
|
47
|
-
adapter:
|
55
|
+
adapter: #{ db_adapter }
|
48
56
|
encoding: utf8
|
49
57
|
reconnect: false
|
50
58
|
pool: 5
|
51
|
-
database: #{
|
52
|
-
username: #{
|
53
|
-
password: #{
|
54
|
-
|
55
|
-
host: #{ Capistrano::CLI.ui.ask("Database host: ") }
|
59
|
+
database: #{ db_name }
|
60
|
+
username: #{ db_username }
|
61
|
+
password: #{ db_password }
|
62
|
+
host: #{ db_host }
|
56
63
|
EOF
|
57
64
|
run "mkdir -p #{shared_path}/config"
|
58
65
|
put db_config.result, "#{shared_path}/config/database.yml"
|
data/lib/alchemy/version.rb
CHANGED
@@ -2,46 +2,48 @@ require 'bundler/capistrano'
|
|
2
2
|
require 'alchemy/capistrano'
|
3
3
|
load 'deploy/assets'
|
4
4
|
|
5
|
-
# ssh
|
6
|
-
set :user,
|
7
|
-
set :password,
|
8
|
-
set :port,
|
9
|
-
set :use_sudo, false
|
5
|
+
# ssh settings
|
6
|
+
set :user, "<%= @ssh_user %>"
|
7
|
+
set :password, "<%= @ssh_password %>"
|
8
|
+
set :port, <%= @ssh_port || 22 %>
|
10
9
|
|
11
10
|
# domain names
|
12
|
-
role :app,
|
13
|
-
role :web,
|
14
|
-
role :db,
|
11
|
+
role :app, "<%= @server %>"
|
12
|
+
role :web, "<%= @server %>"
|
13
|
+
role :db, "<%= @server %>", :primary => true
|
15
14
|
|
16
|
-
#
|
17
|
-
set :deploy_to,
|
18
|
-
|
19
|
-
set :rails_env, "production"
|
15
|
+
# the webserver path
|
16
|
+
set :deploy_to, "<%= @deploy_path %>"
|
20
17
|
|
18
|
+
# repository settings
|
21
19
|
<%- if @scm == "svn" -%>
|
22
|
-
set :
|
23
|
-
set :
|
24
|
-
set :scm_user, "<%= @scm_user %>"
|
25
|
-
set :scm_password, "<%= @scm_password %>"
|
20
|
+
set :scm, "subversion"
|
21
|
+
set :repository_url, "<%= @repository_url %>"
|
26
22
|
<%- if @scm_user && @scm_password -%>
|
27
|
-
set :
|
23
|
+
set :scm_user, "<%= @scm_user %>"
|
24
|
+
set :scm_password, "<%= @scm_password %>"
|
25
|
+
set :repository, Proc.new { "--username #{scm_user} --password #{scm_password} #{repository_url}" }
|
28
26
|
<%- else -%>
|
29
|
-
set :repository,
|
27
|
+
set :repository, "<%= @repository_url %>"
|
30
28
|
<%- end -%>
|
31
29
|
<%- elsif @scm == "git" -%>
|
32
|
-
set :scm,
|
33
|
-
set :repository,
|
34
|
-
set :branch,
|
30
|
+
set :scm, "git"
|
31
|
+
set :repository, "<%= @repository_url %>"
|
32
|
+
set :branch, "master"
|
35
33
|
<%- end -%>
|
36
34
|
|
37
|
-
before
|
38
|
-
before "deploy:
|
35
|
+
# before hooks
|
36
|
+
before "deploy:start", "deploy:seed"
|
37
|
+
before "deploy:create_symlink", "deploy:migrate"
|
39
38
|
|
39
|
+
# after hooks
|
40
40
|
<%- if @database_type == "mysql" -%>
|
41
|
-
after "deploy:setup",
|
42
|
-
after "deploy:assets:symlink",
|
41
|
+
after "deploy:setup", "alchemy:database_yml:create"
|
42
|
+
after "deploy:assets:symlink", "alchemy:database_yml:symlink"
|
43
43
|
<%- end -%>
|
44
|
-
after "deploy",
|
44
|
+
after "deploy", "deploy:cleanup"
|
45
|
+
|
46
|
+
# special tasks
|
45
47
|
|
46
48
|
namespace :logs do
|
47
49
|
desc "show last 100 lines of log"
|
@@ -70,3 +72,14 @@ namespace :deploy do
|
|
70
72
|
end
|
71
73
|
|
72
74
|
end
|
75
|
+
|
76
|
+
## defaults
|
77
|
+
|
78
|
+
# rails env
|
79
|
+
set :rails_env, "production"
|
80
|
+
|
81
|
+
# enable bundler binstubs
|
82
|
+
set :bundle_flags, "--deployment --binstubs"
|
83
|
+
|
84
|
+
# do not use sudo
|
85
|
+
set :use_sudo, false
|
@@ -101,11 +101,6 @@ module Alchemy
|
|
101
101
|
session[:language_id] = @language.id
|
102
102
|
end
|
103
103
|
|
104
|
-
it "should find a page from urlname" do
|
105
|
-
get :edit, {:id => @page.to_param}
|
106
|
-
response.status.should == 200
|
107
|
-
end
|
108
|
-
|
109
104
|
it "should find a page from id" do
|
110
105
|
get :edit, {:id => @page.id}
|
111
106
|
response.status.should == 200
|
@@ -1,12 +1,11 @@
|
|
1
|
-
|
2
|
-
unless ENV["CI"]
|
1
|
+
require 'spec_helper'
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
describe Alchemy::Admin::PagesController, :js => true do
|
3
|
+
module Alchemy
|
4
|
+
describe Admin::PagesController, :js => true do
|
7
5
|
|
8
6
|
before(:all) do
|
9
7
|
create_admin_user
|
8
|
+
@german_root = FactoryGirl.create(:language_root_page, :language => Language.get_default, :name => 'Deutsch')
|
10
9
|
end
|
11
10
|
|
12
11
|
before(:each) do
|
@@ -22,7 +21,6 @@ unless ENV["CI"]
|
|
22
21
|
context "in a multilangual environment" do
|
23
22
|
|
24
23
|
before(:all) do
|
25
|
-
@german_root = FactoryGirl.create(:language_root_page, :language => Alchemy::Language.get_default, :name => 'Deutsch')
|
26
24
|
@klingonian_root = FactoryGirl.create(:language_root_page, :name => 'Klingonian')
|
27
25
|
end
|
28
26
|
|
@@ -34,7 +32,6 @@ unless ENV["CI"]
|
|
34
32
|
|
35
33
|
after(:all) {
|
36
34
|
@klingonian_root.delete
|
37
|
-
@german_root.delete
|
38
35
|
}
|
39
36
|
|
40
37
|
end
|
@@ -65,6 +62,9 @@ unless ENV["CI"]
|
|
65
62
|
|
66
63
|
end
|
67
64
|
|
68
|
-
|
65
|
+
after(:all) {
|
66
|
+
@german_root.delete
|
67
|
+
}
|
69
68
|
|
69
|
+
end
|
70
70
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -28,10 +28,10 @@ def configure
|
|
28
28
|
|
29
29
|
# Configure capybara for integration testing
|
30
30
|
require "capybara/rails"
|
31
|
-
require 'capybara
|
31
|
+
require 'capybara/poltergeist'
|
32
32
|
Capybara.default_driver = :rack_test
|
33
33
|
Capybara.default_selector = :css
|
34
|
-
Capybara.javascript_driver = :
|
34
|
+
Capybara.javascript_driver = :poltergeist
|
35
35
|
|
36
36
|
# Load support files
|
37
37
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
metadata
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
5
|
-
prerelease:
|
4
|
+
version: 2.2.0
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Thomas von Deyen
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-06-
|
15
|
+
date: 2012-06-25 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|
@@ -387,6 +387,7 @@ files:
|
|
387
387
|
- app/assets/images/alchemy/ui-icons_666666_256x240.png
|
388
388
|
- app/assets/javascripts/alchemy/alchemy.base.js
|
389
389
|
- app/assets/javascripts/alchemy/alchemy.buttons.js
|
390
|
+
- app/assets/javascripts/alchemy/alchemy.custom.js
|
390
391
|
- app/assets/javascripts/alchemy/alchemy.datepicker.js
|
391
392
|
- app/assets/javascripts/alchemy/alchemy.dirty.js
|
392
393
|
- app/assets/javascripts/alchemy/alchemy.dragndrop.js
|
@@ -418,6 +419,7 @@ files:
|
|
418
419
|
- app/assets/stylesheets/alchemy/alchemy.css
|
419
420
|
- app/assets/stylesheets/alchemy/base.css.scss
|
420
421
|
- app/assets/stylesheets/alchemy/buttons.css.scss
|
422
|
+
- app/assets/stylesheets/alchemy/custom.css
|
421
423
|
- app/assets/stylesheets/alchemy/dashboard.css.scss
|
422
424
|
- app/assets/stylesheets/alchemy/elements.css.scss
|
423
425
|
- app/assets/stylesheets/alchemy/flash.css.scss
|
@@ -1032,9 +1034,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1032
1034
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1033
1035
|
none: false
|
1034
1036
|
requirements:
|
1035
|
-
- - ! '
|
1037
|
+
- - ! '>='
|
1036
1038
|
- !ruby/object:Gem::Version
|
1037
|
-
version:
|
1039
|
+
version: '0'
|
1040
|
+
segments:
|
1041
|
+
- 0
|
1042
|
+
hash: 1665960692087372061
|
1038
1043
|
requirements:
|
1039
1044
|
- ImageMagick (libmagick), v6.6 or greater.
|
1040
1045
|
rubyforge_project:
|