refinerycms-subscriptions 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/refinery/subscriptions/subscription.rb +1 -1
- data/app/views/refinery/subscriptions/admin/subscriptions/_subscription.html.erb +3 -1
- data/app/views/refinery/subscriptions/shared/_subscription.html.erb +2 -0
- data/app/views/refinery/subscriptions/subscription_mailer/notification.text.erb +8 -0
- data/config/locales/en.yml +4 -0
- data/config/locales/hr.yml +2 -0
- data/db/migrate/2_add_name_to_subscriptions.rb +8 -0
- data/readme.md +35 -7
- metadata +4 -2
@@ -1,7 +1,9 @@
|
|
1
1
|
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(subscription) -%>">
|
2
2
|
<span class='title'>
|
3
3
|
<%= subscription.email %>
|
4
|
-
|
4
|
+
<% if subscription.first_name.present? or subscription.last_name.present? %>
|
5
|
+
<%= " - #{subscription.first_name} #{subscription.last_name}" %>
|
6
|
+
<% end %>
|
5
7
|
</span>
|
6
8
|
<span class='actions'>
|
7
9
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<div class='subscriptions'>
|
2
2
|
<%= form_for [refinery, :subscriptions, @subscription] do |f| %>
|
3
|
+
<%= f.text_field :first_name, :placeholder => t('.first_name') %><br />
|
4
|
+
<%= f.text_field :last_name, :placeholder => t('.last_name') %><br />
|
3
5
|
<%= f.email_field :email, :placeholder => t('.email') %>
|
4
6
|
<%= f.submit t('.send') %>
|
5
7
|
<% end %>
|
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
<%=raw t('.you_received_new_subscription') %>
|
4
4
|
|
5
|
+
<% unless @subscription.first_name.blank? %>
|
6
|
+
<%=raw t('.first_name') %>: <%= @subscription.first_name %>
|
7
|
+
|
8
|
+
<% end %>
|
9
|
+
<% unless @subscription.last_name.blank? %>
|
10
|
+
<%=raw t('.last_name') %>: <%= @subscription.last_name %>
|
11
|
+
|
12
|
+
<% end %>
|
5
13
|
<%=raw t('.email') %>: <%= @subscription.email %>
|
6
14
|
|
7
15
|
<%=raw Refinery::Core.site_name %>
|
data/config/locales/en.yml
CHANGED
@@ -29,11 +29,15 @@ en:
|
|
29
29
|
subscription:
|
30
30
|
send: 'Subscribe'
|
31
31
|
email: 'Email'
|
32
|
+
first_name: 'First name'
|
33
|
+
last_name: 'Last name'
|
32
34
|
subscription_mailer:
|
33
35
|
notification:
|
34
36
|
greeting: Hi there
|
35
37
|
you_received_new_subscription: You just received a new subscription to your newsletter.
|
36
38
|
email: Email
|
39
|
+
first_name: First name
|
40
|
+
last_name: Last name
|
37
41
|
closing_line: Kind Regards
|
38
42
|
ps: P.S. All your subscriptions are stored in the "Subscriptions" section of Refinery should you ever want to view it later there.
|
39
43
|
activerecord:
|
data/config/locales/hr.yml
CHANGED
data/readme.md
CHANGED
@@ -1,10 +1,38 @@
|
|
1
|
-
# Subscriptions
|
1
|
+
# Subscriptions engine for Refinery CMS.
|
2
2
|
|
3
|
-
##
|
3
|
+
## About
|
4
4
|
|
5
|
-
|
6
|
-
gem build refinerycms-subscriptions.gemspec
|
7
|
-
gem install refinerycms-subscriptions.gem
|
5
|
+
Simple Refinery's subscriptions engine that allow users to subscribe to newsletter.
|
8
6
|
|
9
|
-
|
10
|
-
|
7
|
+
|
8
|
+
### Features
|
9
|
+
|
10
|
+
* Frontend subscription form
|
11
|
+
* Email notification to admin
|
12
|
+
* *Confirm subscription - TODO*
|
13
|
+
* *Export emails to CSV - TODO*
|
14
|
+
|
15
|
+
## Installation
|
16
|
+
|
17
|
+
Include gem into your Gemfile:
|
18
|
+
|
19
|
+
gem "refinerycms-subscriptions", '~> 0.0.1'
|
20
|
+
|
21
|
+
Inside your Refinery CMS application's root directory run:
|
22
|
+
|
23
|
+
bundle install
|
24
|
+
rails generate refinery:subscriptions
|
25
|
+
rake db:migrate
|
26
|
+
rake db:seed
|
27
|
+
|
28
|
+
## Customize view
|
29
|
+
|
30
|
+
To customize view override subscription form by running
|
31
|
+
|
32
|
+
rake refinery:override view=refinery/subscriptions/shared/_subscription
|
33
|
+
|
34
|
+
## Attribution
|
35
|
+
|
36
|
+
Inspired by and modeled like RefineryCMS Inquiries engine
|
37
|
+
|
38
|
+
https://github.com/refinery/refinerycms-inquiries
|
metadata
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-subscriptions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Refactorit
|
9
|
+
- Ivan Lučev
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
@@ -87,6 +88,7 @@ files:
|
|
87
88
|
- config/locales/hr.yml
|
88
89
|
- config/routes.rb
|
89
90
|
- db/migrate/1_create_subscriptions_subscriptions.rb
|
91
|
+
- db/migrate/2_add_name_to_subscriptions.rb
|
90
92
|
- db/seeds.rb
|
91
93
|
- lib/refinerycms-subscriptions.rb
|
92
94
|
- lib/generators/refinery/subscriptions_generator.rb
|
@@ -94,7 +96,7 @@ files:
|
|
94
96
|
- lib/refinery/subscriptions/engine.rb
|
95
97
|
- lib/tasks/refinery/subscriptions.rake
|
96
98
|
- readme.md
|
97
|
-
homepage:
|
99
|
+
homepage: https://github.com/refactorit/refinerycms-subscriptions
|
98
100
|
licenses: []
|
99
101
|
post_install_message:
|
100
102
|
rdoc_options: []
|