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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -0
  3. data/Gemfile +2 -2
  4. data/Gemfile.lock +47 -42
  5. data/README.md +12 -2
  6. data/app/assets/javascripts/cardboard/admin.js +1 -1
  7. data/app/controllers/pages_controller.rb +3 -35
  8. data/app/controllers/url_controller.rb +33 -0
  9. data/app/decorators/controllers/application_controller_decorator.rb +3 -1
  10. data/app/helpers/cardboard/public_helper.rb +1 -1
  11. data/app/helpers/cardboard/resource_helper.rb +6 -0
  12. data/app/models/cardboard/field.rb +2 -1
  13. data/app/models/cardboard/field/rich_text.rb +5 -5
  14. data/app/models/cardboard/page.rb +30 -72
  15. data/app/models/cardboard/setting.rb +0 -2
  16. data/app/models/cardboard/template.rb +5 -0
  17. data/app/models/cardboard/url.rb +91 -0
  18. data/app/views/cardboard/pages/_sidebar.html.slim +1 -1
  19. data/app/views/layouts/cardboard/_main_topbar.html.slim +1 -1
  20. data/cardboard.gemspec +4 -2
  21. data/config/routes.rb +3 -14
  22. data/db/migrate/1_create_cardboard.rb +13 -4
  23. data/lib/cardboard/concerns/url_concern.rb +29 -0
  24. data/lib/cardboard/constraints/page_constraint.rb +7 -0
  25. data/lib/cardboard/dynamic_router.rb +34 -0
  26. data/lib/cardboard/engine.rb +3 -1
  27. data/lib/cardboard/helpers/content_for_in_controllers.rb +23 -0
  28. data/lib/cardboard/helpers/seed.rb +17 -10
  29. data/lib/cardboard/version.rb +1 -1
  30. data/lib/generators/cardboard/resource/resource_generator.rb +2 -2
  31. data/lib/generators/cardboard/resource/templates/slim/edit.html.slim +1 -1
  32. data/lib/generators/cardboard/resource/templates/slim/new.html.slim +1 -1
  33. data/test/dummy/app/controllers/blog_controller.rb +2 -0
  34. data/test/dummy/app/views/blog/index.html.slim +1 -0
  35. data/test/dummy/app/views/layouts/application.html.slim +1 -0
  36. data/test/dummy/app/views/pages/about_us.html.slim +1 -0
  37. data/test/dummy/app/views/pages/history.html.slim +3 -0
  38. data/test/dummy/app/views/{templates → pages}/home.html.slim +0 -0
  39. data/test/dummy/config/cardboard.yml +6 -2
  40. data/test/dummy/db/migrate/20140312180204_create_cardboard.rb +72 -0
  41. data/test/dummy/db/schema.rb +19 -6
  42. data/test/models/url_test.rb +11 -0
  43. metadata +32 -28
  44. data/.ruby-gemset +0 -1
  45. data/.ruby-version +0 -1
  46. data/app/views/cardboard/pages/_error.html.slim +0 -7
  47. data/app/views/cardboard/pages/_seo.html.slim +0 -6
  48. data/app/views/cardboard/pages/show.html.slim +0 -9
  49. data/test/dummy/app/views/templates/about-us.html.slim +0 -1
  50. data/test/dummy/test/fixtures/admins.yml +0 -7
  51. data/test/dummy/test/functional/admins_controller_test.rb +0 -49
  52. data/test/dummy/test/unit/admin_test.rb +0 -7
  53. data/test/dummy/test/unit/helpers/admins_helper_test.rb +0 -4
@@ -1 +0,0 @@
1
- cardboard
@@ -1 +0,0 @@
1
- 2.0.0-p247
@@ -1,7 +0,0 @@
1
-
2
- h1 views/templates/#{missing_file}.html...
3
-
4
- p make sure to overwrite this file with your own!
5
-
6
- = debug @page
7
-
@@ -1,6 +0,0 @@
1
-
2
- - if current_page.meta_seo[:title]
3
- title = current_page.meta_seo[:title]
4
- - current_page.meta_seo.each do |key, value|
5
- - unless key == "title"
6
- meta name='#{key}' content='#{value}'
@@ -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,7 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
-
3
- one:
4
- name: MyString
5
-
6
- two:
7
- name: MyString
@@ -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
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class AdminTest < ActiveSupport::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end
@@ -1,4 +0,0 @@
1
- require 'test_helper'
2
-
3
- class AdminsHelperTest < ActionView::TestCase
4
- end