astrochimp 0.1.0 → 0.1.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 (71) hide show
  1. data/app/assets/stylesheets/astrochimp/application.css +0 -1
  2. data/app/controllers/astrochimp/signups_controller.rb +17 -2
  3. data/app/models/astrochimp/signup.rb +20 -1
  4. data/app/models/id_code.rb +34 -0
  5. data/app/views/astrochimp/signups/show.html.erb +14 -0
  6. data/app/views/layouts/astrochimp/application.html.erb +2 -2
  7. data/config/astrochimp.example.yml +11 -10
  8. data/config/initializers/settings.rb +10 -0
  9. data/config/routes.rb +2 -1
  10. data/db/migrate/20121101211218_add_referrals_to_astrochimp_signup.rb +10 -0
  11. data/db/migrate/20121206205605_remove_referral_code_from_astrochimp_signup.rb +6 -0
  12. data/db/migrate/20121207033108_rename_referrer_id_foreign_key_column.rb +13 -0
  13. data/db/migrate/20121207034527_rename_referrals_counter_cache_column.rb +5 -0
  14. data/lib/astrochimp/engine.rb +7 -0
  15. data/lib/astrochimp/version.rb +1 -1
  16. data/lib/generators/astrochimp/install_generator.rb +25 -0
  17. data/lib/generators/templates/README +22 -0
  18. data/lib/templates/astrochimp.html.erb +108 -0
  19. data/test/dummy/Gemfile.lock +1 -1
  20. data/test/dummy/app/views/layouts/astrochimp.html.erb +108 -0
  21. data/test/dummy/config/astrochimp.yml +11 -10
  22. data/test/dummy/config/routes.rb +2 -0
  23. data/test/dummy/custom_plan.rb +11 -0
  24. data/test/dummy/db/schema.rb +27 -0
  25. data/test/dummy/log/development.log +7846 -573
  26. data/test/dummy/log/test.log +2 -0
  27. data/test/dummy/script/rails +1 -1
  28. data/test/dummy/tmp/cache/assets/BF6/3E0/sprockets%2F0e22157423187180dd12a0884e697896 +0 -0
  29. data/test/dummy/tmp/cache/assets/C13/F40/sprockets%2F2b820513e8044233094c562a32486b6f +0 -0
  30. data/test/dummy/tmp/cache/assets/C74/7D0/sprockets%2F23b518409925cc177e9c10ba12a41793 +0 -0
  31. data/test/dummy/tmp/cache/assets/C76/DA0/sprockets%2F67c82a09313ae24199e1e13c2620509f +0 -0
  32. data/test/dummy/tmp/cache/assets/CA9/D00/sprockets%2Fd7058f81cff323f16232335023e3b4f7 +0 -0
  33. data/test/dummy/tmp/cache/assets/CAB/9E0/sprockets%2Fa0a62d5409856780f2c05770c5652ebc +0 -0
  34. data/test/dummy/tmp/cache/assets/{E2B/2A0/sprockets%2Fd24b69d435ddde8ef74e1bed05cb40cc → CDC/150/sprockets%2F54b0d0a47f8298b5eaf3617a2462b276} +0 -0
  35. data/test/dummy/tmp/cache/assets/{E01/170/sprockets%2Faecb1e97f5c4c846e209219dadba6ea9 → CDC/C90/sprockets%2F2d261384df7f0e1840fb2b825f5503f5} +0 -0
  36. data/test/dummy/tmp/cache/assets/{D07/410/sprockets%2F808b2f8e2c29dc62c26f3ab63600c741 → CFC/110/sprockets%2F874c99a5c3f7980cb838049df992a3c4} +0 -0
  37. data/test/dummy/tmp/cache/assets/{D37/100/sprockets%2Fcfd06dd08a5560c05e20626891a8dee1 → D08/BB0/sprockets%2F03029d0eae9d60d07750f52cacf57744} +0 -0
  38. data/test/dummy/tmp/cache/assets/D0F/330/sprockets%2Ffb3a577775bb1684b81bae0733c84e15 +0 -0
  39. data/test/dummy/tmp/cache/assets/D17/910/sprockets%2Fad73016095762ecae496a2889d5dd44b +0 -0
  40. data/test/dummy/tmp/cache/assets/D2B/B50/sprockets%2F34da53fc1148e615ab721a5dc651bf32 +0 -0
  41. data/test/dummy/tmp/cache/assets/D47/A90/sprockets%2Fba2d4f822a97a5e9785ae50b13d9762f +0 -0
  42. data/test/dummy/tmp/cache/assets/D59/AA0/sprockets%2F68fbced6c70c9279f837b39eb1954b83 +0 -0
  43. data/test/dummy/tmp/cache/assets/{E00/9D0/sprockets%2Fb28f287563eee75a1ba1eeedfb62ef04 → D62/DE0/sprockets%2F5983a7db4b5a7e0b476a41760a4a0daf} +0 -0
  44. data/test/dummy/tmp/cache/assets/DD5/D80/sprockets%2Fe0e2eae180a206cf97bddf9f39a7a649 +0 -0
  45. data/test/dummy/tmp/cache/assets/DE0/B60/sprockets%2F789ef22ee99ef492d4ca4ec1d6019eda +0 -0
  46. data/test/dummy/tmp/cache/assets/DF8/790/sprockets%2Fbbdc2b01b8efe4faf5ad997283a030f7 +0 -0
  47. data/test/dummy/tmp/cache/assets/{D59/940/sprockets%2Fa648ef52a3d6148f53e75be678efc857 → E80/5D0/sprockets%2F8b1fbfabd7e4e13a20eb1e6d5b6ebc5e} +0 -0
  48. data/test/dummy/tmp/restart.txt +0 -0
  49. data/test/dummy/zeus.json +23 -0
  50. metadata +128 -140
  51. data/app/assets/stylesheets/astrochimp/bootstrap-responsive.min.css +0 -9
  52. data/app/assets/stylesheets/astrochimp/bootstrap.min.css +0 -9
  53. data/test/dummy/db/migrate/20121026003306_create_astrochimp_signups.astrochimp.rb +0 -11
  54. data/test/dummy/tmp/cache/assets/C51/C00/sprockets%2F0a9b9392736374885db06f331c22f513 +0 -0
  55. data/test/dummy/tmp/cache/assets/C66/980/sprockets%2F93602859678f45592e0de1889e8a12b1 +0 -0
  56. data/test/dummy/tmp/cache/assets/C79/FB0/sprockets%2Fd01591d7915aab9e008063a78d044592 +0 -0
  57. data/test/dummy/tmp/cache/assets/C8D/DD0/sprockets%2Fa5484d6aa766752e80179438c635b66b +0 -0
  58. data/test/dummy/tmp/cache/assets/C8F/370/sprockets%2F7e998e2a8851df3061601f85853e270c +0 -0
  59. data/test/dummy/tmp/cache/assets/C90/AD0/sprockets%2F567c6d3d7725d730656d2135cf58774c +0 -0
  60. data/test/dummy/tmp/cache/assets/CA0/080/sprockets%2F5eaef194d0a72604035161f2a090a966 +0 -0
  61. data/test/dummy/tmp/cache/assets/CB0/5D0/sprockets%2F6b83920b1e8a09f1b191f35890f5c452 +0 -0
  62. data/test/dummy/tmp/cache/assets/CF9/AF0/sprockets%2F4e01c80bf7b08c7f9c7188948f93d961 +0 -0
  63. data/test/dummy/tmp/cache/assets/CFA/B50/sprockets%2Fa94a8355f6749e65ee8c59b08509b29b +0 -0
  64. data/test/dummy/tmp/cache/assets/D0F/620/sprockets%2F4e4f8255ba3658469ea5153cab4911fa +0 -0
  65. data/test/dummy/tmp/cache/assets/D1E/FD0/sprockets%2F62b680d0e485afa7259fc50f988c92d2 +0 -0
  66. data/test/dummy/tmp/cache/assets/D2B/500/sprockets%2F814cba53f20f00ea55b66b894b060f0c +0 -0
  67. data/test/dummy/tmp/cache/assets/D4B/780/sprockets%2F7e7e0c368f397c122934f064dbcca88e +0 -0
  68. data/test/dummy/tmp/cache/assets/D7D/9E0/sprockets%2F6bd865f67ed6445f71e3d50ef3dcb517 +0 -0
  69. data/test/dummy/tmp/cache/assets/D96/DA0/sprockets%2F775a2d5f4f945205adaaafdd62f1432d +0 -0
  70. data/test/dummy/tmp/cache/assets/DC2/3A0/sprockets%2Fc2142c774fce8b04e62eaaab5254bfa9 +0 -0
  71. data/test/dummy/tmp/cache/assets/EA7/EB0/sprockets%2F995eebc8953e4dbbedb5fb8b9fe70ecf +0 -0
