spree_awesome_blog 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. data/README.md +13 -0
  2. data/app/controllers/admin/comments_controller.rb +32 -0
  3. data/app/controllers/admin/post_images_controller.rb +55 -0
  4. data/app/controllers/admin/posts_controller.rb +19 -0
  5. data/app/controllers/comments_controller.rb +23 -0
  6. data/app/controllers/posts_controller.rb +32 -0
  7. data/app/helpers/posts_helper.rb +19 -0
  8. data/app/models/comment.rb +31 -0
  9. data/app/models/comment.rb~ +31 -0
  10. data/app/models/post.rb +47 -0
  11. data/app/stylesheets/blog.less +234 -0
  12. data/app/views/admin/comments/_form.html.erb +28 -0
  13. data/app/views/admin/comments/edit.html.erb +8 -0
  14. data/app/views/admin/comments/index.html.erb +45 -0
  15. data/app/views/admin/post_images/_form.html.erb +8 -0
  16. data/app/views/admin/post_images/edit.html.erb +18 -0
  17. data/app/views/admin/post_images/index.html.erb +44 -0
  18. data/app/views/admin/post_images/new.html.erb +22 -0
  19. data/app/views/admin/posts/_form.html.erb +39 -0
  20. data/app/views/admin/posts/edit.html.erb +8 -0
  21. data/app/views/admin/posts/index.html.erb +53 -0
  22. data/app/views/admin/posts/new.html.erb +6 -0
  23. data/app/views/comments/_form.html.erb +30 -0
  24. data/app/views/comments/new.html.erb +3 -0
  25. data/app/views/posts/_sidebar.html.erb +34 -0
  26. data/app/views/posts/_tag_cloud.html.erb +5 -0
  27. data/app/views/posts/_tags.html.erb +3 -0
  28. data/app/views/posts/index.html.erb +32 -0
  29. data/app/views/posts/index.rss.builder +18 -0
  30. data/app/views/posts/show.html.erb +43 -0
  31. data/app/views/shared/_blog_sub_menu.html.erb +9 -0
  32. data/app/views/shared/_blog_tabs.html.erb +25 -0
  33. data/config/locales/en-US.yml +35 -0
  34. data/config/routes.rb +20 -0
  35. data/lib/generators/spree_awesome_blog/install_generator.rb +14 -0
  36. data/lib/generators/templates/db/migrate/20110110042721_create_posts.rb +21 -0
  37. data/lib/generators/templates/db/migrate/20110110042722_create_comments.rb +20 -0
  38. data/lib/generators/templates/db/migrate/20110110053623_acts_as_taggable_on_migration.rb +28 -0
  39. data/lib/generators/templates/public/images/markitup/bold.png +0 -0
  40. data/lib/generators/templates/public/images/markitup/clean.png +0 -0
  41. data/lib/generators/templates/public/images/markitup/h1.png +0 -0
  42. data/lib/generators/templates/public/images/markitup/h2.png +0 -0
  43. data/lib/generators/templates/public/images/markitup/h3.png +0 -0
  44. data/lib/generators/templates/public/images/markitup/h4.png +0 -0
  45. data/lib/generators/templates/public/images/markitup/h5.png +0 -0
  46. data/lib/generators/templates/public/images/markitup/h6.png +0 -0
  47. data/lib/generators/templates/public/images/markitup/image.png +0 -0
  48. data/lib/generators/templates/public/images/markitup/italic.png +0 -0
  49. data/lib/generators/templates/public/images/markitup/link.png +0 -0
  50. data/lib/generators/templates/public/images/markitup/list-bullet.png +0 -0
  51. data/lib/generators/templates/public/images/markitup/list-numeric.png +0 -0
  52. data/lib/generators/templates/public/images/markitup/paragraph.png +0 -0
  53. data/lib/generators/templates/public/images/markitup/picture.png +0 -0
  54. data/lib/generators/templates/public/images/markitup/preview.png +0 -0
  55. data/lib/generators/templates/public/images/markitup/quotes.png +0 -0
  56. data/lib/generators/templates/public/images/markitup/stroke.png +0 -0
  57. data/lib/generators/templates/public/javascripts/admin/blog.js +15 -0
  58. data/lib/generators/templates/public/javascripts/jquery.markitup.showdown.js +1904 -0
  59. data/lib/generators/templates/public/stylesheets/admin/blog.css +163 -0
  60. data/lib/generators/templates/public/stylesheets/blog.css +34 -0
  61. data/lib/spree_awesome_blog.rb +5 -0
  62. data/lib/spree_awesome_blog/engine.rb +29 -0
  63. data/lib/spree_awesome_blog_hooks.rb +10 -0
  64. metadata +179 -0
