spree_custom_notifications 0.2 → 0.3
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.
- checksums.yaml +4 -4
- data/README.md +20 -0
- data/app/controllers/spree/admin/notifications_controller.rb +0 -2
- data/app/helpers/base_helper_decorator.rb +1 -1
- data/app/views/spree/admin/notifications/_form.html.erb +2 -2
- data/screen-shots/custom_notification_screen_admin.png +0 -0
- data/screen-shots/custom_notification_screen_store.png +0 -0
- data/spree_custom_notifications.gemspec +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97ef7c1f4e094858785c3e86b37e14e7fa7bf5d7
|
4
|
+
data.tar.gz: 87571e78b7ae38687c941d08947a1977657ca4c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 357f5adbf97f58e9cded84dfac51ab002d37ac13153af8c44eb124ddc4f9d80169c0de9f5a6ce80511a44697d754b8e6ad6d5870fcbd42039bcedd53a560fbc6
|
7
|
+
data.tar.gz: b9a3e44fada980b6827a2fd138fa1ce5dfe59f069e33fbe39f8f09cc35d569fd5256b75a5dce33280d3d75d72414eacb5deee63c0f866ad1c20e03ccfca95f98
|
data/README.md
CHANGED
@@ -32,5 +32,25 @@ bundle
|
|
32
32
|
bundle exec rails g spree_custom_notifications:install
|
33
33
|
```
|
34
34
|
|
35
|
+
Example
|
36
|
+
-------
|
37
|
+
Please refer following screenshot to create custom notifications.
|
38
|
+
|
39
|
+
Admin can add sample notification.
|
40
|
+
|
41
|
+

|
42
|
+
|
43
|
+
On store, the Notifications are displayed as following:
|
44
|
+
|
45
|
+

|
46
|
+
|
47
|
+
Customization
|
48
|
+
-------------
|
49
|
+
|
50
|
+
You can customize the styling of notification by using spree
|
51
|
+
assets customization logic.
|
52
|
+
|
53
|
+
Refer -
|
54
|
+
[http://guides.spreecommerce.com/developer/asset.html](http://guides.spreecommerce.com/developer/asset.html)
|
35
55
|
|
36
56
|
Copyright (c) 2014 [Cuberoot Software](http://www.cuberoot.in), released under the New BSD License
|
@@ -46,10 +46,8 @@ module Spree
|
|
46
46
|
def _set_notification(params)
|
47
47
|
@notification = {}
|
48
48
|
@start_date = params[:notification][:start_date]
|
49
|
-
@start_date = Time.zone.parse(params[:notification][:start_date]).getutc unless @start_date.blank?
|
50
49
|
|
51
50
|
@end_date = params[:notification][:end_date]
|
52
|
-
@end_date = Time.zone.parse(params[:notification][:end_date]).getutc unless @end_date.blank?
|
53
51
|
@message = params[:notification][:notification]
|
54
52
|
@notification = { notification: @message,
|
55
53
|
start_date: @start_date,
|
@@ -5,7 +5,7 @@ Spree::BaseHelper.class_eval do
|
|
5
5
|
session['show_notification'] = true if session['show_notification'].nil?
|
6
6
|
if session['show_notification']
|
7
7
|
session['show_notification'] = true
|
8
|
-
current_time = Time.
|
8
|
+
current_time = Time.now.getutc
|
9
9
|
notifications =
|
10
10
|
Spree::Notification.where('start_date <= :start_date_cond AND
|
11
11
|
end_date >= :end_date_cond',
|
@@ -9,7 +9,7 @@
|
|
9
9
|
</div>
|
10
10
|
<div class="field">
|
11
11
|
<%= f.fields_for :start_date do %>
|
12
|
-
<div class='label-div'><%= f.label :start_date %></div>
|
12
|
+
<div class='label-div'><%= f.label :start_date , 'Start Date ( should be in UTC )'%></div>
|
13
13
|
<div class='input-div'>
|
14
14
|
<%= f.text_field :start_date, :id => "start_date", :class => 'input-width'%>
|
15
15
|
</div>
|
@@ -17,7 +17,7 @@
|
|
17
17
|
</div>
|
18
18
|
<div class="field">
|
19
19
|
<%= f.fields_for :end_date do %>
|
20
|
-
<div class='label-div'><%= f.label :end_date %></div>
|
20
|
+
<div class='label-div'><%= f.label :end_date, 'End Date ( should be in UTC )' %></div>
|
21
21
|
<div class='input-div'>
|
22
22
|
<%= f.text_field :end_date, :id => "end_date", :class => 'input-width'%>
|
23
23
|
</div>
|
Binary file
|
Binary file
|
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'spree_custom_notifications'
|
5
|
-
s.version = '0.
|
5
|
+
s.version = '0.3'
|
6
6
|
s.summary = 'Spree Store Custom Notifications'
|
7
7
|
s.description = 'Display Custom notifications on Spree Store'
|
8
8
|
s.required_ruby_version = '>= 1.9.3'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_custom_notifications
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- prachidhabu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|
@@ -201,6 +201,8 @@ files:
|
|
201
201
|
- lib/spree_custom_notifications.rb
|
202
202
|
- lib/spree_custom_notifications/engine.rb
|
203
203
|
- lib/spree_custom_notifications/factories.rb
|
204
|
+
- screen-shots/custom_notification_screen_admin.png
|
205
|
+
- screen-shots/custom_notification_screen_store.png
|
204
206
|
- spec/spec_helper.rb
|
205
207
|
- spree_custom_notifications.gemspec
|
206
208
|
homepage:
|