@@ -9,7 +9,6 @@
9
9
  * compiled file, but it's generally better to create a new file per style scope.
10
10
  *
11
11
  *= require_self
12
- *= require astrochimp/bootstrap.min
13
12
  *= require_tree .
14
13
  */
15
14
 
@@ -2,6 +2,15 @@ require_dependency "astrochimp/application_controller"
2
2
 
3
3
  module Astrochimp
4
4
  class SignupsController < ApplicationController
5
+ before_filter :capture_referrer_code, only: [:index]
6
+
7
+ def capture_referrer_code
8
+ session[:referrer_id] = Signup.code_to_id(params[:referrer_code]) if params.has_key? :referrer_code
9
+ end
10
+
11
+ # User's 'astrochimp_splash' layout in THEIR app (that uses this gem)
12
+ layout "#{Rails.root}/app/views/layouts/#{ENV['AC_SPLASH_LAYOUT'] || 'astrochimp_splash'}"
13
+
5
14
  def index
6
15
  @signup = Signup.new
7
16
 
@@ -11,9 +20,13 @@ module Astrochimp
11
20
  end
12
21
  end
13
22
 
23
+ def show
24
+ @signup = Signup.find(params[:id])
25
+ end
26
+
14
27
  # POST
15
28
  def create
16
- @signup = Signup.new(params[:signup])
29
+ @signup = Signup.new(params[:signup].merge(referrer_id: session[:referrer_id]))
17
30
  @signup.status = Signup::STATUS_NEW
