bizarroids_slider 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +57 -0
- data/Rakefile +34 -0
- data/app/controllers/bizarroids/slider/application_controller.rb +4 -0
- data/app/controllers/bizarroids/slider/collections_controller.rb +13 -0
- data/app/controllers/bizarroids/slider/slides_controller.rb +76 -0
- data/app/helpers/bizarroids/slider/application_helper.rb +67 -0
- data/app/helpers/bizarroids/slider/collections_helper.rb +2 -0
- data/app/helpers/bizarroids/slider/slides_helper.rb +9 -0
- data/app/models/bizarroids/slider/collection.rb +38 -0
- data/app/models/bizarroids/slider/slide.rb +17 -0
- data/app/views/bizarroids/slider/collections/index.html.erb +23 -0
- data/app/views/bizarroids/slider/slides/_form.html.erb +11 -0
- data/app/views/bizarroids/slider/slides/edit.html.erb +9 -0
- data/app/views/bizarroids/slider/slides/index.html.erb +47 -0
- data/app/views/bizarroids/slider/slides/new.html.erb +9 -0
- data/config/routes.rb +11 -0
- data/lib/bizarroids/slider/config_error.rb +2 -0
- data/lib/bizarroids/slider/engine.rb +4 -0
- data/lib/bizarroids/slider/media_uploader.rb +35 -0
- data/lib/bizarroids/slider/version.rb +5 -0
- data/lib/bizarroids/slider.rb +93 -0
- data/lib/bizarroids.rb +4 -0
- data/lib/bizarroids_slider.rb +1 -0
- data/lib/generators/bizarroids/slider/install/USAGE +14 -0
- data/lib/generators/bizarroids/slider/install/install_generator.rb +23 -0
- data/lib/generators/bizarroids/slider/install/templates/bizarroids_slider.en.yml +28 -0
- data/lib/generators/bizarroids/slider/install/templates/bizarroids_slider.ru.yml +28 -0
- data/lib/generators/bizarroids/slider/install/templates/initializer.rb +5 -0
- data/lib/generators/bizarroids/slider/install/templates/migration.rb +18 -0
- data/lib/tasks/bizarroids_slider_tasks.rake +4 -0
- data/test/bizarroids_test.rb +7 -0
- data/test/controllers/bizarroids/slider/collections_controller_test.rb +7 -0
- data/test/controllers/bizarroids/slider/slides_controller_test.rb +7 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +11 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/models/ability.rb +10 -0
- data/test/dummy/app/views/layouts/application.html.erb +15 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config/application.rb +23 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +82 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/assets.rb +8 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/bizarroids_slider.rb +5 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/bizarroids_slider.en.yml +25 -0
- data/test/dummy/config/locales/bizarroids_slider.ru.yml +25 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20140803134633_create_bizarroids_slider_tables.rb +18 -0
- data/test/dummy/db/schema.rb +36 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +11010 -0
- data/test/dummy/log/test.log +1624 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/generators/config/initializers/bizarroids_slider.rb +5 -0
- data/test/dummy/tmp/generators/config/locales/bizarroids_slider.en.yml +28 -0
- data/test/dummy/tmp/generators/config/locales/bizarroids_slider.ru.yml +28 -0
- data/test/dummy/tmp/generators/config/routes.rb +4 -0
- data/test/dummy/tmp/generators/db/migrate/20140807080544_create_bizarroids_slider_tables.rb +18 -0
- data/test/fixtures/bizarroids/slider/collections.yml +11 -0
- data/test/helpers/bizarroids/slider/collections_helper_test.rb +4 -0
- data/test/helpers/bizarroids/slider/slides_helper_test.rb +4 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/lib/bizarroids/slider_test.rb +57 -0
- data/test/lib/generators/bizarroids/slider/install_generator_test.rb +33 -0
- data/test/models/bizarroids/slider/collection_test.rb +7 -0
- data/test/test_helper.rb +30 -0
- metadata +303 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/404.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
62
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/422.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>The change you wanted was rejected.</h1>
|
62
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
63
|
+
</div>
|
64
|
+
<p>If you are the application owner check the logs for more information.</p>
|
65
|
+
</div>
|
66
|
+
</body>
|
67
|
+
</html>
|
@@ -0,0 +1,66 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
6
|
+
<style>
|
7
|
+
body {
|
8
|
+
background-color: #EFEFEF;
|
9
|
+
color: #2E2F30;
|
10
|
+
text-align: center;
|
11
|
+
font-family: arial, sans-serif;
|
12
|
+
margin: 0;
|
13
|
+
}
|
14
|
+
|
15
|
+
div.dialog {
|
16
|
+
width: 95%;
|
17
|
+
max-width: 33em;
|
18
|
+
margin: 4em auto 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
div.dialog > div {
|
22
|
+
border: 1px solid #CCC;
|
23
|
+
border-right-color: #999;
|
24
|
+
border-left-color: #999;
|
25
|
+
border-bottom-color: #BBB;
|
26
|
+
border-top: #B00100 solid 4px;
|
27
|
+
border-top-left-radius: 9px;
|
28
|
+
border-top-right-radius: 9px;
|
29
|
+
background-color: white;
|
30
|
+
padding: 7px 12% 0;
|
31
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
32
|
+
}
|
33
|
+
|
34
|
+
h1 {
|
35
|
+
font-size: 100%;
|
36
|
+
color: #730E15;
|
37
|
+
line-height: 1.5em;
|
38
|
+
}
|
39
|
+
|
40
|
+
div.dialog > p {
|
41
|
+
margin: 0 0 1em;
|
42
|
+
padding: 1em;
|
43
|
+
background-color: #F7F7F7;
|
44
|
+
border: 1px solid #CCC;
|
45
|
+
border-right-color: #999;
|
46
|
+
border-left-color: #999;
|
47
|
+
border-bottom-color: #999;
|
48
|
+
border-bottom-left-radius: 4px;
|
49
|
+
border-bottom-right-radius: 4px;
|
50
|
+
border-top-color: #DADADA;
|
51
|
+
color: #666;
|
52
|
+
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
</head>
|
56
|
+
|
57
|
+
<body>
|
58
|
+
<!-- This file lives in public/500.html -->
|
59
|
+
<div class="dialog">
|
60
|
+
<div>
|
61
|
+
<h1>We're sorry, but something went wrong.</h1>
|
62
|
+
</div>
|
63
|
+
<p>If you are the application owner check the logs for more information.</p>
|
64
|
+
</div>
|
65
|
+
</body>
|
66
|
+
</html>
|
File without changes
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,28 @@
|
|
1
|
+
en:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
bizarroids/slider/slide:
|
5
|
+
one: Slide
|
6
|
+
other: Slides
|
7
|
+
|
8
|
+
attributes:
|
9
|
+
bizarroids/slider/option:
|
10
|
+
name: Name
|
11
|
+
description: Description
|
12
|
+
link: Link
|
13
|
+
media: Image
|
14
|
+
remove_media: Remove media
|
15
|
+
|
16
|
+
bizarroids:
|
17
|
+
slider:
|
18
|
+
name: Slide
|
19
|
+
new_slide: New slide
|
20
|
+
slide_updated: Slide updated
|
21
|
+
confirm_slide_destroy: Delete slide?
|
22
|
+
slide_updated: Slide updated
|
23
|
+
slide_created: Slide created
|
24
|
+
slide_destroyed: Slide destroyed
|
25
|
+
cancel: Cancel
|
26
|
+
edit: Edit
|
27
|
+
save: Save
|
28
|
+
not_set: Not set
|
@@ -0,0 +1,28 @@
|
|
1
|
+
ru:
|
2
|
+
activerecord:
|
3
|
+
models:
|
4
|
+
bizarroids/slider/slide:
|
5
|
+
one: Слайд
|
6
|
+
few: Слайда
|
7
|
+
other: Слайдов
|
8
|
+
attributes:
|
9
|
+
bizarroids/slider/slide:
|
10
|
+
name: Название
|
11
|
+
description: Описание
|
12
|
+
link: Ссылка
|
13
|
+
media: Изображение
|
14
|
+
remove_media: Удалить изображение
|
15
|
+
|
16
|
+
bizarroids:
|
17
|
+
slider:
|
18
|
+
name: Слайдер
|
19
|
+
new_slide: Новый слайд
|
20
|
+
slide_updated: Слайд обновлен
|
21
|
+
confirm_slide_destroy: Удалить слайд?
|
22
|
+
slide_updated: Слайд обновлен
|
23
|
+
slide_created: Слайд создан
|
24
|
+
slide_destroyed: Слайд удален
|
25
|
+
cancel: Отмена
|
26
|
+
edit: Редактировать
|
27
|
+
save: Сохранить
|
28
|
+
not_set: Не установлено
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class CreateBizarroidsSliderTables < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :bizarroids_slider_collections do |t|
|
4
|
+
t.string :key, :name, :description
|
5
|
+
t.integer :position
|
6
|
+
end
|
7
|
+
|
8
|
+
add_index :bizarroids_slider_collections, :key
|
9
|
+
|
10
|
+
create_table :bizarroids_slider_slides do |t|
|
11
|
+
t.references :collection
|
12
|
+
t.string :name, :description, :media, :link
|
13
|
+
t.integer :position
|
14
|
+
end
|
15
|
+
|
16
|
+
add_index :bizarroids_slider_slides, [:collection_id, :position]
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
2
|
+
|
3
|
+
# This model initially had no columns defined. If you add columns to the
|
4
|
+
# model remove the '{}' from the fixture names and add the columns immediately
|
5
|
+
# below each fixture, per the syntax in the comments below
|
6
|
+
#
|
7
|
+
one: {}
|
8
|
+
# column: value
|
9
|
+
#
|
10
|
+
two: {}
|
11
|
+
# column: value
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Bizarroids
|
4
|
+
class SliderTest < ActiveSupport::TestCase
|
5
|
+
test "is a module module" do
|
6
|
+
assert_kind_of Module, Bizarroids::Slider
|
7
|
+
end
|
8
|
+
|
9
|
+
#
|
10
|
+
# config
|
11
|
+
#
|
12
|
+
test 'setup block yields self' do
|
13
|
+
Slider.setup do |config|
|
14
|
+
assert_equal Slider, config
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
test "creating option from config" do
|
19
|
+
create_home_slider
|
20
|
+
assert_equal Slider[:home_page_slider], []
|
21
|
+
end
|
22
|
+
|
23
|
+
test "Duplicate collection key raises an error" do
|
24
|
+
clean_collections
|
25
|
+
|
26
|
+
assert_raises Bizarroids::Slider::ConfigError do
|
27
|
+
Slider.setup do |config|
|
28
|
+
config.collection :home_page_slider
|
29
|
+
config.collection :home_page_slider
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# get
|
36
|
+
#
|
37
|
+
test "respond to #get" do
|
38
|
+
assert_respond_to Bizarroids::Slider, :get
|
39
|
+
end
|
40
|
+
|
41
|
+
test "respond to #[]" do
|
42
|
+
assert_respond_to Bizarroids::Slider, :[]
|
43
|
+
end
|
44
|
+
|
45
|
+
test "get :key retuns collection" do
|
46
|
+
create_home_slider
|
47
|
+
assert_equal Bizarroids::Slider.get(:home_page_slider), []
|
48
|
+
end
|
49
|
+
|
50
|
+
#
|
51
|
+
# misc
|
52
|
+
#
|
53
|
+
test 'table name prefix' do
|
54
|
+
assert_equal Slider.table_name_prefix, 'bizarroids_slider_'
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'generators/bizarroids/slider/install/install_generator'
|
3
|
+
|
4
|
+
class Bizarroids::Slider::InstallGeneratorTest < Rails::Generators::TestCase
|
5
|
+
tests Bizarroids::Slider::InstallGenerator
|
6
|
+
destination Rails.root.join('tmp/generators')
|
7
|
+
setup do
|
8
|
+
prepare_destination
|
9
|
+
copy_routes
|
10
|
+
end
|
11
|
+
|
12
|
+
test "generator runs without errors" do
|
13
|
+
assert_nothing_raised do
|
14
|
+
run_generator ["arguments"]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
test "generator creates files" do
|
19
|
+
run_generator
|
20
|
+
#assert_file 'config/initializers/bizarroids_slider.rb'
|
21
|
+
#assert_file "config/locales/bizarroids_slider.en.yml"
|
22
|
+
#assert_file "config/locales/bizarroids_slider.ru.yml"
|
23
|
+
#assert_migration 'db/migrate/*create_bizarroids_slider_tabless.rb'
|
24
|
+
end
|
25
|
+
|
26
|
+
def copy_routes
|
27
|
+
routes = File.expand_path("config/routes.rb", Rails.root)
|
28
|
+
destination = File.join(destination_root, "config")
|
29
|
+
|
30
|
+
FileUtils.mkdir_p(destination)
|
31
|
+
FileUtils.cp routes, destination
|
32
|
+
end
|
33
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
3
|
+
|
4
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
5
|
+
require "rails/test_help"
|
6
|
+
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
8
|
+
|
9
|
+
# Load support files
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
11
|
+
|
12
|
+
class ActiveSupport::TestCase
|
13
|
+
def clean_collections
|
14
|
+
Bizarroids::Slider::Collection.destroy_all
|
15
|
+
Bizarroids::Slider.collections.clear
|
16
|
+
Bizarroids::Slider.keys.clear
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_home_slider
|
20
|
+
clean_collections
|
21
|
+
Bizarroids::Slider.setup do |config|
|
22
|
+
config.collection :home_page_slider
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
# Load fixtures from the engine
|
28
|
+
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
29
|
+
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
30
|
+
end
|