cmsimple 0.2.0
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.
- data/.gitignore +31 -0
- data/.rspec +1 -0
- data/.travis.yml +16 -0
- data/Gemfile +20 -0
- data/Gemfile.ci +5 -0
- data/LICENSE +19 -0
- data/README.md +118 -0
- data/Rakefile +47 -0
- data/app/assets/javascripts/cmsimple.js +61 -0
- data/app/assets/javascripts/cmsimple/controllers/editor.coffee +102 -0
- data/app/assets/javascripts/cmsimple/lib/namespaces.coffee +3 -0
- data/app/assets/javascripts/cmsimple/lib/support.coffee +4 -0
- data/app/assets/javascripts/cmsimple/mercury/config.js +462 -0
- data/app/assets/javascripts/cmsimple/mercury/handlers.coffee +9 -0
- data/app/assets/javascripts/cmsimple/models/image.coffee +49 -0
- data/app/assets/javascripts/cmsimple/models/page.coffee +106 -0
- data/app/assets/javascripts/cmsimple/models/path.coffee +31 -0
- data/app/assets/javascripts/cmsimple/models/version.coffee +29 -0
- data/app/assets/javascripts/cmsimple/panels/images/index.coffee +2 -0
- data/app/assets/javascripts/cmsimple/panels/images/list.coffee +48 -0
- data/app/assets/javascripts/cmsimple/panels/images/panel.coffee +69 -0
- data/app/assets/javascripts/cmsimple/panels/images/selection.coffee +52 -0
- data/app/assets/javascripts/cmsimple/panels/page_metadata.coffee +42 -0
- data/app/assets/javascripts/cmsimple/panels/publish.coffee +32 -0
- data/app/assets/javascripts/cmsimple/panels/redirects/form.coffee +51 -0
- data/app/assets/javascripts/cmsimple/panels/redirects/index.coffee +2 -0
- data/app/assets/javascripts/cmsimple/panels/redirects/list.coffee +34 -0
- data/app/assets/javascripts/cmsimple/panels/redirects/panel.coffee +39 -0
- data/app/assets/javascripts/cmsimple/panels/sitemap/index.coffee +2 -0
- data/app/assets/javascripts/cmsimple/panels/sitemap/panel.coffee +40 -0
- data/app/assets/javascripts/cmsimple/panels/sitemap/sortable.coffee +55 -0
- data/app/assets/javascripts/cmsimple/panels/sitemap/tree.coffee +61 -0
- data/app/assets/javascripts/cmsimple/panels/versions/index.coffee +2 -0
- data/app/assets/javascripts/cmsimple/panels/versions/list.coffee +51 -0
- data/app/assets/javascripts/cmsimple/panels/versions/panel.coffee +53 -0
- data/app/assets/javascripts/cmsimple/views/image_library/_item.jst.hamlc +24 -0
- data/app/assets/javascripts/cmsimple/views/image_library/list.jst.hamlc +8 -0
- data/app/assets/javascripts/cmsimple/views/redirects/_path.jst.hamlc +6 -0
- data/app/assets/javascripts/cmsimple/views/redirects/list.jst.hamlc +19 -0
- data/app/assets/javascripts/cmsimple/views/sitemap/_page.jst.hamlc +9 -0
- data/app/assets/javascripts/cmsimple/views/sitemap/tree.jst.hamlc +5 -0
- data/app/assets/javascripts/cmsimple/views/versions/_item.jst.hamlc +6 -0
- data/app/assets/javascripts/cmsimple/views/versions/list.jst.hamlc +4 -0
- data/app/assets/stylesheets/cmsimple.css +15 -0
- data/app/assets/stylesheets/cmsimple/forms.css +10 -0
- data/app/assets/stylesheets/cmsimple/panels.css +399 -0
- data/app/assets/stylesheets/cmsimple/toolbar-images.css +27 -0
- data/app/assets/stylesheets/mercury_overrides.css +2 -0
- data/app/controllers/cmsimple/front_controller.rb +38 -0
- data/app/controllers/cmsimple/images_controller.rb +28 -0
- data/app/controllers/cmsimple/mercury_controller.rb +7 -0
- data/app/controllers/cmsimple/pages_controller.rb +89 -0
- data/app/controllers/cmsimple/paths_controller.rb +23 -0
- data/app/controllers/cmsimple/snippets_controller.rb +23 -0
- data/app/controllers/cmsimple/versions_controller.rb +17 -0
- data/app/helpers/cmsimple/regions_helper.rb +38 -0
- data/app/models/cmsimple/image.rb +19 -0
- data/app/models/cmsimple/page.rb +203 -0
- data/app/models/cmsimple/path.rb +63 -0
- data/app/models/cmsimple/region.rb +43 -0
- data/app/models/cmsimple/snippet.rb +64 -0
- data/app/models/cmsimple/version.rb +18 -0
- data/app/uploaders/image_attachment_uploader.rb +53 -0
- data/app/views/cmsimple/images/_form.html.haml +13 -0
- data/app/views/cmsimple/images/new.html.haml +5 -0
- data/app/views/cmsimple/pages/_form.html.haml +49 -0
- data/app/views/cmsimple/pages/_form_extras.html.haml +2 -0
- data/app/views/cmsimple/pages/edit.html.haml +3 -0
- data/app/views/cmsimple/pages/new.html.haml +3 -0
- data/app/views/cmsimple/pages/publish.html.haml +12 -0
- data/app/views/cmsimple/snippets/index.html.haml +5 -0
- data/app/views/cmsimple/templates/default.html.haml +4 -0
- data/app/views/layouts/editor.html.haml +12 -0
- data/app/views/layouts/panel.html.haml +9 -0
- data/cmsimple.gemspec +44 -0
- data/config.ru +4 -0
- data/config/application.rb +1 -0
- data/config/cucumber.yml +8 -0
- data/config/environment.rb +2 -0
- data/config/routes.rb +34 -0
- data/db/migrate/20120201221410_create_cmsimple_pages.rb +10 -0
- data/db/migrate/20120222185901_add_title_parent_id_and_position_to_pages.rb +10 -0
- data/db/migrate/20120229185214_add_slug_to_pages.rb +7 -0
- data/db/migrate/20120323200439_add_is_root_to_page.rb +5 -0
- data/db/migrate/20120328174339_add_meta_info_to_cmsimple_pages.rb +9 -0
- data/db/migrate/20120329172857_create_cmsimple_path.rb +11 -0
- data/db/migrate/20120407024752_create_cmsimple_images.rb +13 -0
- data/db/migrate/20120410041105_add_timestamps_to_cmsimple_pages.rb +7 -0
- data/db/migrate/20120425211937_add_published_at_to_cmsimple_pages.rb +6 -0
- data/db/migrate/20120430175047_create_cmsimple_versions.rb +13 -0
- data/db/migrate/20120831233927_rename_path_to_current_uri_on_paths.rb +5 -0
- data/features/create.feature +18 -0
- data/features/delete.feature +12 -0
- data/features/edit.feature +54 -0
- data/features/publishing.feature +31 -0
- data/features/redirects.feature +27 -0
- data/features/step_definitions/mercury_steps.rb +440 -0
- data/features/step_definitions/page_steps.rb +269 -0
- data/features/step_definitions/web_steps.rb +254 -0
- data/features/support/env.rb +77 -0
- data/features/support/mercury_content.rb +25 -0
- data/features/support/mercury_selectors.rb +148 -0
- data/features/support/paths.rb +16 -0
- data/features/support/selectors.rb +26 -0
- data/features/support/utils.rb +18 -0
- data/features/versioning.feature +27 -0
- data/features/visit.feature +7 -0
- data/lib/cmsimple.rb +22 -0
- data/lib/cmsimple/configuration.rb +65 -0
- data/lib/cmsimple/exts/to_bool.rb +25 -0
- data/lib/cmsimple/page_responder.rb +46 -0
- data/lib/cmsimple/rails.rb +5 -0
- data/lib/cmsimple/regions_proxy.rb +32 -0
- data/lib/cmsimple/template_resolver.rb +14 -0
- data/lib/cmsimple/template_responder.rb +12 -0
- data/lib/cmsimple/version.rb +3 -0
- data/lib/generators/cmsimple/install/install_generator.rb +46 -0
- data/lib/generators/cmsimple/install/templates/default.html.erb +10 -0
- data/lib/generators/cmsimple/install/templates/default.html.haml +6 -0
- data/lib/generators/cmsimple/install/templates/initializer.rb +22 -0
- data/lib/generators/cmsimple/snippet/snippet_generator.rb +56 -0
- data/lib/generators/cmsimple/snippet/templates/cell.rb +18 -0
- data/lib/generators/cmsimple/snippet/templates/display.html.erb +14 -0
- data/lib/generators/cmsimple/snippet/templates/display.html.haml +11 -0
- data/lib/generators/cmsimple/snippet/templates/options.html.erb +18 -0
- data/lib/generators/cmsimple/snippet/templates/options.html.haml +12 -0
- data/script/app +2 -0
- data/script/migrate +2 -0
- data/script/rails +8 -0
- data/spec/fixtures/rails.png +0 -0
- data/spec/helpers/regions_helper_spec.rb +62 -0
- data/spec/javascripts/controllers/editor_spec.coffee +57 -0
- data/spec/javascripts/models/image_geometry_spec.coffee +64 -0
- data/spec/javascripts/models/image_spec.coffee +4 -0
- data/spec/javascripts/models/page_spec.coffee +121 -0
- data/spec/javascripts/models/path_spec.coffee +39 -0
- data/spec/javascripts/models/version_spec.coffee +31 -0
- data/spec/javascripts/panels/images/selection_spec.coffee +104 -0
- data/spec/javascripts/panels/sitemap/panel_spec.coffee +10 -0
- data/spec/javascripts/panels/sitemap/sortable_spec.coffee +63 -0
- data/spec/javascripts/panels/sitemap/tree_spec.coffee +62 -0
- data/spec/javascripts/spec_helper.coffee +25 -0
- data/spec/javascripts/support/stubs.coffee +16 -0
- data/spec/lib/page_responder_spec.rb +58 -0
- data/spec/lib/regions_proxy_spec.rb +47 -0
- data/spec/models/image_spec.rb +46 -0
- data/spec/models/page_spec.rb +237 -0
- data/spec/models/path_spec.rb +71 -0
- data/spec/models/region_spec.rb +14 -0
- data/spec/models/snippet_spec.rb +57 -0
- data/spec/models/version_spec.rb +7 -0
- data/spec/rails_app/.gitignore +33 -0
- data/spec/rails_app/Rakefile +7 -0
- data/spec/rails_app/app/assets/images/rails.png +0 -0
- data/spec/rails_app/app/assets/javascripts/application.js +9 -0
- data/spec/rails_app/app/assets/stylesheets/application.css +7 -0
- data/spec/rails_app/app/cells/example/display.html.haml +2 -0
- data/spec/rails_app/app/cells/example/options.html.haml +15 -0
- data/spec/rails_app/app/cells/example_cell.rb +19 -0
- data/spec/rails_app/app/cells/image_example/display.html.haml +4 -0
- data/spec/rails_app/app/cells/image_example/options.html.haml +15 -0
- data/spec/rails_app/app/cells/image_example_cell.rb +18 -0
- data/spec/rails_app/app/controllers/application_controller.rb +3 -0
- data/spec/rails_app/app/helpers/application_helper.rb +2 -0
- data/spec/rails_app/app/mailers/.gitkeep +0 -0
- data/spec/rails_app/app/models/.gitkeep +0 -0
- data/spec/rails_app/app/views/cmsimple/_snippet_list.html.haml +8 -0
- data/spec/rails_app/app/views/cmsimple/templates/default.html.haml +19 -0
- data/spec/rails_app/app/views/cmsimple/templates/test.html.haml +2 -0
- data/spec/rails_app/app/views/layouts/application.html.haml +13 -0
- data/spec/rails_app/config.ru +4 -0
- data/spec/rails_app/config/application.rb +65 -0
- data/spec/rails_app/config/boot.rb +9 -0
- data/spec/rails_app/config/database.example.yml +22 -0
- data/spec/rails_app/config/database.travis.yml +8 -0
- data/spec/rails_app/config/environment.rb +5 -0
- data/spec/rails_app/config/environments/development.rb +30 -0
- data/spec/rails_app/config/environments/test.rb +39 -0
- data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_app/config/initializers/cells.rb +1 -0
- data/spec/rails_app/config/initializers/cmsimple.rb +3 -0
- data/spec/rails_app/config/initializers/inflections.rb +10 -0
- data/spec/rails_app/config/initializers/mime_types.rb +5 -0
- data/spec/rails_app/config/initializers/secret_token.rb +7 -0
- data/spec/rails_app/config/initializers/session_store.rb +8 -0
- data/spec/rails_app/config/initializers/teabag.rb +58 -0
- data/spec/rails_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/rails_app/config/locales/en.yml +5 -0
- data/spec/rails_app/config/routes.rb +61 -0
- data/spec/rails_app/db/seeds.rb +11 -0
- data/spec/rails_app/lib/assets/.gitkeep +0 -0
- data/spec/rails_app/lib/tasks/.gitkeep +0 -0
- data/spec/rails_app/public/404.html +26 -0
- data/spec/rails_app/public/422.html +26 -0
- data/spec/rails_app/public/500.html +26 -0
- data/spec/rails_app/public/robots.txt +5 -0
- data/spec/rails_app/script/rails +6 -0
- data/spec/rails_app/vendor/assets/stylesheets/.gitkeep +0 -0
- data/spec/rails_app/vendor/plugins/.gitkeep +0 -0
- data/spec/spec_helper.rb +31 -0
- data/spec/support/active_model_lint_example.rb +14 -0
- data/spec/teabag_env.rb +28 -0
- data/vendor/assets/images/sitemap/has-changes.png +0 -0
- data/vendor/assets/images/sitemap/published.png +0 -0
- data/vendor/assets/images/sitemap/unpublished.png +0 -0
- data/vendor/assets/images/toolbar/metadata.png +0 -0
- data/vendor/assets/images/toolbar/publish.png +0 -0
- data/vendor/assets/images/toolbar/redirect.png +0 -0
- data/vendor/assets/images/toolbar/sitemap.png +0 -0
- data/vendor/assets/images/toolbar/snippets.png +0 -0
- data/vendor/assets/images/toolbar/unpublished.png +0 -0
- data/vendor/assets/images/tree-line-horizontal-last.png +0 -0
- data/vendor/assets/images/tree-line-horizontal.png +0 -0
- data/vendor/assets/images/tree-line-vertical.png +0 -0
- data/vendor/assets/javascripts/jquery-serializeObject.js +107 -0
- data/vendor/assets/javascripts/jquery.to-json.js +74 -0
- data/vendor/assets/javascripts/jquery.ui.nestedSortable-1.3.4.js +391 -0
- data/vendor/assets/javascripts/moment-1.6.2.js +918 -0
- data/vendor/assets/javascripts/underscore-1.3.1.js +31 -0
- data/vendor/assets/stylesheets/jasmine-modified.css +216 -0
- metadata +686 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
describe Cmsimple::Region do
|
|
3
|
+
|
|
4
|
+
it 'returns the value on to_s' do
|
|
5
|
+
region = Cmsimple::Region.new value: 'hello'
|
|
6
|
+
region.to_s.should == 'hello'
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it 'returns an empty string for a non-existent region' do
|
|
10
|
+
region = Cmsimple::Region.new nil
|
|
11
|
+
region.to_s.should == ''
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Cmsimple::Snippet do
|
|
4
|
+
subject { Cmsimple::Snippet.new 'name', {} }
|
|
5
|
+
|
|
6
|
+
it_should_behave_like 'ActiveModel'
|
|
7
|
+
|
|
8
|
+
describe 'options' do
|
|
9
|
+
let(:snippet) { Cmsimple::Snippet.new 'snippet_0', { name: 'example', snippet: {first_name: 'Fred', last_name: 'Flintstone'} } }
|
|
10
|
+
|
|
11
|
+
it "sets values for name" do
|
|
12
|
+
snippet.name.should == 'example'
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
it "sets values for options" do
|
|
16
|
+
snippet.options.should be_a(Hash)
|
|
17
|
+
snippet.options[:first_name].should == 'Fred'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'can access options with via method calls' do
|
|
21
|
+
snippet.first_name.should == 'Fred'
|
|
22
|
+
snippet.last_name.should == 'Flintstone'
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
it "returns a string to match against the html for interpolations" do
|
|
26
|
+
snippet.matcher.should =~ '[snippet_0/0]'
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'created via a region' do
|
|
31
|
+
before do
|
|
32
|
+
@region = Cmsimple::Region.new(value: "<div>some content</div><div>[snippet_0/0]</div>",
|
|
33
|
+
snippets: {snippet_0: {name: 'example',
|
|
34
|
+
first_name: 'Fred',
|
|
35
|
+
last_name: 'Flinstone'
|
|
36
|
+
}})
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "has an array of snippets" do
|
|
40
|
+
@region.snippets.should be_a(Array)
|
|
41
|
+
@region.snippets.first.should be_a(Cmsimple::Snippet)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
it "sets values for options when not nested under the snippet key" do
|
|
45
|
+
@region.snippets.first.first_name.should == 'Fred'
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe '#render_snippets' do
|
|
49
|
+
it 'interpolates the result of the block into the region html' do
|
|
50
|
+
@region.render_snippets do |snippet|
|
|
51
|
+
"<span>#{snippet.options[:first_name]} #{snippet.options[:last_name]}</span>"
|
|
52
|
+
end
|
|
53
|
+
@region.to_s.should == '<div>some content</div><div><span>Fred Flinstone</span></div>'
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# System stuff
|
|
2
|
+
.DS_Store
|
|
3
|
+
.bundle
|
|
4
|
+
.idea
|
|
5
|
+
.rake_tasks
|
|
6
|
+
REVISION
|
|
7
|
+
vendor/bundle
|
|
8
|
+
.rake_tasks~
|
|
9
|
+
mkmf.log
|
|
10
|
+
|
|
11
|
+
# Local config files
|
|
12
|
+
config/database.yml
|
|
13
|
+
config/*.sphinx.conf
|
|
14
|
+
config/mongoid.yml
|
|
15
|
+
|
|
16
|
+
# Local DBs
|
|
17
|
+
db/sphinx
|
|
18
|
+
db/*.sqlite3
|
|
19
|
+
|
|
20
|
+
# Logs
|
|
21
|
+
log/*.log
|
|
22
|
+
log/*.pid
|
|
23
|
+
|
|
24
|
+
# Tempfiles
|
|
25
|
+
tmp/**/*
|
|
26
|
+
coverage
|
|
27
|
+
capybara*
|
|
28
|
+
|
|
29
|
+
# Assets
|
|
30
|
+
public/system
|
|
31
|
+
public/static
|
|
32
|
+
/assets
|
|
33
|
+
packages
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env rake
|
|
2
|
+
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
|
3
|
+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
|
4
|
+
|
|
5
|
+
require File.expand_path('../config/application', __FILE__)
|
|
6
|
+
|
|
7
|
+
RailsTestApp::Application.load_tasks
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This is a manifest file that'll be compiled into including all the files listed below.
|
|
2
|
+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
|
|
3
|
+
// be included in the compiled file accessible from http://example.com/assets/application.js
|
|
4
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
|
5
|
+
// the compiled file.
|
|
6
|
+
//
|
|
7
|
+
//= require jquery
|
|
8
|
+
//= require jquery_ujs
|
|
9
|
+
//= require_tree .
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
|
|
3
|
+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
|
|
4
|
+
* the top of the compiled file, but it's generally better to create a new file per style scope.
|
|
5
|
+
*= require_self
|
|
6
|
+
*= require_tree .
|
|
7
|
+
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.mercury-display-pane(style='width: 500px')
|
|
2
|
+
= form_for @snippet, :url => '#', html: { class: 'form-horizontal'} do |f|
|
|
3
|
+
%fieldset
|
|
4
|
+
%legend Full Name Snippet
|
|
5
|
+
.control-group
|
|
6
|
+
= f.label :first_name, class: 'control-label'
|
|
7
|
+
.controls
|
|
8
|
+
= f.text_field :first_name
|
|
9
|
+
.control-group
|
|
10
|
+
= f.label :last_name, class: 'control-label'
|
|
11
|
+
.controls
|
|
12
|
+
= f.text_field :last_name
|
|
13
|
+
.form-actions.mercury-display-controls
|
|
14
|
+
= f.submit class: 'btn btn-primary'
|
|
15
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'ostruct'
|
|
2
|
+
class ExampleCell < Cell::Rails
|
|
3
|
+
|
|
4
|
+
def display(snippet)
|
|
5
|
+
@first_name = snippet.first_name
|
|
6
|
+
@last_name = snippet.last_name
|
|
7
|
+
render view: :display
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def preview(snippet)
|
|
11
|
+
display(snippet)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def options(snippet)
|
|
15
|
+
@snippet = snippet
|
|
16
|
+
render
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.mercury-display-pane(style='width: 500px')
|
|
2
|
+
= form_for @snippet, :url => '#', html: { class: 'form-horizontal'} do |f|
|
|
3
|
+
%fieldset
|
|
4
|
+
%legend Image Example Snippet
|
|
5
|
+
.control-group
|
|
6
|
+
= f.label :title, class: 'control-label'
|
|
7
|
+
.controls
|
|
8
|
+
= f.text_field :title
|
|
9
|
+
.control-group
|
|
10
|
+
= f.label :summary, class: 'control-label'
|
|
11
|
+
.controls
|
|
12
|
+
= f.text_field :summary
|
|
13
|
+
= f.hidden_field :image_1
|
|
14
|
+
.form-actions.mercury-display-controls
|
|
15
|
+
= f.submit class: 'btn btn-primary'
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class ImageExampleCell < Cell::Rails
|
|
2
|
+
|
|
3
|
+
def display(snippet)
|
|
4
|
+
@title = snippet.title
|
|
5
|
+
@summary = snippet.summary
|
|
6
|
+
@image_1 = snippet.image_1
|
|
7
|
+
render view: :display
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def preview(snippet)
|
|
11
|
+
display(snippet)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def options(snippet)
|
|
15
|
+
@snippet = snippet
|
|
16
|
+
render
|
|
17
|
+
end
|
|
18
|
+
end
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
%li(data-filter="example, snippet, name")
|
|
2
|
+
%img(alt="Example Snippet" data-snippet="example" src="/assets/toolbar/snippets.png")
|
|
3
|
+
%h4>Snippet Name
|
|
4
|
+
.description A one or two line long description of what this snippet does.
|
|
5
|
+
%li(data-filter="image_example, snippet, name")
|
|
6
|
+
%img(alt="Image Example Snippet" data-snippet="image_example" src="/assets/toolbar/snippets.png")
|
|
7
|
+
%h4>Image Example
|
|
8
|
+
.description A one or two line long description of what this snippet does.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
= content_for :title do
|
|
2
|
+
= @page.browser_title
|
|
3
|
+
= content_for :keywords do
|
|
4
|
+
= @page.keywords
|
|
5
|
+
= content_for :description do
|
|
6
|
+
= @page.description
|
|
7
|
+
|
|
8
|
+
%h2 Editable
|
|
9
|
+
%section#editable1(data-mercury='full')
|
|
10
|
+
=region_content @page.regions.editable1
|
|
11
|
+
|
|
12
|
+
%h2 Snippetable
|
|
13
|
+
%section#snippetable1(data-mercury='snippets')
|
|
14
|
+
=region_content @page.regions.snippetable1
|
|
15
|
+
|
|
16
|
+
%h2 Markupable
|
|
17
|
+
%section#markupable1(data-mercury='markdown')
|
|
18
|
+
=region_content @page.regions.markupable1
|
|
19
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
!!!
|
|
2
|
+
%html
|
|
3
|
+
%head
|
|
4
|
+
%title= content_for :title || 'Cmsimple'
|
|
5
|
+
- if content_for(:keywords).present?
|
|
6
|
+
%meta(name="keywords" content="#{content_for(:keywords)}")
|
|
7
|
+
- if content_for(:description).present?
|
|
8
|
+
%meta(name="description" content="#{content_for(:description)}")
|
|
9
|
+
= stylesheet_link_tag :application
|
|
10
|
+
= javascript_include_tag :application
|
|
11
|
+
= csrf_meta_tag
|
|
12
|
+
%body
|
|
13
|
+
= yield
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
|
2
|
+
|
|
3
|
+
require 'rails/all'
|
|
4
|
+
|
|
5
|
+
if defined?(Bundler)
|
|
6
|
+
# If you precompile assets before deploying to production, use this line
|
|
7
|
+
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
|
8
|
+
# If you want your assets lazily compiled in production, use this line
|
|
9
|
+
# Bundler.require(:default, :assets, Rails.env)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
require 'cmsimple'
|
|
13
|
+
require 'teabag'
|
|
14
|
+
|
|
15
|
+
module RailsTestApp
|
|
16
|
+
class Application < Rails::Application
|
|
17
|
+
config.generators do |g|
|
|
18
|
+
g.template_engine :haml
|
|
19
|
+
g.stylesheets false
|
|
20
|
+
g.javascripts false
|
|
21
|
+
g.helpers false
|
|
22
|
+
g.test_framework :rspec, :fixture => false
|
|
23
|
+
g.helper_specs false
|
|
24
|
+
g.view_specs false
|
|
25
|
+
g.integration_tool :cucumber
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Settings in config/environments/* take precedence over those specified here.
|
|
29
|
+
# Application configuration should go into files in config/initializers
|
|
30
|
+
# -- all .rb files in that directory are automatically loaded.
|
|
31
|
+
|
|
32
|
+
# Custom directories with classes and modules you want to be autoloadable.
|
|
33
|
+
# config.autoload_paths += %W(#{config.root}/extras)
|
|
34
|
+
|
|
35
|
+
# Only load the plugins named here, in the order given (default is alphabetical).
|
|
36
|
+
# :all can be used as a placeholder for all plugins not explicitly named.
|
|
37
|
+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
|
38
|
+
|
|
39
|
+
# Activate observers that should always be running.
|
|
40
|
+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
|
|
41
|
+
|
|
42
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
|
43
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
|
44
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
|
45
|
+
|
|
46
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
|
47
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
|
48
|
+
# config.i18n.default_locale = :de
|
|
49
|
+
|
|
50
|
+
# Configure the default encoding used in templates for Ruby 1.9.
|
|
51
|
+
config.encoding = "utf-8"
|
|
52
|
+
|
|
53
|
+
# Configure sensitive parameters which will be filtered from the log file.
|
|
54
|
+
config.filter_parameters += [:password]
|
|
55
|
+
|
|
56
|
+
# Enable the asset pipeline
|
|
57
|
+
config.assets.enabled = true
|
|
58
|
+
|
|
59
|
+
# asset paths for jasminerice
|
|
60
|
+
config.assets.paths << File.join(Rails.root, "..", "javascripts")
|
|
61
|
+
|
|
62
|
+
# Version of your assets, change this if you want to expire all your assets
|
|
63
|
+
config.assets.version = '1.0'
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
development:
|
|
2
|
+
adapter: mysql2
|
|
3
|
+
encoding: utf8
|
|
4
|
+
reconnect: false
|
|
5
|
+
database: cmsimple_development
|
|
6
|
+
pool: 5
|
|
7
|
+
username: root
|
|
8
|
+
password:
|
|
9
|
+
socket: /tmp/mysql.sock
|
|
10
|
+
|
|
11
|
+
test: &test
|
|
12
|
+
adapter: mysql2
|
|
13
|
+
encoding: utf8
|
|
14
|
+
reconnect: true
|
|
15
|
+
database: cmsimple_test
|
|
16
|
+
pool: 5
|
|
17
|
+
username: root
|
|
18
|
+
password:
|
|
19
|
+
socket: /tmp/mysql.sock
|
|
20
|
+
|
|
21
|
+
cucumber:
|
|
22
|
+
<<: *test
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
RailsTestApp::Application.configure do
|
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
+
|
|
4
|
+
# In the development environment your application's code is reloaded on
|
|
5
|
+
# every request. This slows down response time but is perfect for development
|
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
|
7
|
+
config.cache_classes = false
|
|
8
|
+
|
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
|
10
|
+
config.whiny_nils = true
|
|
11
|
+
|
|
12
|
+
# Show full error reports and disable caching
|
|
13
|
+
config.consider_all_requests_local = true
|
|
14
|
+
config.action_controller.perform_caching = false
|
|
15
|
+
|
|
16
|
+
# Don't care if the mailer can't send
|
|
17
|
+
config.action_mailer.raise_delivery_errors = false
|
|
18
|
+
|
|
19
|
+
# Print deprecation notices to the Rails logger
|
|
20
|
+
config.active_support.deprecation = :log
|
|
21
|
+
|
|
22
|
+
# Only use best-standards-support built into browsers
|
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
|
24
|
+
|
|
25
|
+
# Do not compress assets
|
|
26
|
+
config.assets.compress = false
|
|
27
|
+
|
|
28
|
+
# Expands the lines which load the assets
|
|
29
|
+
config.assets.debug = true
|
|
30
|
+
end
|