cardboard_cms 0.2.2 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/Gemfile +2 -2
- data/Gemfile.lock +47 -42
- data/README.md +12 -2
- data/app/assets/javascripts/cardboard/admin.js +1 -1
- data/app/controllers/pages_controller.rb +3 -35
- data/app/controllers/url_controller.rb +33 -0
- data/app/decorators/controllers/application_controller_decorator.rb +3 -1
- data/app/helpers/cardboard/public_helper.rb +1 -1
- data/app/helpers/cardboard/resource_helper.rb +6 -0
- data/app/models/cardboard/field.rb +2 -1
- data/app/models/cardboard/field/rich_text.rb +5 -5
- data/app/models/cardboard/page.rb +30 -72
- data/app/models/cardboard/setting.rb +0 -2
- data/app/models/cardboard/template.rb +5 -0
- data/app/models/cardboard/url.rb +91 -0
- data/app/views/cardboard/pages/_sidebar.html.slim +1 -1
- data/app/views/layouts/cardboard/_main_topbar.html.slim +1 -1
- data/cardboard.gemspec +4 -2
- data/config/routes.rb +3 -14
- data/db/migrate/1_create_cardboard.rb +13 -4
- data/lib/cardboard/concerns/url_concern.rb +29 -0
- data/lib/cardboard/constraints/page_constraint.rb +7 -0
- data/lib/cardboard/dynamic_router.rb +34 -0
- data/lib/cardboard/engine.rb +3 -1
- data/lib/cardboard/helpers/content_for_in_controllers.rb +23 -0
- data/lib/cardboard/helpers/seed.rb +17 -10
- data/lib/cardboard/version.rb +1 -1
- data/lib/generators/cardboard/resource/resource_generator.rb +2 -2
- data/lib/generators/cardboard/resource/templates/slim/edit.html.slim +1 -1
- data/lib/generators/cardboard/resource/templates/slim/new.html.slim +1 -1
- data/test/dummy/app/controllers/blog_controller.rb +2 -0
- data/test/dummy/app/views/blog/index.html.slim +1 -0
- data/test/dummy/app/views/layouts/application.html.slim +1 -0
- data/test/dummy/app/views/pages/about_us.html.slim +1 -0
- data/test/dummy/app/views/pages/history.html.slim +3 -0
- data/test/dummy/app/views/{templates → pages}/home.html.slim +0 -0
- data/test/dummy/config/cardboard.yml +6 -2
- data/test/dummy/db/migrate/20140312180204_create_cardboard.rb +72 -0
- data/test/dummy/db/schema.rb +19 -6
- data/test/models/url_test.rb +11 -0
- metadata +32 -28
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/app/views/cardboard/pages/_error.html.slim +0 -7
- data/app/views/cardboard/pages/_seo.html.slim +0 -6
- data/app/views/cardboard/pages/show.html.slim +0 -9
- data/test/dummy/app/views/templates/about-us.html.slim +0 -1
- data/test/dummy/test/fixtures/admins.yml +0 -7
- data/test/dummy/test/functional/admins_controller_test.rb +0 -49
- data/test/dummy/test/unit/admin_test.rb +0 -7
- data/test/dummy/test/unit/helpers/admins_helper_test.rb +0 -4
data/.ruby-gemset
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
cardboard
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.0.0-p247
|
@@ -1,9 +0,0 @@
|
|
1
|
-
- if lookup_context.exists?(current_page.template.identifier, 'templates', false)
|
2
|
-
|
3
|
-
- content_for :seo do
|
4
|
-
= render "cardboard/pages/seo"
|
5
|
-
|
6
|
-
= render template: "templates/#{current_page.template.identifier}"
|
7
|
-
|
8
|
-
- elsif Rails.env.development?
|
9
|
-
= render "cardboard/pages/error", missing_file: current_page.template.identifier
|
@@ -1 +0,0 @@
|
|
1
|
-
|about us
|
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class AdminsControllerTest < ActionController::TestCase
|
4
|
-
setup do
|
5
|
-
@admin = admins(:one)
|
6
|
-
end
|
7
|
-
|
8
|
-
test "should get index" do
|
9
|
-
get :index
|
10
|
-
assert_response :success
|
11
|
-
assert_not_nil assigns(:admins)
|
12
|
-
end
|
13
|
-
|
14
|
-
test "should get new" do
|
15
|
-
get :new
|
16
|
-
assert_response :success
|
17
|
-
end
|
18
|
-
|
19
|
-
test "should create admin" do
|
20
|
-
assert_difference('Admin.count') do
|
21
|
-
post :create, admin: { name: @admin.name }
|
22
|
-
end
|
23
|
-
|
24
|
-
assert_redirected_to admin_path(assigns(:admin))
|
25
|
-
end
|
26
|
-
|
27
|
-
test "should show admin" do
|
28
|
-
get :show, id: @admin
|
29
|
-
assert_response :success
|
30
|
-
end
|
31
|
-
|
32
|
-
test "should get edit" do
|
33
|
-
get :edit, id: @admin
|
34
|
-
assert_response :success
|
35
|
-
end
|
36
|
-
|
37
|
-
test "should update admin" do
|
38
|
-
put :update, id: @admin, admin: { name: @admin.name }
|
39
|
-
assert_redirected_to admin_path(assigns(:admin))
|
40
|
-
end
|
41
|
-
|
42
|
-
test "should destroy admin" do
|
43
|
-
assert_difference('Admin.count', -1) do
|
44
|
-
delete :destroy, id: @admin
|
45
|
-
end
|
46
|
-
|
47
|
-
assert_redirected_to admins_path
|
48
|
-
end
|
49
|
-
end
|