18
31
 
19
32
  respond_to do |format|
@@ -22,7 +35,9 @@ module Astrochimp
22
35
  format.html { render action: :index }
23
36
  format.json { render json: @signup.errors, status: :unprocessable_entity }
24
37
  else
25
- format.html { redirect_to root_url, notice: ENV['AC_SIGNUP_SUCCESS_NOTICE'] }
38
+ format.html do
39
+ redirect_to @signup, notice: ENV['AC_SIGNUP_SUCCESS_NOTICE']
40
+ end
26
41
  format.json { render json: @signup, status: :created, location: @signup }
27
42
  end
28
43
  end
@@ -1,19 +1,38 @@
1
1
  module Astrochimp
2
2
  class Signup < ActiveRecord::Base
3
3
  # Attributes
4
- attr_accessible :email
4
+ attr_accessible :email, :referrer_id
5
5
 
6
6
  # Constants
7
7
  STATUS_NEW = 0
8
8
  STATUS_SUBSCRIBED = 1
9
9
  STATUS_INVITED = 2
10
10
 
11
+ # Relations
12
+ has_many :referrals, class_name: 'Signup'
13
+ belongs_to :referrer, class_name: 'Signup', counter_cache: true
14
+
11
15
  # Validations
12
16
  validates :email, uniqueness: true, email: true
