spina 0.8.3 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spina might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +63 -52
- data/app/assets/javascripts/spina/admin/application.js +0 -1
- data/app/controllers/spina/admin/accounts_controller.rb +11 -16
- data/app/controllers/spina/admin/admin_controller.rb +12 -23
- data/app/controllers/spina/admin/attachments_controller.rb +1 -1
- data/app/controllers/spina/admin/pages_controller.rb +14 -7
- data/app/controllers/spina/admin/photos_controller.rb +4 -2
- data/app/controllers/spina/admin/sessions_controller.rb +3 -3
- data/app/controllers/spina/admin/users_controller.rb +3 -3
- data/app/controllers/spina/application_controller.rb +7 -3
- data/app/controllers/spina/pages_controller.rb +13 -2
- data/app/controllers/spina/sitemaps_controller.rb +1 -0
- data/app/helpers/spina/admin/pages_helper.rb +12 -2
- data/app/helpers/spina/application_helper.rb +0 -9
- data/app/models/concerns/spina/part.rb +31 -0
- data/app/models/{spina → concerns/spina}/partable.rb +0 -0
- data/app/models/spina/ability.rb +0 -1
- data/app/models/spina/account.rb +6 -6
- data/app/models/spina/attachment.rb +1 -1
- data/app/models/spina/layout_part.rb +4 -27
- data/app/models/spina/line.rb +2 -0
- data/app/models/spina/page.rb +24 -5
- data/app/models/spina/page_part.rb +6 -30
- data/app/models/spina/structure_part.rb +7 -19
- data/app/models/spina/text.rb +2 -0
- data/app/views/layouts/spina/admin/application.html.haml +12 -14
- data/app/views/layouts/spina/admin/media_library.html.haml +4 -4
- data/app/views/layouts/spina/admin/settings.html.haml +7 -8
- data/app/views/layouts/spina/admin/website.html.haml +9 -16
- data/app/views/spina/admin/accounts/style.html.haml +10 -10
- data/app/views/spina/admin/attachments/_attachment.html.haml +1 -2
- data/app/views/spina/admin/{pages/_attachment_fields.html.haml → attachments/_fields.html.haml} +0 -0
- data/app/views/spina/admin/attachments/index.html.haml +2 -7
- data/app/views/spina/admin/layout_partables/colors/_form.html.haml +4 -0
- data/app/views/spina/admin/layout_partables/lines/_form.html.haml +2 -0
- data/app/views/spina/admin/page_partables/attachment_collections/_form.html.haml +15 -0
- data/app/views/spina/admin/page_partables/attachments/_form.html.haml +14 -0
- data/app/views/spina/admin/page_partables/colors/_form.html.haml +7 -0
- data/app/views/spina/admin/page_partables/lines/_form.html.haml +5 -0
- data/app/views/spina/admin/page_partables/photo_collections/_form.html.haml +17 -0
- data/app/views/spina/admin/page_partables/photos/_form.html.haml +18 -0
- data/app/views/spina/admin/page_partables/structures/_form.html.haml +22 -0
- data/app/views/spina/admin/page_partables/texts/_form.html.haml +5 -0
- data/app/views/spina/admin/pages/_form.html.haml +11 -8
- data/app/views/spina/admin/pages/_form_advanced.html.haml +3 -3
- data/app/views/spina/admin/pages/_form_page_content.html.haml +8 -3
- data/app/views/spina/admin/pages/_form_page_seo.html.haml +1 -1
- data/app/views/spina/admin/pages/edit.html.haml +13 -1
- data/app/views/spina/admin/photos/_photo.html.haml +1 -3
- data/app/views/spina/admin/photos/create.js.erb +1 -2
- data/app/views/spina/admin/photos/create_and_select.js.erb +7 -0
- data/app/views/spina/admin/photos/index.html.haml +7 -6
- data/app/views/spina/admin/shared/_primary_navigation.html.haml +19 -0
- data/app/views/spina/admin/shared/_rich_text_field.html.haml +2 -2
- data/app/views/spina/admin/structure_items/_fields.html.haml +16 -0
- data/app/views/spina/admin/structure_partables/lines/_form.html.haml +2 -0
- data/app/views/spina/admin/structure_partables/photos/_form.html.haml +11 -0
- data/app/views/spina/admin/structure_partables/texts/_form.html.haml +2 -0
- data/app/views/spina/sitemaps/show.xml.builder +12 -8
- data/{lib/spina/carrierwave.rb → config/initializers/spina.rb} +0 -0
- data/config/locales/de.yml +0 -26
- data/config/locales/en.yml +4 -26
- data/config/locales/es.yml +0 -26
- data/config/locales/fr.yml +4 -27
- data/config/locales/it.yml +0 -26
- data/config/locales/nl.yml +2 -28
- data/config/locales/pt-BR.yml +0 -26
- data/config/locales/ru.yml +0 -26
- data/config/locales/tr.yml +2 -28
- data/config/locales/zh-CN.yml +0 -3
- data/config/routes.rb +3 -19
- data/db/migrate/{20150507135428_create_spina_tables.rb → 1_create_spina_tables.rb} +0 -11
- data/db/migrate/2_create_spina_translation_tables.rb +13 -0
- data/lib/generators/spina/install_generator.rb +23 -9
- data/lib/generators/spina/templates/app/assets/stylesheets/demo/application.css.sass +3 -0
- data/lib/generators/spina/templates/app/views/demo/shared/_languages.html.haml +2 -0
- data/lib/generators/spina/templates/app/views/layouts/demo/application.html.haml +1 -0
- data/lib/generators/spina/templates/config/initializers/carrierwave.rb +17 -0
- data/lib/generators/spina/templates/config/initializers/spina.rb +2 -22
- data/lib/generators/spina/templates/config/initializers/themes/default.rb +29 -45
- data/lib/generators/spina/templates/config/initializers/themes/demo.rb +82 -92
- data/lib/spina.rb +24 -30
- data/lib/spina/engine.rb +2 -22
- data/lib/spina/plugin.rb +21 -3
- data/lib/spina/railtie.rb +9 -0
- data/lib/spina/theme.rb +34 -6
- data/lib/spina/version.rb +1 -1
- metadata +51 -124
- data/app/assets/javascripts/spina/admin/aviary.js.coffee +0 -25
- data/app/controllers/spina/admin/inquiries_controller.rb +0 -63
- data/app/controllers/spina/inquiries_controller.rb +0 -30
- data/app/mailers/spina/inquiry_mailer.rb +0 -19
- data/app/models/spina/inquiry.rb +0 -41
- data/app/views/layouts/spina/admin/messages.html.haml +0 -24
- data/app/views/spina/admin/accounts/aviary.html.haml +0 -26
- data/app/views/spina/admin/inquiries/inbox.html.haml +0 -30
- data/app/views/spina/admin/inquiries/index.html.haml +0 -36
- data/app/views/spina/admin/inquiries/show.html.haml +0 -23
- data/app/views/spina/admin/inquiries/spam.html.haml +0 -36
- data/app/views/spina/admin/layout_partables/_color_form.html.haml +0 -4
- data/app/views/spina/admin/layout_partables/_line_form.html.haml +0 -2
- data/app/views/spina/admin/page_partables/_attachment_collection_form.html.haml +0 -20
- data/app/views/spina/admin/page_partables/_attachment_form.html.haml +0 -19
- data/app/views/spina/admin/page_partables/_color_form.html.haml +0 -12
- data/app/views/spina/admin/page_partables/_line_form.html.haml +0 -10
- data/app/views/spina/admin/page_partables/_photo_collection_form.html.haml +0 -22
- data/app/views/spina/admin/page_partables/_photo_form.html.haml +0 -23
- data/app/views/spina/admin/page_partables/_structure_form.html.haml +0 -28
- data/app/views/spina/admin/page_partables/_text_form.html.haml +0 -10
- data/app/views/spina/admin/pages/_structure_item_fields.html.haml +0 -15
- data/app/views/spina/admin/shared/_navigation.html.haml +0 -21
- data/app/views/spina/admin/structure_partables/_line_form.html.haml +0 -2
- data/app/views/spina/admin/structure_partables/_photo_form.html.haml +0 -11
- data/app/views/spina/admin/structure_partables/_text_form.html.haml +0 -2
- data/app/views/spina/inquiries/create.html.haml +0 -2
- data/app/views/spina/inquiries/index.html.haml +0 -19
- data/app/views/spina/inquiry_mailer/inquiry.html.haml +0 -15
- data/test/dummy/README.rdoc +0 -261
- data/test/dummy/Rakefile +0 -7
- data/test/dummy/app/assets/javascripts/application.js +0 -15
- data/test/dummy/app/assets/stylesheets/default/application.css.sass +0 -0
- data/test/dummy/app/assets/stylesheets/demo/application.css.sass +0 -66
- data/test/dummy/app/assets/stylesheets/fonts.css.sass +0 -3
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/dummy/app/views/default/pages/homepage.html.haml +0 -2
- data/test/dummy/app/views/default/pages/show.html.haml +0 -3
- data/test/dummy/app/views/default/shared/_navigation.html.haml +0 -5
- data/test/dummy/app/views/demo/pages/demo.html.haml +0 -30
- data/test/dummy/app/views/demo/pages/homepage.html.haml +0 -2
- data/test/dummy/app/views/demo/pages/show.html.haml +0 -3
- data/test/dummy/app/views/demo/shared/_navigation.html.haml +0 -5
- data/test/dummy/app/views/layouts/default/application.html.haml +0 -11
- data/test/dummy/app/views/layouts/demo/application.html.haml +0 -11
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -52
- data/test/dummy/config/application.yml +0 -2
- data/test/dummy/config/boot.rb +0 -10
- data/test/dummy/config/database.yml +0 -24
- data/test/dummy/config/environment.rb +0 -5
- data/test/dummy/config/environments/development.rb +0 -41
- data/test/dummy/config/environments/production.rb +0 -70
- data/test/dummy/config/environments/test.rb +0 -38
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/dummy/config/initializers/inflections.rb +0 -15
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/session_store.rb +0 -8
- data/test/dummy/config/initializers/spina.rb +0 -33
- data/test/dummy/config/initializers/themes/default.rb +0 -47
- data/test/dummy/config/initializers/themes/demo.rb +0 -103
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/dummy/config/locales/en.yml +0 -5
- data/test/dummy/config/locales/nl.yml +0 -214
- data/test/dummy/config/routes.rb +0 -4
- data/test/dummy/config/secrets.yml +0 -7
- data/test/dummy/db/migrate/20160114085213_create_spina_tables.spina.rb +0 -167
- data/test/dummy/db/schema.rb +0 -183
- data/test/dummy/db/seeds.rb +0 -1
- data/test/dummy/public/404.html +0 -26
- data/test/dummy/public/422.html +0 -26
- data/test/dummy/public/500.html +0 -25
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +0 -6
- data/test/dummy/tmp/restart.txt +0 -0
- data/test/fixtures/spina/accounts.yml +0 -3
- data/test/fixtures/spina/pages.yml +0 -10
- data/test/fixtures/spina/users.yml +0 -5
- data/test/functional/spina/admin/admin_controller.rb +0 -36
- data/test/functional/spina/admin/sessions_controller_test.rb +0 -32
- data/test/functional/spina/pages_controller_test.rb +0 -16
- data/test/integration/navigation_test.rb +0 -8
- data/test/integration/spina/admin/login_test.rb +0 -31
- data/test/integration/spina/admin/logout_test.rb +0 -17
- data/test/integration/spina/admin/pages_test.rb +0 -34
- data/test/integration/spina/pages_test.rb +0 -19
- data/test/models/spina/line_test.rb +0 -9
- data/test/models/spina/text_test.rb +0 -9
- data/test/test_helper.rb +0 -23
- data/test/unit/helpers/spina/accounts_helper_test.rb +0 -6
- data/test/unit/helpers/spina/inquiries_helper_test.rb +0 -6
- data/test/unit/helpers/spina/page_parts_helper_test.rb +0 -6
- data/test/unit/helpers/spina/pages_helper_test.rb +0 -6
- data/test/unit/helpers/spina/photos_helper_test.rb +0 -6
- data/test/unit/helpers/spina/sessions_helper_test.rb +0 -6
- data/test/unit/helpers/spina/users_helper_test.rb +0 -6
- data/test/unit/spina/account_test.rb +0 -9
- data/test/unit/spina/file_collection_file_test.rb +0 -9
- data/test/unit/spina/gallery_test.rb +0 -9
- data/test/unit/spina/inquiry_test.rb +0 -9
- data/test/unit/spina/page_include_test.rb +0 -9
- data/test/unit/spina/page_part_test.rb +0 -9
- data/test/unit/spina/page_test.rb +0 -9
- data/test/unit/spina/photo_collection_file_test.rb +0 -9
- data/test/unit/spina/photo_collection_test.rb +0 -9
- data/test/unit/spina/photo_test.rb +0 -9
- data/test/unit/spina/user_test.rb +0 -9
File without changes
|
data/test/dummy/script/rails
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
-
|
4
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
6
|
-
require 'rails/commands'
|
data/test/dummy/tmp/restart.txt
DELETED
File without changes
|
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Spina
|
4
|
-
module Admin
|
5
|
-
class AdminControllerTest < ActionController::TestCase
|
6
|
-
setup do
|
7
|
-
class ::TestingController < AdminController
|
8
|
-
def hello
|
9
|
-
render :nothing => true
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
@routes = ::Spina::Engine.routes
|
14
|
-
|
15
|
-
ActionController::Routing::Routes.draw do |map|
|
16
|
-
map.hello '', :controller => 'testing', :action => 'hello'
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
teardown do
|
21
|
-
Object.send(:remove_const, :TestingController)
|
22
|
-
end
|
23
|
-
|
24
|
-
context 'when user is not logged in' do
|
25
|
-
setup do
|
26
|
-
@controller = TestingController.new
|
27
|
-
end
|
28
|
-
|
29
|
-
test "redirect unauthorized users to login page" do
|
30
|
-
get :hello
|
31
|
-
assert_template layout: 'spina/login'
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Spina
|
4
|
-
module Admin
|
5
|
-
class SessionsControllerTest < ActionController::TestCase
|
6
|
-
setup do
|
7
|
-
@routes = ::Spina::Engine.routes
|
8
|
-
end
|
9
|
-
|
10
|
-
test "login renders the correct layout" do
|
11
|
-
get :new
|
12
|
-
assert_template layout: 'spina/login'
|
13
|
-
end
|
14
|
-
|
15
|
-
test "should be able to login" do
|
16
|
-
post :create, email: spina_users(:bram).email, password: "password"
|
17
|
-
assert_not_nil session[:user_id]
|
18
|
-
end
|
19
|
-
|
20
|
-
test "should be able to logout" do
|
21
|
-
get :destroy
|
22
|
-
assert_nil session[:user_id]
|
23
|
-
end
|
24
|
-
|
25
|
-
test "should alert the user when wrong password" do
|
26
|
-
post :create, email: spina_users(:bram).email, password: "1234"
|
27
|
-
assert_nil session[:user_id]
|
28
|
-
assert_not_empty flash[:alert]
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Spina
|
4
|
-
class PagesControllerTest < ActionController::TestCase
|
5
|
-
setup do
|
6
|
-
@routes = Engine.routes
|
7
|
-
@current_account ||= Account.first
|
8
|
-
@current_account.theme = "default"
|
9
|
-
end
|
10
|
-
|
11
|
-
test "visit homepage" do
|
12
|
-
get :homepage
|
13
|
-
assert_response :success
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Spina
|
4
|
-
module Admin
|
5
|
-
class LoginTest < ActionDispatch::IntegrationTest
|
6
|
-
setup do
|
7
|
-
@routes = Engine.routes
|
8
|
-
end
|
9
|
-
|
10
|
-
test "login and browse pages" do
|
11
|
-
get "/admin/login"
|
12
|
-
assert_response :success
|
13
|
-
|
14
|
-
post_via_redirect "/admin/sessions", email: spina_users(:bram).email, password: "password"
|
15
|
-
assert_equal '/admin', path
|
16
|
-
|
17
|
-
get "/admin/pages"
|
18
|
-
assert_response :success
|
19
|
-
assert assigns(:pages)
|
20
|
-
end
|
21
|
-
|
22
|
-
test "login with wrong password" do
|
23
|
-
get "/admin/login"
|
24
|
-
assert_response :success
|
25
|
-
post_via_redirect "/admin/sessions", email: spina_users(:bram).email, password: "wrongpassword"
|
26
|
-
assert_equal '/admin/sessions', path
|
27
|
-
assert_nil assigns(:pages)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,17 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Spina
|
4
|
-
module Admin
|
5
|
-
class LogoutTest < ActionDispatch::IntegrationTest
|
6
|
-
setup do
|
7
|
-
@routes = Engine.routes
|
8
|
-
post_via_redirect "/admin/sessions", email: spina_users(:bram).email, password: "password"
|
9
|
-
end
|
10
|
-
|
11
|
-
test "logout and redirect to homepage" do
|
12
|
-
get_via_redirect "/admin/logout"
|
13
|
-
assert_equal '/', path
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Spina
|
4
|
-
module Admin
|
5
|
-
class PagesTest < ActionDispatch::IntegrationTest
|
6
|
-
setup do
|
7
|
-
@routes = Engine.routes
|
8
|
-
post_via_redirect "/admin/sessions", email: spina_users(:bram).email, password: "password"
|
9
|
-
end
|
10
|
-
|
11
|
-
test "new page form" do
|
12
|
-
get "/admin/pages/new"
|
13
|
-
assert_select '#new_page'
|
14
|
-
end
|
15
|
-
|
16
|
-
test "create new page" do
|
17
|
-
post_via_redirect "/admin/pages", page: {title: "A new page"}
|
18
|
-
assert_select '.breadcrumbs', text: /A\snew\spage\z/
|
19
|
-
end
|
20
|
-
|
21
|
-
test "create new page without title" do
|
22
|
-
post_via_redirect "/admin/pages", page: {title: nil}
|
23
|
-
assert_select '#error_explanation'
|
24
|
-
end
|
25
|
-
|
26
|
-
test "create concept page" do
|
27
|
-
post_via_redirect "/admin/pages", page: {title: "A new page", draft: true}
|
28
|
-
assert_select '.breadcrumbs', text: /A\snew\spage\z/
|
29
|
-
get "/admin/pages"
|
30
|
-
assert_select '.dd-item-inner small', text: '(draft)'
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
module Spina
|
4
|
-
class PagesTest < ActionDispatch::IntegrationTest
|
5
|
-
setup do
|
6
|
-
@routes = Engine.routes
|
7
|
-
end
|
8
|
-
|
9
|
-
test "view homepage" do
|
10
|
-
get "/"
|
11
|
-
assert_select 'h1', 'Homepage'
|
12
|
-
end
|
13
|
-
|
14
|
-
test "view show page" do
|
15
|
-
get "/about"
|
16
|
-
assert_select 'h1', 'About'
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
data/test/test_helper.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require "codeclimate-test-reporter"
|
2
|
-
CodeClimate::TestReporter.start
|
3
|
-
|
4
|
-
# Configure Rails Environment
|
5
|
-
ENV["RAILS_ENV"] = "test"
|
6
|
-
|
7
|
-
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
8
|
-
require "rails/test_help"
|
9
|
-
require "minitest/reporters"
|
10
|
-
|
11
|
-
Minitest::Reporters.use! Minitest::Reporters::DefaultReporter.new
|
12
|
-
|
13
|
-
# Load fixtures from the engine
|
14
|
-
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
15
|
-
ActionDispatch::IntegrationTest.fixture_path = File.expand_path("../fixtures", __FILE__)
|
16
|
-
|
17
|
-
class ActiveSupport::TestCase
|
18
|
-
fixtures :all
|
19
|
-
end
|
20
|
-
|
21
|
-
class ActionDispatch::IntegrationTest
|
22
|
-
fixtures :all
|
23
|
-
end
|