spree_news 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/Gemfile.lock +1 -1
- data/app/assets/stylesheets/admin/spree_news.css +5 -0
- data/app/assets/stylesheets/posts.css.scss +10 -9
- data/app/controllers/spree/admin/posts_controller.rb +2 -0
- data/app/models/spree/post.rb +1 -1
- data/app/views/shared/_news.html.haml +3 -5
- data/spree_news.gemspec +4 -4
- metadata +8 -8
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -3,21 +3,22 @@
|
|
3
3
|
// You can use Sass (SCSS) here: http://sass-lang.com/
|
4
4
|
|
5
5
|
.news-ticker {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
h3 {
|
7
|
+
color: #00ADEE;
|
8
|
+
}
|
9
|
+
background: white;
|
10
|
+
margin: 10px 10px 10px 10px;
|
10
11
|
padding: 10px 10px 10px 10px;
|
11
12
|
}
|
12
13
|
|
13
14
|
#news-container {
|
14
|
-
|
15
|
+
margin-top: -15px;
|
16
|
+
border: 1px solid #aaaaaa;
|
15
17
|
}
|
16
18
|
|
17
19
|
#news-container ul li div {
|
18
|
-
|
19
|
-
|
20
|
-
width: 280px;
|
21
|
-
background: #EEE7DF;
|
20
|
+
min-height: 75px;
|
21
|
+
background: white;
|
22
22
|
padding: 5px 5px 5px 5px;
|
23
23
|
}
|
24
|
+
|
@@ -41,8 +41,10 @@ class Spree::Admin::PostsController < Spree::Admin::ResourceController
|
|
41
41
|
def destroy
|
42
42
|
@post = Spree::Post.find(params[:id])
|
43
43
|
if @post.destroy
|
44
|
+
flash[:notice] = "Post deleted successfully"
|
44
45
|
redirect_to admin_posts_path
|
45
46
|
else
|
47
|
+
flash[:alert] = "Error deleting post"
|
46
48
|
redirect_to :back
|
47
49
|
end
|
48
50
|
end
|
data/app/models/spree/post.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
- if Spree::Post.all.any?
|
2
2
|
.news-ticker
|
3
|
-
%
|
4
|
-
%u
|
5
|
-
%h3 Latest News
|
3
|
+
%h3 Latest News
|
6
4
|
%p
|
7
5
|
#news-container
|
8
6
|
%ul
|
@@ -10,7 +8,7 @@
|
|
10
8
|
%li
|
11
9
|
%div
|
12
10
|
%h6= post.created_at.strftime("%B %d, %Y")
|
13
|
-
=
|
11
|
+
= post.description
|
14
12
|
|
15
13
|
:javascript
|
16
14
|
$(function(){
|
@@ -19,6 +17,6 @@
|
|
19
17
|
pause: 4000,
|
20
18
|
animation: 'fade',
|
21
19
|
mousePause: true,
|
22
|
-
showItems:
|
20
|
+
showItems: 1
|
23
21
|
});
|
24
22
|
});
|
data/spree_news.gemspec
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'spree_news'
|
5
|
-
s.version = '0.0.
|
5
|
+
s.version = '0.0.4'
|
6
6
|
s.summary = 'Adds a Javascript enabled scrolling news feed ticker wherever you call it'
|
7
|
-
s.description =
|
7
|
+
s.description = 'Provides an Admin view to create/edit posts which will be shown on the home page in a scrolling news ticker window below the products listing.'
|
8
8
|
s.required_ruby_version = '>= 1.9.2'
|
9
9
|
|
10
10
|
s.author = 'JD Warren'
|
11
11
|
s.email = 'jd@isotope11.com'
|
12
|
-
s.homepage = 'http://
|
12
|
+
s.homepage = 'http://github.com/johndavid400/spree_news'
|
13
13
|
|
14
14
|
s.files = `git ls-files`.split("\n")
|
15
15
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -17,6 +17,6 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.requirements << 'none'
|
18
18
|
|
19
19
|
s.add_dependency 'spree_core', '~> 1.0.0'
|
20
|
-
s.add_dependency 'haml'
|
20
|
+
s.add_dependency 'haml', '~> 3.1.4'
|
21
21
|
|
22
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_news
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -32,19 +32,19 @@ dependencies:
|
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
none: false
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - ~>
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 3.1.4
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - ~>
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
46
|
-
description:
|
47
|
-
|
45
|
+
version: 3.1.4
|
46
|
+
description: Provides an Admin view to create/edit posts which will be shown on the
|
47
|
+
home page in a scrolling news ticker window below the products listing.
|
48
48
|
email: jd@isotope11.com
|
49
49
|
executables: []
|
50
50
|
extensions: []
|
@@ -87,7 +87,7 @@ files:
|
|
87
87
|
- test/functional/posts_controller_test.rb
|
88
88
|
- test/unit/helpers/posts_helper_test.rb
|
89
89
|
- test/unit/post_test.rb
|
90
|
-
homepage: http://
|
90
|
+
homepage: http://github.com/johndavid400/spree_news
|
91
91
|
licenses: []
|
92
92
|
post_install_message:
|
93
93
|
rdoc_options: []
|