13
17
 
14
18
  # Callbacks
15
19
  before_create :add_email_to_mailchimp
16
20
 
21
+ # Include referral code functionality
22
+ include IdCode
23
+ alias :referral_code :id_code
24
+
25
+ # Return the referral code instead of id for urls
26
+ alias :to_param :referral_code
27
+
28
+ def self.find(id_or_code)
29
+ if id_or_code.is_a? Integer
30
+ super(id_or_code)
31
+ else
32
+ find_by_id_code(id_or_code)
33
+ end
34
+ end
35
+
17
36
  private
18
37
  def add_email_to_mailchimp
19
38
  # Handle any MailChimp errors
@@ -0,0 +1,34 @@
1
+ module IdCode
2
+ extend ActiveSupport::Concern
3
+
4
+ module ClassMethods
5
+ # Determines spacing between consecutive referral codes
6
+ def factor
7
+ 9
8
+ end
9
+
10
+ # determines minimum size of a referal code
11
+ def pad
12
+ 26 ** 3 # insure at least four digits
13
+ end
14
+
15
+ # Use base 26 here to avoid numeric codes
16
+ # (We want codes to be clearly distinguishable from ids)
17
+ def id_to_code(id)
18
+ (id.to_i * factor + pad).to_s(26).tr('0-9a-p', 'a-z')
19
+ end
20
+
21
+ # exact inverse of id_to_code
22
+ def code_to_id(code)
23
+ (code.to_s.tr('a-z', '0-9a-p').to_i(26) - pad) / factor
24
+ end
25
+
26
+ def find_by_id_code(code)
27
+ find(code_to_id(code))
28
+ end
29
+ end
30
+
31
+ def id_code
32
+ self.class.id_to_code(id)
33
+ end
34
+ end
@@ -0,0 +1,14 @@
1
+ <h2></h2>
2
+ <p>
3
+ Your referral link to invite others:
4
+ <%= link_to referral_link_path(referrer_code: @signup.referral_code, only_path: false),
5
+ referral_link_path(referrer_code: @signup.referral_code) %>
6
+ </p>
7
+ <p>
8
+ Number of people you have referred:
9
+ <%= @signup.signups_count %>
10
+ </p>
11
+ <p>Your signup object:</p>
12
+ <pre>
13
+ <%= @signup.inspect %>
14
+ </pre>
@@ -3,7 +3,8 @@
3
3
  <head>
4
4
  <title><%= ENV['AC_NAME'] %> Beta Signup</title>
5
5
  <%= stylesheet_link_tag "astrochimp/application" %>
6
- <link href="http://fonts.googleapis.com/css?family=Oxygen" rel="stylesheet" type="text/css" />
6
+ <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css" rel="stylesheet">
7
+ <link href="//fonts.googleapis.com/css?family=Oxygen" rel="stylesheet" type="text/css" />
7
8
  <%= csrf_meta_tags %>
8
9
  </head>
9
10
  <body>
@@ -38,7 +39,6 @@
38
39
 
39
40
  <hr />
40
41
 
41
- <%= render 'layouts/astrochimp/messages' %>
42
42
  <%= yield %>
43
43
 
44
44
  </div>
@@ -1,15 +1,16 @@
1
1
  defaults: &defaults
2
- name : Awesome Startup
3
- company : Company, LLC
4
- company_url : http://mailchimp.com
5
- twitter_user : Brightbit
6
- facebook_url : http://www.facebook.com/brightbit
7
- google_analytics_code :
8
- mailchimp_list_id :
9
- mailchimp_api_key :
10
- email_format : html
2
+ name : "Awesome Startup"
3
+ company : "Company, LLC"
4
+ company_url : "http://mailchimp.com"
5
+ twitter_user : "Brightbit"
6
+ facebook_url : "http://www.facebook.com/brightbit"
7
+ google_analytics_code : ""
8
+ mailchimp_list_id : ""
9
+ mailchimp_api_key : ""
10
+ email_format : "html"
11
11
  email_double_optin : false # true will require user to confirm their email address
