happy_seed 0.0.19 → 0.0.21
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/Rakefile +4 -69
- data/bin/rails +12 -0
- data/bin/rspec +16 -0
- data/happy_seed.rb +5 -1
- data/happy_seed.txt +25 -18
- data/lib/generators/happy_seed/admin/admin_generator.rb +40 -5
- data/lib/generators/happy_seed/admin/templates/app/admin/campaigns.rb +10 -14
- data/lib/generators/happy_seed/admin/templates/app/admin/newsletter.rb +2 -2
- data/lib/generators/happy_seed/admin/templates/app/admin/user.rb +4 -1
- data/lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb +1 -1
- data/lib/generators/happy_seed/admin/templates/docs/README.07.admin.rdoc +33 -4
- data/lib/generators/happy_seed/angular_view/templates/docs/README.11.angular_view.rdoc +2 -4
- data/lib/generators/happy_seed/api/api_generator.rb +38 -39
- data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/base_controller.rb +4 -5
- data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/model_hash.rb +3 -20
- data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/user_tokens_controller.rb +13 -36
- data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/users_controller.rb +14 -40
- data/lib/generators/happy_seed/api/templates/config/initializers/apitome.rb +1 -1
- data/lib/generators/happy_seed/api/templates/docs/README.01.api.rdoc +4 -1
- data/lib/generators/happy_seed/api/templates/docs/api.md +2 -2
- data/lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/user_tokens_spec.rb +10 -53
- data/lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/users_spec.rb +17 -61
- data/lib/generators/happy_seed/base/base_generator.rb +47 -19
- data/lib/generators/happy_seed/base/templates/app/controllers/setup_controller.rb +1 -1
- data/lib/generators/happy_seed/base/templates/app/views/setup/index.html.haml +6 -3
- data/lib/generators/happy_seed/base/templates/application_controller.rb +1 -1
- data/lib/generators/happy_seed/base/templates/docs/README.00.base.rdoc +3 -3
- data/lib/generators/happy_seed/bootstrap/bootstrap_generator.rb +5 -2
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/application.scss +5 -1
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/components/_profile_panels.scss +62 -0
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/components/_slideup_header.scss +51 -0
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/shared/_grid.scss +0 -12
- data/lib/generators/happy_seed/bootstrap/templates/app/views/application/_javascripts.html.haml +7 -4
- data/lib/generators/happy_seed/bootstrap/templates/docs/README.01.bootstrap.rdoc +3 -0
- data/lib/generators/happy_seed/ckeditor/ckeditor_generator.rb +31 -0
- data/lib/generators/happy_seed/ckeditor/templates/docs/README.01.ckeditor.rdoc +35 -0
- data/lib/generators/happy_seed/devise/devise_generator.rb +12 -19
- data/lib/generators/happy_seed/devise/templates/app/views/devise/confirmations/new.html.haml +17 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/confirmation_instructions.html.erb +14 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/confirmation_instructions.text.rhtml +7 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/password_change.html.erb +3 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/reset_password_instructions.html.erb +15 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/reset_password_instructions.text.erb +11 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/passwords/edit.html.haml +14 -13
- data/lib/generators/happy_seed/devise/templates/app/views/devise/passwords/new.html.haml +12 -16
- data/lib/generators/happy_seed/devise/templates/app/views/devise/registrations/edit.html.haml +28 -40
- data/lib/generators/happy_seed/devise/templates/app/views/devise/registrations/new.html.haml +16 -24
- data/lib/generators/happy_seed/devise/templates/app/views/devise/sessions/new.html.haml +13 -18
- data/lib/generators/happy_seed/devise/templates/app/views/devise/shared/_links.html.erb +25 -0
- data/lib/generators/happy_seed/devise/templates/app/views/devise/unlocks/new.html.erb +16 -0
- data/lib/generators/happy_seed/devise/templates/docs/README.03.devise.rdoc +2 -2
- data/lib/generators/happy_seed/devise/templates/spec/factories/users.rb +5 -4
- data/lib/generators/happy_seed/devise/templates/spec/features/registration_spec.rb +149 -0
- data/lib/generators/happy_seed/devise/templates/spec/mailers/previews/devise_preview.rb +28 -0
- data/lib/generators/happy_seed/devise_confirmable/devise_confirmable_generator.rb +45 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/add_confirmable_to_devise.rb +24 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/app/controllers/confirmations_controller.rb +10 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/app/views/devise/invitations/edit.html.haml +22 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/app/views/devise/invitations/new.html.haml +20 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/app/views/devise/mailer/invitation_instructions.html.erb +20 -0
- data/lib/generators/happy_seed/devise_confirmable/templates/docs/README.03.devise_confirmable.rdoc +23 -0
- data/lib/generators/happy_seed/devise_invitable/devise_invitable_generator.rb +3 -1
- data/lib/generators/happy_seed/devise_invitable/templates/app/views/devise/invitations/edit.html.haml +3 -2
- data/lib/generators/happy_seed/devise_invitable/templates/app/views/devise/invitations/new.html.haml +3 -2
- data/lib/generators/happy_seed/devise_invitable/templates/app/views/devise/mailer/invitation_instructions.html.erb +20 -0
- data/lib/generators/happy_seed/devise_invitable/templates/spec/features/invitations_spec.rb +61 -0
- data/lib/generators/happy_seed/facebook/facebook_generator.rb +2 -0
- data/lib/generators/happy_seed/facebook/templates/spec/features/facebook_registration_spec.rb +72 -0
- data/lib/generators/happy_seed/googleoauth/googleoauth_generator.rb +1 -1
- data/lib/generators/happy_seed/happy_seed_generator.rb +1 -3
- data/lib/generators/happy_seed/html_email/html_email_generator.rb +32 -0
- data/lib/generators/happy_seed/html_email/templates/app/views/layouts/mailer.html.erb +244 -0
- data/lib/generators/happy_seed/html_email/templates/docs/README.01.html_email.rdoc +25 -0
- data/lib/generators/happy_seed/omniauth/omniauth_generator.rb +4 -2
- data/lib/generators/happy_seed/omniauth/templates/app/controllers/omniauth_callbacks_controller.rb +3 -13
- data/lib/generators/happy_seed/omniauth/templates/app/models/identity.rb +13 -9
- data/lib/generators/happy_seed/omniauth/templates/docs/README.04.omniauth.rdoc +5 -5
- data/lib/generators/happy_seed/omniauth/templates/spec/factories/oauth.rb +6 -1
- data/lib/generators/happy_seed/omniauth/templates/spec/features/oauth_registration_spec.rb +80 -0
- data/lib/generators/happy_seed/omniauth/templates/spec/models/identity_spec.rb +39 -12
- data/lib/generators/happy_seed/omniauth/templates/{app/models/form_user.rb → user.rb} +4 -5
- data/lib/generators/happy_seed/plugin/plugin_generator.rb +13 -11
- data/lib/generators/happy_seed/react/react_generator.rb +36 -0
- data/lib/generators/happy_seed/react/templates/docs/README.10.react.rdoc +20 -0
- data/lib/generators/happy_seed/roles/roles_generator.rb +38 -0
- data/lib/generators/happy_seed/roles/templates/ability.rb +9 -0
- data/lib/generators/happy_seed/roles/templates/docs/README.03.roles.rdoc +23 -0
- data/lib/generators/happy_seed/simple_cms/simple_cms_generator.rb +41 -0
- data/lib/generators/happy_seed/simple_cms/templates/app/admin/simple_content.rb +42 -0
- data/lib/generators/happy_seed/simple_cms/templates/app/controllers/simple_content_controller.rb +7 -0
- data/lib/generators/happy_seed/simple_cms/templates/app/models/simple_content.rb +5 -0
- data/lib/generators/happy_seed/simple_cms/templates/app/views/splash/faq.html.haml +13 -0
- data/lib/generators/happy_seed/simple_cms/templates/app/views/splash/index.html.haml +79 -0
- data/lib/generators/happy_seed/simple_cms/templates/application_helper.rb +18 -0
- data/lib/generators/happy_seed/simple_cms/templates/create_simple_contents.rb +14 -0
- data/lib/generators/happy_seed/simple_cms/templates/docs/README.04.simple_cms.rdoc +32 -0
- data/lib/generators/happy_seed/simple_cms/templates/spec/factories/oauth.rb +10 -0
- data/lib/generators/happy_seed/simple_cms/templates/spec/features/oauth_registration_spec.rb +80 -0
- data/lib/generators/happy_seed/simple_cms/templates/spec/models/identity_spec.rb +49 -0
- data/lib/generators/happy_seed/splash/templates/app/assets/stylesheets/splash.css.scss +119 -84
- data/lib/generators/happy_seed/splash/templates/app/controllers/splash_controller.rb +1 -1
- data/lib/generators/happy_seed/splash/templates/app/views/layouts/splash.html.haml +15 -18
- data/lib/generators/happy_seed/splash/templates/app/views/splash/index.html.haml +54 -92
- data/lib/generators/happy_seed/splash/templates/docs/README.02.splash.rdoc +2 -2
- data/lib/generators/happy_seed/splash/templates/spec/controllers/splash_controller_spec.rb +11 -3
- data/lib/generators/happy_seed/static/templates/source/stylesheets/application.css.scss +1 -1
- data/lib/generators/happy_seed/static_blog/templates/Gemfile.lock +45 -49
- data/lib/generators/happy_seed/twitter/templates/spec/features/twitter_oauth_registration_spec.rb +57 -0
- data/lib/generators/happy_seed/twitter/twitter_generator.rb +2 -1
- data/lib/happy_seed/cli.rb +1 -1
- data/lib/happy_seed/engine.rb +12 -0
- data/lib/happy_seed/version.rb +1 -1
- data/lib/tasks/seed.rake +56 -0
- data/{test → spec}/dummy/Rakefile +0 -0
- data/spec/dummy/app/assets/config/manifest.js +5 -0
- data/{test → spec}/dummy/app/assets/javascripts/application.js +3 -3
- data/spec/dummy/app/assets/javascripts/cable.coffee +11 -0
- data/{test → spec}/dummy/app/assets/stylesheets/application.css +4 -4
- data/spec/dummy/app/channels/application_cable/channel.rb +5 -0
- data/spec/dummy/app/channels/application_cable/connection.rb +5 -0
- data/{test → spec}/dummy/app/controllers/application_controller.rb +0 -0
- data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
- data/spec/dummy/app/jobs/application_job.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/views/layouts/application.html.erb +15 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/{test → spec}/dummy/bin/bundle +0 -0
- data/{test → spec}/dummy/bin/rails +1 -1
- data/{test → spec}/dummy/bin/rake +0 -0
- data/spec/dummy/bin/setup +34 -0
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/config.ru +8 -0
- data/spec/dummy/config/application.rb +21 -0
- data/{test → spec}/dummy/config/boot.rb +0 -0
- data/spec/dummy/config/cable.yml +10 -0
- data/{test → spec}/dummy/config/database.yml +0 -0
- data/{test → spec}/dummy/config/environment.rb +0 -0
- data/{test → spec}/dummy/config/environments/development.rb +28 -3
- data/{test → spec}/dummy/config/environments/production.rb +29 -24
- data/{test → spec}/dummy/config/environments/test.rb +6 -3
- data/spec/dummy/config/initializers/active_record_belongs_to_required_by_default.rb +6 -0
- data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
- data/{test → spec}/dummy/config/initializers/assets.rb +3 -0
- data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
- data/spec/dummy/config/initializers/callback_terminator.rb +6 -0
- data/{test → spec}/dummy/config/initializers/cookies_serializer.rb +3 -1
- data/{test → spec}/dummy/config/initializers/filter_parameter_logging.rb +0 -0
- data/{test → spec}/dummy/config/initializers/inflections.rb +0 -0
- data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
- data/spec/dummy/config/initializers/per_form_csrf_tokens.rb +4 -0
- data/spec/dummy/config/initializers/request_forgery_protection.rb +4 -0
- data/{test → spec}/dummy/config/initializers/session_store.rb +0 -0
- data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +2 -2
- data/{test → spec}/dummy/config/locales/en.yml +0 -0
- data/spec/dummy/config/puma.rb +47 -0
- data/spec/dummy/config/routes.rb +3 -0
- data/{test → spec}/dummy/config/secrets.yml +3 -3
- data/spec/dummy/db/schema.rb +16 -0
- data/{test → spec}/dummy/public/404.html +0 -0
- data/{test → spec}/dummy/public/422.html +0 -0
- data/{test → spec}/dummy/public/500.html +0 -0
- data/{test/dummy/public/favicon.ico → spec/dummy/public/apple-touch-icon-precomposed.png} +0 -0
- data/spec/dummy/public/apple-touch-icon.png +0 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/rails_helper.rb +58 -0
- data/spec/spec_helper.rb +91 -0
- metadata +195 -89
- data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/configurations_controller.rb +0 -11
- data/lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/configurations_spec.rb +0 -21
- data/lib/generators/happy_seed/base/templates/config/puma.rb +0 -15
- data/lib/generators/happy_seed/base/templates/spec/support/controller_helpers.rb +0 -12
- data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/sections/_profile_page.scss +0 -9
- data/lib/generators/happy_seed/bootstrap/templates/lib/templates/haml/scaffold/_form.html.haml +0 -5
- data/lib/generators/happy_seed/devise/templates/spec/features/forgot_password_spec.rb +0 -54
- data/lib/generators/happy_seed/devise/templates/test/mailers/previews/devise_preview.rb +0 -13
- data/lib/generators/happy_seed/omniauth/templates/spec/features/registration_spec.rb +0 -81
- data/lib/generators/happy_seed/static/templates/Gemfile.lock +0 -158
- data/lib/tasks/seed_tasks.rake +0 -4
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/dummy/config.ru +0 -4
- data/test/dummy/config/application.rb +0 -23
- data/test/dummy/config/initializers/jazz_hands.rb +0 -5
- data/test/dummy/config/routes.rb +0 -56
- data/test/seed_test.rb +0 -7
- data/test/test_helper.rb +0 -15
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
feature "Invitations", :type => :feature do
|
4
|
+
include Warden::Test::Helpers
|
5
|
+
|
6
|
+
it "should only allow logged in users to invite people" do
|
7
|
+
visit new_user_invitation_path
|
8
|
+
|
9
|
+
expect( page.body ).to include( "You need to sign in or sign up before continuing." )
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should not invite a user that already exists" do
|
13
|
+
login_as create( :user, email: "will@happyfuncorp.com" ), scope: :user
|
14
|
+
|
15
|
+
visit new_user_invitation_path
|
16
|
+
|
17
|
+
within "#new_user" do
|
18
|
+
fill_in "user_email", with: "will@happyfuncorp.com"
|
19
|
+
end
|
20
|
+
|
21
|
+
click_button "Invite User"
|
22
|
+
|
23
|
+
expect( page.body ).to include( "has already been taken" )
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should send an invite to a new user" do
|
27
|
+
login_as create( :user ), scope: :user
|
28
|
+
|
29
|
+
visit new_user_invitation_path
|
30
|
+
|
31
|
+
within "#new_user" do
|
32
|
+
fill_in "user_email", with: "will@happyfuncorp.com"
|
33
|
+
end
|
34
|
+
|
35
|
+
click_button "Invite User"
|
36
|
+
|
37
|
+
expect( page.body ).to include( "An invitation email has been sent" )
|
38
|
+
|
39
|
+
body = ActionMailer::Base.deliveries.last.body
|
40
|
+
|
41
|
+
md = body.encoded.match /(\/users\/invitation\/accept.*?)"/
|
42
|
+
if !md
|
43
|
+
assert( false, "URL NOT FOUND IN MESSAGE")
|
44
|
+
end
|
45
|
+
|
46
|
+
logout
|
47
|
+
|
48
|
+
visit md[1]
|
49
|
+
|
50
|
+
expect( page.body ).to_not include( "You are already signed in." )
|
51
|
+
|
52
|
+
within "#edit_user" do
|
53
|
+
fill_in "user_password", with: "1234567890"
|
54
|
+
fill_in "user_password_confirmation", with: "1234567890"
|
55
|
+
end
|
56
|
+
|
57
|
+
click_button "Add password"
|
58
|
+
|
59
|
+
expect( page.body ).to include( "Your password was set successfully." )
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'rails_helper'
|
2
|
+
|
3
|
+
feature "FacebookOAuthRegistration", :type => :feature do
|
4
|
+
include Warden::Test::Helpers
|
5
|
+
|
6
|
+
before do
|
7
|
+
OmniAuth.config.test_mode = true
|
8
|
+
|
9
|
+
OmniAuth.config.add_mock(:facebook, {
|
10
|
+
uid: '12345',
|
11
|
+
info: {
|
12
|
+
name: "Will Schenk",
|
13
|
+
nickname: "wschenk",
|
14
|
+
email: "will@happyfuncorp.com"
|
15
|
+
}
|
16
|
+
});
|
17
|
+
end
|
18
|
+
|
19
|
+
after do
|
20
|
+
Warden.test_reset!
|
21
|
+
Rails.application.env_config["omniauth.auth"] = nil
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should create a new user" do
|
25
|
+
visit user_facebook_omniauth_callback_path
|
26
|
+
|
27
|
+
i = Identity.first
|
28
|
+
expect( i.uid ).to eq( '12345' )
|
29
|
+
expect( i.nickname ).to eq( 'wschenk' )
|
30
|
+
expect( i.name ).to eq( 'Will Schenk' )
|
31
|
+
expect( i.email ).to eq( 'will@happyfuncorp.com' )
|
32
|
+
expect( i.user_id ).to_not be_nil
|
33
|
+
expect( i.user.email ).to eq( 'will@happyfuncorp.com' )
|
34
|
+
|
35
|
+
expect( page.body ).to include( 'Successfully authenticated from Facebook account.' )
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should merge the identity if the user already exists" do
|
39
|
+
u = create( :user )
|
40
|
+
login_as u, scope: :user
|
41
|
+
|
42
|
+
expect( User.count ).to eq(1)
|
43
|
+
expect( Identity.count ).to eq(0)
|
44
|
+
|
45
|
+
visit user_facebook_omniauth_callback_path
|
46
|
+
|
47
|
+
expect( User.count ).to eq(1)
|
48
|
+
expect( Identity.count ).to eq(1)
|
49
|
+
u = User.first
|
50
|
+
expect( u.email ).to_not eq( 'will@happyfuncorp.com' )
|
51
|
+
|
52
|
+
expect( Identity.first.user_id ).to eq( u.id )
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should populate the email address if empty" do
|
56
|
+
u = create( :oauth_user )
|
57
|
+
login_as u, scope: :user
|
58
|
+
|
59
|
+
expect( User.count ).to eq(1)
|
60
|
+
expect( User.first.email ).to_not eq( 'will@happyfuncorp.com' )
|
61
|
+
expect( Identity.count ).to eq(0)
|
62
|
+
|
63
|
+
visit user_facebook_omniauth_callback_path
|
64
|
+
|
65
|
+
expect( User.count ).to eq(1)
|
66
|
+
expect( Identity.count ).to eq(1)
|
67
|
+
u = User.first
|
68
|
+
expect( u.email ).to eq( 'will@happyfuncorp.com' )
|
69
|
+
|
70
|
+
expect( Identity.first.user_id ).to eq( u.id )
|
71
|
+
end
|
72
|
+
end
|
@@ -26,7 +26,7 @@ module HappySeed
|
|
26
26
|
directory 'app'
|
27
27
|
|
28
28
|
add_omniauth :google_oauth2, 'email,profile,offline", prompt: "consent', 'GoogleAppsClient', "google_oauth2"
|
29
|
-
insert_into_file "app/models/identity.rb", "\n
|
29
|
+
insert_into_file "app/models/identity.rb", "\n identity.refreshtoken = auth.credentials.refresh_token", after: "identity.accesstoken = auth.credentials.token"
|
30
30
|
migration_template("add_refresh_token_to_identity.rb", "db/migrate/add_refresh_token_to_identity.rb" )
|
31
31
|
end
|
32
32
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'generators/happy_seed/happy_seed_generator'
|
2
|
+
require 'generators/happy_seed/bootstrap/bootstrap_generator'
|
3
|
+
|
4
|
+
module HappySeed
|
5
|
+
module Generators
|
6
|
+
class HtmlEmailGenerator < HappySeedGenerator
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
|
9
|
+
def self.fingerprint
|
10
|
+
gem_available? 'premailer-rails'
|
11
|
+
end
|
12
|
+
|
13
|
+
def install_html_email
|
14
|
+
return if already_installed
|
15
|
+
|
16
|
+
gem 'premailer-rails'
|
17
|
+
gem 'nokogiri'
|
18
|
+
|
19
|
+
Bundler.with_clean_env do
|
20
|
+
run "bundle install --without production"
|
21
|
+
end
|
22
|
+
|
23
|
+
run 'bin/spring stop'
|
24
|
+
|
25
|
+
remove_file 'app/views/layouts/mailer.html.erb'
|
26
|
+
|
27
|
+
directory "."
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,244 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width">
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
6
|
+
<title><%= @title || "" %></title>
|
7
|
+
<style>
|
8
|
+
/* -------------------------------------
|
9
|
+
GLOBAL
|
10
|
+
------------------------------------- */
|
11
|
+
* {
|
12
|
+
font-family: "Helvetica Neue", "Helvetica", Helvetica, Arial, sans-serif;
|
13
|
+
font-size: 100%;
|
14
|
+
line-height: 1.6em;
|
15
|
+
margin: 0;
|
16
|
+
padding: 0;
|
17
|
+
}
|
18
|
+
|
19
|
+
img {
|
20
|
+
max-width: 600px;
|
21
|
+
width: 100%;
|
22
|
+
}
|
23
|
+
|
24
|
+
body {
|
25
|
+
-webkit-font-smoothing: antialiased;
|
26
|
+
height: 100%;
|
27
|
+
-webkit-text-size-adjust: none;
|
28
|
+
width: 100% !important;
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
/* -------------------------------------
|
33
|
+
ELEMENTS
|
34
|
+
------------------------------------- */
|
35
|
+
a {
|
36
|
+
color: #348eda;
|
37
|
+
}
|
38
|
+
|
39
|
+
.btn-primary {
|
40
|
+
Margin-bottom: 10px;
|
41
|
+
width: auto !important;
|
42
|
+
}
|
43
|
+
|
44
|
+
.btn-primary td {
|
45
|
+
background-color: #348eda;
|
46
|
+
border-radius: 25px;
|
47
|
+
font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
48
|
+
font-size: 14px;
|
49
|
+
text-align: center;
|
50
|
+
vertical-align: top;
|
51
|
+
}
|
52
|
+
|
53
|
+
.btn-primary td a {
|
54
|
+
background-color: #348eda;
|
55
|
+
border: solid 1px #348eda;
|
56
|
+
border-radius: 25px;
|
57
|
+
border-width: 10px 20px;
|
58
|
+
display: inline-block;
|
59
|
+
color: #ffffff;
|
60
|
+
cursor: pointer;
|
61
|
+
font-weight: bold;
|
62
|
+
line-height: 2;
|
63
|
+
text-decoration: none;
|
64
|
+
}
|
65
|
+
|
66
|
+
.last {
|
67
|
+
margin-bottom: 0;
|
68
|
+
}
|
69
|
+
|
70
|
+
.first {
|
71
|
+
margin-top: 0;
|
72
|
+
}
|
73
|
+
|
74
|
+
.padding {
|
75
|
+
padding: 10px 0;
|
76
|
+
}
|
77
|
+
|
78
|
+
|
79
|
+
/* -------------------------------------
|
80
|
+
BODY
|
81
|
+
------------------------------------- */
|
82
|
+
table.body-wrap {
|
83
|
+
padding: 20px;
|
84
|
+
width: 100%;
|
85
|
+
}
|
86
|
+
|
87
|
+
table.body-wrap .container {
|
88
|
+
border: 1px solid #f0f0f0;
|
89
|
+
}
|
90
|
+
|
91
|
+
|
92
|
+
/* -------------------------------------
|
93
|
+
FOOTER
|
94
|
+
------------------------------------- */
|
95
|
+
table.footer-wrap {
|
96
|
+
clear: both !important;
|
97
|
+
width: 100%;
|
98
|
+
}
|
99
|
+
|
100
|
+
.footer-wrap .container p {
|
101
|
+
color: #666666;
|
102
|
+
font-size: 12px;
|
103
|
+
|
104
|
+
}
|
105
|
+
|
106
|
+
table.footer-wrap a {
|
107
|
+
color: #999999;
|
108
|
+
}
|
109
|
+
|
110
|
+
|
111
|
+
/* -------------------------------------
|
112
|
+
TYPOGRAPHY
|
113
|
+
------------------------------------- */
|
114
|
+
h1,
|
115
|
+
h2,
|
116
|
+
h3 {
|
117
|
+
color: #111111;
|
118
|
+
font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
119
|
+
font-weight: 200;
|
120
|
+
line-height: 1.2em;
|
121
|
+
margin: 40px 0 10px;
|
122
|
+
}
|
123
|
+
|
124
|
+
h1 {
|
125
|
+
font-size: 36px;
|
126
|
+
}
|
127
|
+
h2 {
|
128
|
+
font-size: 28px;
|
129
|
+
}
|
130
|
+
h3 {
|
131
|
+
font-size: 22px;
|
132
|
+
}
|
133
|
+
|
134
|
+
p,
|
135
|
+
ul,
|
136
|
+
ol {
|
137
|
+
font-size: 14px;
|
138
|
+
font-weight: normal;
|
139
|
+
margin-bottom: 10px;
|
140
|
+
}
|
141
|
+
|
142
|
+
ul li,
|
143
|
+
ol li {
|
144
|
+
margin-left: 5px;
|
145
|
+
list-style-position: inside;
|
146
|
+
}
|
147
|
+
|
148
|
+
/* Center */
|
149
|
+
|
150
|
+
|
151
|
+
.center {
|
152
|
+
text-align: center;
|
153
|
+
}
|
154
|
+
|
155
|
+
table.center {
|
156
|
+
margin-left: auto;
|
157
|
+
margin-right: auto;
|
158
|
+
}
|
159
|
+
/* ---------------------------------------------------
|
160
|
+
RESPONSIVENESS
|
161
|
+
------------------------------------------------------ */
|
162
|
+
|
163
|
+
/* Set a max-width, and make it display as block so it will automatically stretch to that width, but will also shrink down on a phone or something */
|
164
|
+
.container {
|
165
|
+
clear: both !important;
|
166
|
+
display: block !important;
|
167
|
+
Margin: 0 auto !important;
|
168
|
+
max-width: 600px !important;
|
169
|
+
}
|
170
|
+
|
171
|
+
/* Set the padding on the td rather than the div for Outlook compatibility */
|
172
|
+
.body-wrap .container {
|
173
|
+
padding: 20px;
|
174
|
+
}
|
175
|
+
|
176
|
+
/* This should also be a block element, so that it will fill 100% of the .container */
|
177
|
+
.content {
|
178
|
+
display: block;
|
179
|
+
margin: 0 auto;
|
180
|
+
max-width: 600px;
|
181
|
+
}
|
182
|
+
|
183
|
+
/* Let's make sure tables in the content area are 100% wide */
|
184
|
+
.content table {
|
185
|
+
width: 100%;
|
186
|
+
}
|
187
|
+
|
188
|
+
</style>
|
189
|
+
</head>
|
190
|
+
|
191
|
+
<body bgcolor="#f6f6f6">
|
192
|
+
|
193
|
+
<!-- body -->
|
194
|
+
<table class="body-wrap" bgcolor="#f6f6f6">
|
195
|
+
<tr>
|
196
|
+
<td></td>
|
197
|
+
<td class="container" bgcolor="#FFFFFF">
|
198
|
+
|
199
|
+
<!-- content -->
|
200
|
+
<div class="content">
|
201
|
+
<table>
|
202
|
+
<tr>
|
203
|
+
<td>
|
204
|
+
<%= yield %>
|
205
|
+
<p><a href="http://twitter.com/happyfuncorp">Follow @happyfuncorp on Twitter</a></p>
|
206
|
+
</td>
|
207
|
+
</tr>
|
208
|
+
</table>
|
209
|
+
</div>
|
210
|
+
<!-- /content -->
|
211
|
+
|
212
|
+
</td>
|
213
|
+
<td></td>
|
214
|
+
</tr>
|
215
|
+
</table>
|
216
|
+
<!-- /body -->
|
217
|
+
|
218
|
+
<!-- footer -->
|
219
|
+
<table class="footer-wrap">
|
220
|
+
<tr>
|
221
|
+
<td></td>
|
222
|
+
<td class="container">
|
223
|
+
|
224
|
+
<!-- content -->
|
225
|
+
<div class="content">
|
226
|
+
<table>
|
227
|
+
<tr>
|
228
|
+
<td align="center">
|
229
|
+
<p>This email was sent by a user of HappySeed gem
|
230
|
+
</p>
|
231
|
+
</td>
|
232
|
+
</tr>
|
233
|
+
</table>
|
234
|
+
</div>
|
235
|
+
<!-- /content -->
|
236
|
+
|
237
|
+
</td>
|
238
|
+
<td></td>
|
239
|
+
</tr>
|
240
|
+
</table>
|
241
|
+
<!-- /footer -->
|
242
|
+
|
243
|
+
</body>
|
244
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
HappySeed Html Email Install
|
2
|
+
=================
|
3
|
+
|
4
|
+
### What does this do?
|
5
|
+
|
6
|
+
* Installs `premailer-rails` gem
|
7
|
+
* Installs html mail layout
|
8
|
+
|
9
|
+
### Why do you want this?
|
10
|
+
|
11
|
+
HTML emails become much easier to create and look better out of the box.
|
12
|
+
|
13
|
+
Because HTML emails require inline styles, they are unpleasant to maintain. The premailer-rails gem will let you define your CSS in a style block on the top of the html email, and then parse the HTML and apply the inline styles directly. This way you can just write css like you normally do with no hassle.
|
14
|
+
|
15
|
+
We also define a base CSS styling in the base layout so things look a little cleaner.
|
16
|
+
|
17
|
+
For a more detailed outline of what all you can do with the premailer gem check it out on github [here.](https://github.com/fphilipe/premailer-rails)
|
18
|
+
|
19
|
+
### Environment Variables
|
20
|
+
|
21
|
+
n/a
|
22
|
+
|
23
|
+
### What needs to be done?
|
24
|
+
|
25
|
+
All you need to do is update the styling to match your designs.
|