knowledge_base 0.0.3
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/Rakefile +28 -0
- data/app/assets/javascripts/knowledge_base/application.js +13 -0
- data/app/assets/stylesheets/knowledge_base/application.css +15 -0
- data/app/controllers/knowledge_base/application_controller.rb +4 -0
- data/app/controllers/knowledge_base/articles_controller.rb +17 -0
- data/app/controllers/knowledge_base/categories_controller.rb +13 -0
- data/app/helpers/knowledge_base/application_helper.rb +4 -0
- data/app/models/knowledge_base/article.rb +13 -0
- data/app/models/knowledge_base/category.rb +16 -0
- data/app/models/knowledge_base/category_article_association.rb +6 -0
- data/app/models/knowledge_base/section.rb +9 -0
- data/app/models/knowledge_base/sectionables.rb +7 -0
- data/app/models/knowledge_base/sectionables/gallery.rb +5 -0
- data/app/models/knowledge_base/sectionables/gallery/image.rb +7 -0
- data/app/models/knowledge_base/sectionables/image.rb +5 -0
- data/app/models/knowledge_base/sectionables/links.rb +5 -0
- data/app/models/knowledge_base/sectionables/links/link.rb +10 -0
- data/app/models/knowledge_base/sectionables/list.rb +5 -0
- data/app/models/knowledge_base/sectionables/list/item.rb +5 -0
- data/app/models/knowledge_base/sectionables/text.rb +4 -0
- data/app/models/knowledge_base/sectionables/video.rb +9 -0
- data/app/uploaders/knowledge_base/image_uploader.rb +53 -0
- data/app/views/knowledge_base/articles/show.html.erb +11 -0
- data/app/views/knowledge_base/categories/index.html.erb +11 -0
- data/app/views/knowledge_base/categories/show.html.erb +15 -0
- data/app/views/knowledge_base/sectionables/galleries/_gallery.html.erb +17 -0
- data/app/views/knowledge_base/sectionables/images/_image.html.erb +5 -0
- data/app/views/knowledge_base/sectionables/links/_links.html.erb +5 -0
- data/app/views/knowledge_base/sectionables/lists/_list.html.erb +17 -0
- data/app/views/knowledge_base/sectionables/texts/_text.html.erb +9 -0
- data/app/views/knowledge_base/sectionables/videos/_video.html.erb +1 -0
- data/app/views/layouts/knowledge_base/application.html.erb +14 -0
- data/config/routes.rb +5 -0
- data/db/migrate/20140303102920_create_knowledge_base_categories.rb +16 -0
- data/db/migrate/20140303152945_create_knowledge_base_articles.rb +13 -0
- data/db/migrate/20140305134249_create_knowledge_base_sections.rb +13 -0
- data/db/migrate/20140306103853_create_knowledge_base_sectionables_texts.rb +11 -0
- data/db/migrate/20140306123236_create_knowledge_base_sectionables_images.rb +10 -0
- data/db/migrate/20140306134124_add_article_id_to_sections.rb +7 -0
- data/db/migrate/20140306134616_remove_kind_from_sections.rb +5 -0
- data/db/migrate/20140306162143_polymorphize_sections.rb +11 -0
- data/db/migrate/20140306181906_create_knowledge_base_sectionables_videos.rb +9 -0
- data/db/migrate/20140306194339_create_knowledge_base_sectionables_galleries.rb +10 -0
- data/db/migrate/20140306194600_create_knowledge_base_sectionables_gallery_images.rb +12 -0
- data/db/migrate/20140306200631_create_knowledge_base_sectionables_lists.rb +10 -0
- data/db/migrate/20140306210259_create_knowledge_base_sectionables_list_items.rb +12 -0
- data/db/migrate/20140307080616_create_knowledge_base_category_article_associations.rb +16 -0
- data/db/migrate/20140307092627_create_knowledge_base_sectionables_links.rb +8 -0
- data/db/migrate/20140307092719_create_knowledge_base_sectionables_links_links.rb +12 -0
- data/lib/knowledge_base.rb +15 -0
- data/lib/knowledge_base/configuration.rb +5 -0
- data/lib/knowledge_base/engine.rb +15 -0
- data/lib/knowledge_base/version.rb +3 -0
- data/lib/tasks/knowledge_base_tasks.rake +4 -0
- data/spec/controllers/knowledge_base/articles_controller_spec.rb +20 -0
- data/spec/controllers/knowledge_base/categories_controller_spec.rb +25 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +23 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +30 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +83 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +4 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/schema.rb +134 -0
- data/spec/dummy/db/seeds.rb +28 -0
- data/spec/dummy/log/development.log +12030 -0
- data/spec/dummy/log/test.log +917 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/uploads/knowledge_base/sectionables/gallery/image/image/1/parrot.png +0 -0
- data/spec/dummy/public/uploads/knowledge_base/sectionables/gallery/image/image/2/parrot.png +0 -0
- data/spec/dummy/public/uploads/knowledge_base/sectionables/image/image/1/parrot.png +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/062b47a3a70e4df7224b893bf001a98f +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/183c0bd4fe8641adfc2b9f735484664a +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/2f86727a5dfdf38270057bb8a6b140bc +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/32c50a0141ffd19eb481b35a22532865 +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/806fae72d2de8ab235cdf1503e8c950b +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/e9c371dd2bf884ad2ab7c34915daf486 +0 -0
- data/spec/dummy/tmp/pids/server.pid +1 -0
- data/spec/factories/knowledge_base_articles.rb +9 -0
- data/spec/factories/knowledge_base_categories.rb +10 -0
- data/spec/factories/knowledge_base_category_article_associations.rb +9 -0
- data/spec/factories/knowledge_base_sectionables_galleries.rb +8 -0
- data/spec/factories/knowledge_base_sectionables_gallery_images.rb +10 -0
- data/spec/factories/knowledge_base_sectionables_images.rb +8 -0
- data/spec/factories/knowledge_base_sectionables_links.rb +6 -0
- data/spec/factories/knowledge_base_sectionables_links_links.rb +9 -0
- data/spec/factories/knowledge_base_sectionables_list_items.rb +10 -0
- data/spec/factories/knowledge_base_sectionables_lists.rb +8 -0
- data/spec/factories/knowledge_base_sectionables_texts.rb +11 -0
- data/spec/factories/knowledge_base_sectionables_videos.rb +7 -0
- data/spec/factories/knowledge_base_sections.rb +9 -0
- data/spec/fixtures/parrot.png +0 -0
- data/spec/lib/knowledge_base/configuration_spec.rb +14 -0
- data/spec/models/knowledge_base/article_spec.rb +7 -0
- data/spec/models/knowledge_base/category_article_association_spec.rb +7 -0
- data/spec/models/knowledge_base/category_spec.rb +7 -0
- data/spec/models/knowledge_base/section_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/gallery/image_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/gallery_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/image_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/links/link_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/links_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/list/item_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/list_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/text_spec.rb +7 -0
- data/spec/models/knowledge_base/sectionables/video_spec.rb +13 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/views/knowledge_base/articles/show.html.erb_spec.rb +5 -0
- data/spec/views/knowledge_base/categories/index.html.erb_spec.rb +5 -0
- data/spec/views/knowledge_base/categories/show.html.erb_spec.rb +5 -0
- metadata +375 -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
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
26030
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Read about factories at https://github.com/thoughtbot/factory_girl
|
2
|
+
|
3
|
+
FactoryGirl.define do
|
4
|
+
factory :knowledge_base_category, aliases: [:category], class: 'KnowledgeBase::Category' do
|
5
|
+
title "MyString"
|
6
|
+
description "MyText"
|
7
|
+
category nil
|
8
|
+
sequence(:position)
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Read about factories at https://github.com/thoughtbot/factory_girl
|
2
|
+
|
3
|
+
FactoryGirl.define do
|
4
|
+
factory :knowledge_base_category_article_association, aliases: [:category_article_association], class: 'KnowledgeBase::CategoryArticleAssociation' do
|
5
|
+
category nil
|
6
|
+
article nil
|
7
|
+
position 1
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Read about factories at https://github.com/thoughtbot/factory_girl
|
2
|
+
|
3
|
+
FactoryGirl.define do
|
4
|
+
factory :knowledge_base_sectionables_gallery_image, :class => 'Sectionables::Gallery::Image' do
|
5
|
+
caption "MyString"
|
6
|
+
image "MyString"
|
7
|
+
position 1
|
8
|
+
gallery nil
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Read about factories at https://github.com/thoughtbot/factory_girl
|
2
|
+
|
3
|
+
FactoryGirl.define do
|
4
|
+
factory :knowledge_base_sectionables_list_item, aliases: [:item], class: 'Sectionables::List::Item' do
|
5
|
+
title "MyString"
|
6
|
+
body "MyText"
|
7
|
+
position 1
|
8
|
+
list nil
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Read about factories at https://github.com/thoughtbot/factory_girl
|
2
|
+
|
3
|
+
FactoryGirl.define do
|
4
|
+
factory :knowledge_base_sectionables_text, aliases: [:text], class: 'Sectionables::Text' do
|
5
|
+
heading "MyString"
|
6
|
+
lead "MyText"
|
7
|
+
body "MyText"
|
8
|
+
weight "MyString"
|
9
|
+
sectionable nil
|
10
|
+
end
|
11
|
+
end
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe KnowledgeBase::Configuration do
|
4
|
+
{
|
5
|
+
storage: 'fog'
|
6
|
+
}.each do |key, value|
|
7
|
+
|
8
|
+
it "can configure #{key}" do
|
9
|
+
subject.send "#{key}=", 'configuration'
|
10
|
+
|
11
|
+
expect(subject.send(key)).to eq 'configuration'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|