12
- signup_success_notice : Thanks! We'll drop you a line when we launch!
12
+ signup_success_notice : "Thanks! We'll drop you a line when we launch!"
13
+ splash_layout : "astrochimp"
13
14
 
14
15
  development:
15
16
  <<: *defaults
@@ -13,3 +13,13 @@ config.each do |key, value|
13
13
  ENV[key] = value.to_s if !value.kind_of?(Hash) && ENV[key].blank?
14
14
  end
15
15
 
16
+ #if File.basename($0) != 'rake'
17
+ #unless ActiveRecord::Base.connection.table_exists?('astrochimp_signups')
18
+ #raise "\n\nThe Chimp wants you to run rake db:migrate\n\n"
19
+ #end
20
+
21
+ #if ENV['AC_MAILCHIMP_API_KEY'].blank? || ENV['AC_MAILCHIMP_LIST_ID'].blank?
22
+ #raise "\n\nThe Chimp wants you to set the ENV variables: AC_MAILCHIMP_API_KEY and AC_MAILCHIMP_LIST_ID.\n" <<
23
+ #"You can also set them in astrochimp.yml if you're an ape.\n\n"
24
+ #end
25
+ #end
data/config/routes.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  Astrochimp::Engine.routes.draw do
2
2
  root to: "signups#index"
3
3
 
4
- resource :signups, only: [:index, :create]
4
+ resources :signups, only: [:index, :create, :show]
5
+ get ':referrer_code' => 'signups#index', as: :referral_link
5
6
  end
@@ -0,0 +1,10 @@
1
+ class AddReferralsToAstrochimpSignup < ActiveRecord::Migration
2
+ def change
3
+ add_column :astrochimp_signups, :referral_id, :integer
4
+ add_column :astrochimp_signups, :referral_code, :string
5
+ add_column :astrochimp_signups, :referral_count, :integer, default: 0
6
+
7
+ add_index :astrochimp_signups, :referral_id
8
+ add_index :astrochimp_signups, :referral_code
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ class RemoveReferralCodeFromAstrochimpSignup < ActiveRecord::Migration
2
+ def change
3
+ remove_index :astrochimp_signups, :referral_code
4
+ remove_column :astrochimp_signups, :referral_code
5
+ end
6
+ end
@@ -0,0 +1,13 @@
1
+ class RenameReferrerIdForeignKeyColumn < ActiveRecord::Migration
2
+ def up
3
+ remove_index :astrochimp_signups, :referral_id
4
+ rename_column :astrochimp_signups, :referral_id, :referrer_id
5
+ add_index :astrochimp_signups, :referrer_id
6
+ end
7
+
8
+ def down
9
+ remove_index :astrochimp_signups, :referrer_id
10
+ rename_column :astrochimp_signups, :referrer_id, :referral_id
11
+ add_index :astrochimp_signups, :referral_id
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ class RenameReferralsCounterCacheColumn < ActiveRecord::Migration
2
+ def change
3
+ rename_column :astrochimp_signups, :referral_count, :signups_count
4
+ end
5
+ end
@@ -4,5 +4,12 @@ module Astrochimp
4
4
 
5
5
  class Engine < ::Rails::Engine
6
6
  isolate_namespace Astrochimp
7
+
8
+ initializer "astrochimp.load_app_instance_data" do |app|
9
+ app.class.configure do |config|
10
+ #Pull in all the migrations from Astrochimp to the application
11
+ config.paths['db/migrate'] += Astrochimp::Engine.paths['db/migrate'].existent
12
+ end
13
+ end
7
14
  end
8
15
  end