@@ -0,0 +1,163 @@
1
+ /* -------------------------------------------------------------------
2
+ // markItUp! Universal MarkUp Engine, JQuery plugin
3
+ // By Jay Salvat - http://markitup.jaysalvat.com/
4
+ // ------------------------------------------------------------------*/
5
+ .markItUp a:link,
6
+ .markItUp a:visited {
7
+ color:#000;
8
+ text-decoration:none;
9
+ }
10
+ .markItUp {
11
+ margin:5px 0 5px 0;
12
+ }
13
+ .markItUpContainer {
14
+ }
15
+ .markItUpEditor {
16
+ padding:5px;
17
+ clear:both;
18
+ overflow:auto;
19
+ }
20
+ .markItUpPreview {
21
+ overflow:auto;
22
+ margin:10px 0;
23
+ padding: 30px;
24
+ background: #ccc;
25
+ }
26
+ .markItUpFooter {
27
+ width:100%;
28
+ }
29
+ .markItUpResizeHandle {
30
+ overflow:hidden;
31
+ width:22px; height:5px;
32
+ margin-left:auto;
33
+ margin-right:auto;
34
+ cursor:n-resize;
35
+ }
36
+ /***************************************************************************************/
37
+ /* first row of buttons */
38
+ .markItUpHeader ul {
39
+ margin: 0px;
40
+ padding: 0px;
41
+ }
42
+ .markItUpHeader ul li {
43
+ list-style:none;
44
+ float:left;
45
+ position:relative;
46
+ }
47
+ .markItUpHeader ul li:hover > ul{
48
+ display:block;
49
+ }
50
+ .markItUpHeader ul .markItUpDropMenu {
51
+ margin-right:5px;
52
+ }
53
+ .markItUpHeader ul .markItUpDropMenu li {
54
+ margin-right:0px;
55
+ }
56
+ /* next rows of buttons */
57
+ .markItUpHeader ul ul {
58
+ display:none;
59
+ position:absolute;
60
+ top:18px; left:0px;
61
+ background:#FFF;
62
+ border:1px solid #000;
63
+ }
64
+ .markItUpHeader ul ul li {
65
+ float:none;
66
+ border-bottom:1px solid #000;
67
+ }
68
+ .markItUpHeader ul ul .markItUpDropMenu {
69
+ background:#FFF;
70
+ }
71
+ .markItUpHeader ul .markItUpSeparator {
72
+ margin:0 10px;
73
+ width:1px;
74
+ height:16px;
75
+ overflow:hidden;
76
+ background-color:#CCC;
77
+ }
78
+ .markItUpHeader ul ul .markItUpSeparator {
79
+ width:auto; height:1px;
80
+ margin:0px;
81
+ }
82
+ /* next rows of buttons */
83
+ .markItUpHeader ul ul ul {
84
+ position:absolute;
85
+ top:-1px; left:150px;
86
+ }
87
+ .markItUpHeader ul ul ul li {
88
+ float:none;
89
+ }
90
+ .markItUpHeader ul a {
91
+ display:block;
92
+ width:16px; height:16px;
93
+ text-indent:-10000px;
94
+ background-repeat:no-repeat;
95
+ padding:3px;
96
+ margin:0px;
97
+ }
98
+ .markItUpHeader ul ul a {
99
+ display:block;
100
+ padding-left:0px;
101
+ text-indent:0;
102
+ width:120px;
103
+ padding:5px 5px 5px 25px;
104
+ background-position:2px 50%;
105
+ }
106
+ .markItUpHeader ul ul a:hover {
107
+ color:#FFF;
108
+ background-color:#000;
109
+ }
110
+ /* -------------------------------------------------------------------
111
+ // markItUp!
112
+ // By Jay Salvat - http://markitup.jaysalvat.com/
113
+ // ------------------------------------------------------------------*/
114
+ .markItUp .heading1 a {
115
+ background-image:url(/images/markitup/h1.png);
116
+ }
117
+ .markItUp .heading2 a {
118
+ background-image:url(/images/markitup/h2.png);
119
+ }
120
+ .markItUp .heading3 a {
121
+ background-image:url(/images/markitup/h3.png);
122
+ }
123
+ .markItUp .heading4 a {
124
+ background-image:url(/images/markitup/h4.png);
125
+ }
126
+ .markItUp .heading5 a {
127
+ background-image:url(/images/markitup/h5.png);
128
+ }
129
+ .markItUp .heading6 a {
130
+ background-image:url(/images/markitup/h6.png);
131
+ }
132
+ .markItUp .paragraph a {
133
+ background-image:url(/images/markitup/paragraph.png);
134
+ }
135
+ .markItUp .bullet-list a {
136
+ background-image:url(/images/markitup/list-bullet.png);
137
+ }
138
+ .markItUp .number-list a {
139
+ background-image:url(/images/markitup/list-numeric.png);
140
+ }
141
+ .markItUp .quotes a {
142
+ background-image:url(/images/markitup/quotes.png);
143
+ }
144
+ .markItUp .bold a {
145
+ background-image:url(/images/markitup/bold.png);
146
+ }
147
+ .markItUp .italic a {
148
+ background-image:url(/images/markitup/italic.png);
149
+ }
150
+
151
+ .markItUp .picture > a {
152
+ background-image:url(/images/markitup/picture.png);
153
+ }
154
+ .markItUp .link a {
155
+ background-image:url(/images/markitup/link.png);
156
+ }
157
+
158
+ .markItUp .clean a {
159
+ background-image:url(/images/markitup/clean.png);
160
+ }
161
+ .markItUp .preview a {
162
+ background-image:url(/images/markitup/preview.png);
163
+ }
@@ -0,0 +1,34 @@
1
+ #posts h2 { font-size: 2em; }
2
+ #posts h2 a { text-decoration: none; }
3
+ #posts .post { margin: 5px 0px; }
4
+ #posts .post hr { margin: 10px 0 20px; }
5
+ #posts .post .body { margin: 0 40px 0 0; }
6
+ #blog-archive span { cursor: pointer; }
7
+ #blog-archive a { text-decoration: none; }
8
+ #blog-archive ul.months { display: none; }
9
+ #blog-archive ul.posts { display: none; }
10
+ #blog-archive ul.posts {
11
+ list-style-type: none;
12
+ margin: 0px;
13
+ }
14
+ .tag-cloud a { text-decoration: none; }
15
+ .tag-cloud .tag1 {
16
+ font-size: 1em;
17
+ font-weight: lighter;
18
+ }
19
+ .tag-cloud .tag2 {
20
+ font-size: 1.2em;
21
+ font-weight: normal;
22
+ }
23
+ .tag-cloud .tag3 {
24
+ font-size: 1.4em;
25
+ font-weight: bold;
26
+ }
27
+ .tag-cloud .tag4 {
28
+ font-size: 1.6em;
29
+ font-weight: bolder;
30
+ }
31
+ #post h2 { margin: 0px; }
32
+ #post #body { margin: 0px 20px 0 0; }
33
+ .tags a { text-decoration: none; }
34
+ #tags a { text-decoration: none; }
@@ -0,0 +1,5 @@
1
+ require 'spree_core'
2
+ require 'spree_awesome_blog_hooks'
3
+ require 'spree_awesome_blog/engine'
4
+ require 'acts-as-taggable-on'
5
+ require 'rdiscount'
@@ -0,0 +1,29 @@
1
+ require "spree_awesome_blog"
2
+
3
+ module SpreeAwesomeBlog
4
+
5
+ class Engine < Rails::Engine
6
+
7
+ def self.activate
8
+ Spree::BaseHelper.module_eval do
9
+ def link_to_rss
10
+ tag(:link,
11
+ :rel => 'alternate',
12
+ :type => "application/rss+xml",
13
+ :title => Spree::Config[:blog_title] || "#{Spree::Config[:site_name]} Blog",
14
+ :href => posts_path(:format => :rss))
15
+ end
16
+
17
+ def markdown(text)
18
+ sanitize(RDiscount.new(text).to_html)
19
+ end
20
+ end
21
+
22
+ end
23
+
24
+ config.root = (Pathname.new(File.dirname(File.expand_path(__FILE__))) + "../../").to_s
25
+ config.to_prepare &method(:activate).to_proc
26
+
27
+ end
28
+
29
+ end
@@ -0,0 +1,10 @@
1
+ class SpreeFaqHooks < Spree::ThemeSupport::HookListener
2
+ insert_after :admin_tabs do
3
+ %(<%= tab(:posts, :label => :blog) %>)
4
+ end
5
+
6
+ insert_after :admin_inside_head do
7
+ %(<%= javascript_include_tag 'jquery.markitup.showdown.js', 'admin/blog.js' %> <%= stylesheet_link_tag 'admin/blog' %>)
8
+ end
9
+ end
10
+
metadata ADDED
@@ -0,0 +1,179 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spree_awesome_blog
3
+ version: !ruby/object:Gem::Version
4
+ hash: 3
5
+ prerelease: false
6
+ segments:
7
+ - 3
8
+ - 0
9
+ - 2
10
+ version: 3.0.2
11
+ platform: ruby
12
+ authors:
13
+ - Josh Nussbaum
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-01-19 00:00:00 -05:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: spree_core
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 101
30
+ segments:
31
+ - 0
32
+ - 30
33
+ - 1
34
+ version: 0.30.1
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: acts-as-taggable-on
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ hash: 977940590
46
+ segments:
47
+ - 2
48
+ - 0
49
+ - 0
50
+ - rc1
51
+ version: 2.0.0.rc1
52
+ type: :runtime
53
+ version_requirements: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ name: rdiscount
56
+ prerelease: false
57
+ requirement: &id003 !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - "="
61
+ - !ruby/object:Gem::Version
62
+ hash: 5
63
+ segments:
64
+ - 1
65
+ - 6
66
+ - 5
67
+ version: 1.6.5
68
+ type: :runtime
69
+ version_requirements: *id003
70
+ description:
71
+ email: joshnuss@gmail.com
72
+ executables: []
73
+
74
+ extensions: []
75
+
76
+ extra_rdoc_files: []
77
+
78
+ files:
79
+ - README.md
80
+ - lib/spree_awesome_blog/engine.rb
81
+ - lib/spree_awesome_blog_hooks.rb
82
+ - lib/spree_awesome_blog.rb
83
+ - lib/generators/spree_awesome_blog/install_generator.rb
84
+ - lib/generators/templates/public/javascripts/jquery.markitup.showdown.js
85
+ - lib/generators/templates/public/javascripts/admin/blog.js
86
+ - lib/generators/templates/public/stylesheets/blog.css
87
+ - lib/generators/templates/public/stylesheets/admin/blog.css
88
+ - lib/generators/templates/public/images/markitup/h1.png
89
+ - lib/generators/templates/public/images/markitup/h6.png
90
+ - lib/generators/templates/public/images/markitup/quotes.png
91
+ - lib/generators/templates/public/images/markitup/image.png
92
+ - lib/generators/templates/public/images/markitup/h5.png
93
+ - lib/generators/templates/public/images/markitup/h4.png
94
+ - lib/generators/templates/public/images/markitup/preview.png
95
+ - lib/generators/templates/public/images/markitup/h2.png
96
+ - lib/generators/templates/public/images/markitup/h3.png
97
+ - lib/generators/templates/public/images/markitup/italic.png
98
+ - lib/generators/templates/public/images/markitup/bold.png
99
+ - lib/generators/templates/public/images/markitup/paragraph.png
100
+ - lib/generators/templates/public/images/markitup/picture.png
101
+ - lib/generators/templates/public/images/markitup/stroke.png
102
+ - lib/generators/templates/public/images/markitup/link.png
103
+ - lib/generators/templates/public/images/markitup/clean.png
104
+ - lib/generators/templates/public/images/markitup/list-numeric.png
105
+ - lib/generators/templates/public/images/markitup/list-bullet.png
106
+ - lib/generators/templates/db/migrate/20110110042721_create_posts.rb
107
+ - lib/generators/templates/db/migrate/20110110042722_create_comments.rb
108
+ - lib/generators/templates/db/migrate/20110110053623_acts_as_taggable_on_migration.rb
109
+ - app/views/shared/_blog_sub_menu.html.erb
110
+ - app/views/shared/_blog_tabs.html.erb
111
+ - app/views/comments/new.html.erb
112
+ - app/views/comments/_form.html.erb
113
+ - app/views/posts/show.html.erb
114
+ - app/views/posts/_tags.html.erb
115
+ - app/views/posts/_tag_cloud.html.erb
116
+ - app/views/posts/_sidebar.html.erb
117
+ - app/views/posts/index.html.erb
118
+ - app/views/posts/index.rss.builder
119
+ - app/views/admin/comments/edit.html.erb
120
+ - app/views/admin/comments/_form.html.erb
121
+ - app/views/admin/comments/index.html.erb
122
+ - app/views/admin/posts/edit.html.erb
123
+ - app/views/admin/posts/new.html.erb
124
+ - app/views/admin/posts/_form.html.erb
125
+ - app/views/admin/posts/index.html.erb
126
+ - app/views/admin/post_images/edit.html.erb
127
+ - app/views/admin/post_images/new.html.erb
128
+ - app/views/admin/post_images/_form.html.erb
129
+ - app/views/admin/post_images/index.html.erb
130
+ - app/helpers/posts_helper.rb
131
+ - app/controllers/comments_controller.rb
132
+ - app/controllers/admin/comments_controller.rb
133
+ - app/controllers/admin/post_images_controller.rb
134
+ - app/controllers/admin/posts_controller.rb
135
+ - app/controllers/posts_controller.rb
136
+ - app/models/post.rb
137
+ - app/models/comment.rb
138
+ - app/models/comment.rb~
139
+ - app/stylesheets/blog.less
140
+ - config/routes.rb
141
+ - config/locales/en-US.yml
142
+ has_rdoc: true
143
+ homepage: http://spreecommerce.com
144
+ licenses: []
145
+
146
+ post_install_message:
147
+ rdoc_options: []
148
+
149
+ require_paths:
150
+ - lib
151
+ required_ruby_version: !ruby/object:Gem::Requirement
152
+ none: false
153
+ requirements:
154
+ - - ">="
155
+ - !ruby/object:Gem::Version
156
+ hash: 57
157
+ segments:
158
+ - 1
159
+ - 8
160
+ - 7
161
+ version: 1.8.7
162
+ required_rubygems_version: !ruby/object:Gem::Requirement
163
+ none: false
164
+ requirements:
165
+ - - ">="
166
+ - !ruby/object:Gem::Version
167
+ hash: 3
168
+ segments:
169
+ - 0
170
+ version: "0"
171
+ requirements:
172
+ - none
173
+ rubyforge_project:
174
+ rubygems_version: 1.3.7
175
+ signing_key:
176
+ specification_version: 3
177
+ summary: Adds a basic blog with admin management tools
178
+ test_files: []
179
+