@@ -1,3 +1,3 @@
1
1
  module Astrochimp
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -0,0 +1,25 @@
1
+ module Astrochimp
2
+ module Generators
3
+ class InstallGenerator < Rails::Generators::Base
4
+ source_root File.expand_path("../../templates", __FILE__)
5
+
6
+ desc "Move astrochimp configuration and layout in place"
7
+
8
+ def copy_config_yml
9
+ copy_file "../../../config/astrochimp.example.yml", "config/astrochimp.yml"
10
+ end
11
+
12
+ def copy_default_layout
13
+ copy_file "../../templates/astrochimp.html.erb", "app/views/layouts/astrochimp.html.erb"
14
+ end
15
+
16
+ def add_astrochimp_routes
17
+ route 'mount Astrochimp::Engine => "/"'
18
+ end
19
+
20
+ def show_readme
21
+ readme "README" if behavior == :invoke
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,22 @@
1
+ ===============================================================================
2
+
3
+ Your app is now Chimpified!
4
+
5
+ 1. Add the astrochimp_signups table by running:
6
+
7
+ rake db:migrate
8
+
9
+ 2. Set your Mailchimp API key and List ID:
10
+
11
+ export AC_MAILCHIMP_API_KEY=abcdefg12345
12
+ export AC_MAILCHIMP_LIST_ID=zyxwvut09876
13
+
14
+ Note: you can also set these in astrochimp.yml but ENV variables will take precedence
15
+
16
+ 3. Specify your own configurations in astrochimp.yml (optional)
17
+
18
+ 4. Give the astrochimp.html.erb layout your own style (optional)
19
+
20
+ 5. Modify your routes.rb and mount the chimp somewhere besides '/' (optional)
21
+
22
+ ===============================================================================
@@ -0,0 +1,108 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= ENV['AC_NAME'] %> Beta Signup</title>
5
+ <%= stylesheet_link_tag "astrochimp/application" %>
6
+ <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css" rel="stylesheet">
7
+ <link href="//fonts.googleapis.com/css?family=Oxygen" rel="stylesheet" type="text/css" />
8
+ <%= csrf_meta_tags %>
9
+ </head>
10
+ <body>
11
+ <div class="container">
12
+
13
+ <!-- Header -->
14
+ <div class="row">
15
+ <div class="span7">
16
+ <div id="header" class="outside">
17
+ <h1><a href="/"><%= ENV['AC_NAME'] %></a></h1>
18
+ </div>
19
+ </div>
20
+ <div class="span5">
21
+ <div id="nav_header_user">
22
+ </div>
23
+ </div>
24
+ </div>
25
+
26
+ <!-- Content -->
27
+ <div class="row">
28
+ <div class="span4">
29
+ <div class="appframe iphone">
30
+ <%= image_tag('astrochimp/Astrochimp-phone-splash.png') %>
31
+ </div>
32
+ </div>
33
+ <div class="span8">
34
+ <div class="hero-unit">
35
+
36
+ <h1>Change The World in 5 Minutes.</h1>
37
+ <h2>Literally. The Entire World.</h2>
38
+ <p>Rock the world so hard it turns upside down. Like Australia.</p>
39
+
40
+ <hr />
41
+
42
+ <%= yield %>
43
+
44
+ </div>
45
+ </div>
46
+ </div>
47
+
48
+ <div class="row">
49
+ <div class="span4">
50
+ <div class="well">
51
+ <h2>Feature One</h2>
52
+ <p>
53
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce
54
+ bibendum leo sed enim mattis vitae ullamcorper felis pellentesque.
55
+ Sed porta eleifend diam sit amet tincidunt.
56
+ </p>
57
+ </div>
58
+ </div>
59
+ <div class="span4">
60
+ <div class="well">
61
+ <h2>Feature Two</h2>
62
+ <p>
63
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce
64
+ bibendum leo sed enim mattis vitae ullamcorper felis pellentesque.
65
+ Sed porta eleifend diam sit amet tincidunt.
66
+ </p>
67
+ </div>
68
+ </div>
69
+ <div class="span4">
70
+ <div class="well">
71
+ <h2>Feature Three</h2>
72
+ <p>
73
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce
74
+ bibendum leo sed enim mattis vitae ullamcorper felis pellentesque.
75
+ Sed porta eleifend diam sit amet tincidunt.
76
+ </p>
77
+ </div>
78
+ </div>
79
+ </div>
80
+
81
+ <!-- Footer -->
82
+ <div class="row">
83
+ <div class="span6 company">
84
+ <p><%= ENV['AC_NAME'] %> is a product of <a href="<%= ENV['AC_COMPANY_URL'] %>"><%= ENV['AC_COMPANY'] %></a></p>
85
+ </div>
86
+ <div class="span6 credits">
87
+ <p><a href="http://mailchimp.com">Powered by MailChimp</a></p>
88
+ </div>
89
+ </div>
90
+
91
+ </div>
92
+ <!-- JavaScripts -->
93
+ <% if !ENV['AC_GOOGLE_ANALYTICS_CODE'].blank? -%>
94
+ <script type="text/javascript">
95
+ var _gaq = _gaq || [];
96
+ _gaq.push(['_setAccount', '<%= ENV['AC_GOOGLE_ANALYTICS_CODE'] %>']);
97
+ _gaq.push(['_trackPageview']);
98
+
99
+ (function() {
100
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
101
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
102
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
103
+ })();
104
+ </script>
105
+ <% end %>
106
+ <%= javascript_include_tag "astrochimp/application" %>
107
+ </body>
108
+ </html>
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../..
3
3
  specs:
4
- astrochimp (0.0.1)
4
+ astrochimp (0.1.2)
5
5
  hominid (~> 3.0.5)
6
6
  jquery-rails
7
7
  rails (~> 3.2.8)
@@ -0,0 +1,108 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title><%= ENV['AC_NAME'] %> Beta Signup</title>
5
+ <%= stylesheet_link_tag "astrochimp/application" %>
6
+ <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css" rel="stylesheet">
7
+ <link href="//fonts.googleapis.com/css?family=Oxygen" rel="stylesheet" type="text/css" />
8
+ <%= csrf_meta_tags %>
9
+ </head>
10
+ <body>
11
+ <div class="container">
12
+
13
+ <!-- Header -->
14
+ <div class="row">
15
+ <div class="span7">
16
+ <div id="header" class="outside">
17
+ <h1><a href="/"><%= ENV['AC_NAME'] %></a></h1>
18
+ </div>
19
+ </div>
20
+ <div class="span5">
21
+ <div id="nav_header_user">
22
+ </div>
23
+ </div>
24
+ </div>
25
+
26
+ <!-- Content -->
27
+ <div class="row">
28
+ <div class="span4">
29
+ <div class="appframe iphone">
30
+ <%= image_tag('astrochimp/Astrochimp-phone-splash.png') %>
31
+ </div>
32
+ </div>
33
+ <div class="span8">
34
+ <div class="hero-unit">
35
+
36
+ <h1>Change The World in 5 Minutes.</h1>
37
+ <h2>Literally. The Entire World.</h2>
38
+ <p>Rock the world so hard it turns upside down. Like Australia.</p>
39
+
40
+ <hr />
41
+
42
+ <%= yield %>
43
+
44
+ </div>
45
+ </div>
46
+ </div>
47
+
48
+ <div class="row">
49
+ <div class="span4">
50
+ <div class="well">
51
+ <h2>Feature One</h2>
52
+ <p>
53
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce
54
+ bibendum leo sed enim mattis vitae ullamcorper felis pellentesque.
55
+ Sed porta eleifend diam sit amet tincidunt.
56
+ </p>
57
+ </div>
58
+ </div>
59
+ <div class="span4">
60
+ <div class="well">
61
+ <h2>Feature Two</h2>
62
+ <p>
63
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce
64
+ bibendum leo sed enim mattis vitae ullamcorper felis pellentesque.
65
+ Sed porta eleifend diam sit amet tincidunt.
66
+ </p>
67
+ </div>
68
+ </div>
69
+ <div class="span4">
70
+ <div class="well">
71
+ <h2>Feature Three</h2>
72
+ <p>
73
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce
74
+ bibendum leo sed enim mattis vitae ullamcorper felis pellentesque.
75
+ Sed porta eleifend diam sit amet tincidunt.
76
+ </p>
77
+ </div>
78
+ </div>
79
+ </div>
80
+
81
+ <!-- Footer -->
82
+ <div class="row">
83
+ <div class="span6 company">
84
+ <p><%= ENV['AC_NAME'] %> is a product of <a href="<%= ENV['AC_COMPANY_URL'] %>"><%= ENV['AC_COMPANY'] %></a></p>
85
+ </div>
86
+ <div class="span6 credits">
87
+ <p><a href="http://mailchimp.com">Powered by MailChimp</a></p>
88
+ </div>
89
+ </div>
90
+
91
+ </div>
92
+ <!-- JavaScripts -->
93
+ <% if !ENV['AC_GOOGLE_ANALYTICS_CODE'].blank? -%>
94
+ <script type="text/javascript">
95
+ var _gaq = _gaq || [];
96
+ _gaq.push(['_setAccount', '<%= ENV['AC_GOOGLE_ANALYTICS_CODE'] %>']);
97
+ _gaq.push(['_trackPageview']);
98
+
99
+ (function() {
100
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
101
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
102
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
103
+ })();
104
+ </script>
105
+ <% end %>
106
+ <%= javascript_include_tag "astrochimp/application" %>
107
+ </body>
108
+ </html>
@@ -1,15 +1,16 @@
1
1
  defaults: &defaults
2
- name : Awesome Startup
3
- company : Company, LLC
4
- company_url : http://mailchimp.com
5
- twitter_user : Brightbit
6
- facebook_url : http://www.facebook.com/brightbit
7
- google_analytics_code :
8
- mailchimp_list_id :
9
- mailchimp_api_key :
10
- email_format : html
2
+ name : "Awesome Startup"
3
+ company : "Company, LLC"
4
+ company_url : "http://mailchimp.com"
5
+ twitter_user : "Brightbit"
6
+ facebook_url : "http://www.facebook.com/brightbit"
7
+ google_analytics_code : ""
8
+ mailchimp_list_id : ""
9
+ mailchimp_api_key : ""
10
+ email_format : "html"
11
11
  email_double_optin : false # true will require user to confirm their email address
12
- signup_success_notice : Thanks! We'll drop you a line when we launch!
12
+ signup_success_notice : "Thanks! We'll drop you a line when we launch!"
13
+ splash_layout : "astrochimp"
13
14
 
14
15
  development:
15
16
  <<: *defaults
@@ -1,4 +1,6 @@
1
1
  Rails.application.routes.draw do
2
2
 
3
+
3
4
  mount Astrochimp::Engine => "/"
5
+
4
6
  end
@@ -0,0 +1,11 @@
1
+ require 'zeus/rails'
2
+
3
+ class CustomPlan < Zeus::Rails
4
+
5
+ # def my_custom_command
6
+ # # see https://github.com/burke/zeus/blob/master/docs/ruby/modifying.md
7
+ # end
8
+
9
+ end
10
+
11
+ Zeus.plan = CustomPlan.new
@@ -0,0 +1,27 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20121207034527) do
15
+
16
+ create_table "astrochimp_signups", :force => true do |t|
17
+ t.string "email"
18
+ t.integer "status"
19
+ t.datetime "created_at", :null => false
20
+ t.datetime "updated_at", :null => false
21
+ t.integer "referrer_id"
22
+ t.integer "signups_count", :default => 0
23
+ end
24
+
25
+ add_index "astrochimp_signups", ["referrer_id"], :name => "index_astrochimp_signups_on_referrer_id"
26
+
27
+ end