saucy 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. data/.gitignore +2 -0
  2. data/CHANGELOG.md +3 -7
  3. data/Gemfile +1 -10
  4. data/Gemfile.lock +42 -3
  5. data/README.md +5 -0
  6. data/Rakefile +12 -3
  7. data/app/controllers/accounts_controller.rb +2 -1
  8. data/app/mailers/billing_mailer.rb +8 -0
  9. data/app/models/canceled_account.rb +12 -7
  10. data/app/views/accounts/_projects.html.erb +1 -1
  11. data/app/views/billing_mailer/cancelation_notification.text.erb +3 -0
  12. data/app/views/invitation_mailer/invitation.text.erb +1 -1
  13. data/app/views/invitations/show.html.erb +1 -1
  14. data/app/views/memberships/edit.html.erb +2 -2
  15. data/app/views/memberships/index.html.erb +1 -1
  16. data/app/views/projects/_form.html.erb +5 -5
  17. data/app/views/projects/edit.html.erb +2 -2
  18. data/app/views/projects/index.html.erb +3 -3
  19. data/app/views/projects/new.html.erb +1 -1
  20. data/app/views/shared/_project_dropdown.html.erb +3 -3
  21. data/config/routes.rb +2 -6
  22. data/cucumber.yml +1 -0
  23. data/{lib/generators/saucy/features/templates/features → features/engine}/admin_reporting.feature +0 -0
  24. data/{lib/generators/saucy/features/templates/features → features/engine}/edit_profile.feature +0 -0
  25. data/{lib/generators/saucy/features/templates/features → features/engine}/edit_project_permissions.feature +0 -0
  26. data/{lib/generators/saucy/features/templates/features → features/engine}/edit_user_permissions.feature +0 -0
  27. data/{lib/generators/saucy/features/templates/features → features/engine}/manage_account.feature +0 -0
  28. data/{lib/generators/saucy/features/templates/features → features/engine}/manage_billing.feature +1 -1
  29. data/{lib/generators/saucy/features/templates/features → features/engine}/manage_plan.feature +0 -0
  30. data/{lib/generators/saucy/features/templates/features → features/engine}/manage_projects.feature +0 -0
  31. data/{lib/generators/saucy/features/templates/features → features/engine}/manage_users.feature +0 -0
  32. data/{lib/generators/saucy/features/templates/features → features/engine}/new_account.feature +0 -0
  33. data/{lib/generators/saucy/features/templates/features → features/engine}/project_dropdown.feature +0 -0
  34. data/{lib/generators/saucy/features/templates/features → features/engine}/sign_up.feature +0 -0
  35. data/{lib/generators/saucy/features/templates/features → features/engine}/sign_up_coupon.feature +0 -0
  36. data/{lib/generators/saucy/features/templates/features → features/engine}/sign_up_paid.feature +0 -0
  37. data/{lib/generators/saucy/features/templates/features → features/engine}/trial_plans.feature +0 -0
  38. data/features/integration/run_features.feature +46 -0
  39. data/features/step_definitions/clearance_steps.rb +123 -0
  40. data/{lib/generators/saucy/features/templates/step_definitions → features/step_definitions/engine}/account_steps.rb +0 -0
  41. data/features/step_definitions/engine/braintree_steps.rb +24 -0
  42. data/{lib/generators/saucy/features/templates/step_definitions → features/step_definitions/engine}/country_steps.rb +0 -0
  43. data/{lib/generators/saucy/features/templates/step_definitions → features/step_definitions/engine}/cron_steps.rb +3 -5
  44. data/{lib/generators/saucy/features/templates/step_definitions → features/step_definitions/engine}/email_steps.rb +0 -0
  45. data/{lib/generators/saucy/features/templates/step_definitions → features/step_definitions/engine}/factory_girl_steps.rb +0 -0
  46. data/{lib/generators/saucy/features/templates/step_definitions → features/step_definitions/engine}/html_steps.rb +0 -0
  47. data/{lib/generators/saucy/features/templates/step_definitions → features/step_definitions/engine}/plan_steps.rb +0 -0
  48. data/{lib/generators/saucy/features/templates/step_definitions → features/step_definitions/engine}/project_steps.rb +0 -0
  49. data/{lib/generators/saucy/features/templates/step_definitions → features/step_definitions/engine}/session_steps.rb +0 -0
  50. data/{lib/generators/saucy/features/templates/step_definitions → features/step_definitions/engine}/user_steps.rb +0 -0
  51. data/features/step_definitions/rails_steps.rb +26 -8
  52. data/features/step_definitions/saucy_steps.rb +5 -0
  53. data/features/step_definitions/web_steps.rb +253 -0
  54. data/features/support/engine/braintree.rb +5 -0
  55. data/features/support/env.rb +18 -0
  56. data/features/support/factory_girl.rb +2 -0
  57. data/features/support/paths.rb +68 -0
  58. data/features/support/rails.rb +4 -0
  59. data/features/support/selectors.rb +11 -0
  60. data/lib/generators/saucy/features/features_generator.rb +7 -3
  61. data/lib/saucy/account.rb +55 -57
  62. data/lib/saucy/account_authorization.rb +39 -42
  63. data/lib/saucy/plan.rb +14 -16
  64. data/lib/saucy/project.rb +42 -44
  65. data/lib/saucy/projects_controller.rb +53 -55
  66. data/lib/saucy/subscription.rb +189 -191
  67. data/lib/saucy/user.rb +5 -7
  68. data/lib/saucy/version.rb +1 -1
  69. data/saucy.gemspec +21 -5
  70. data/spec/controllers/accounts_controller_spec.rb +2 -1
  71. data/spec/controllers/projects_controller_spec.rb +1 -1
  72. data/spec/dummy/Rakefile +7 -0
  73. data/spec/dummy/app/assets/javascripts/application.js +9 -0
  74. data/spec/dummy/app/assets/stylesheets/application.css +7 -0
  75. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  76. data/spec/dummy/app/controllers/homes_controller.rb +2 -0
  77. data/spec/dummy/app/controllers/projects_controller.rb +3 -0
  78. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  79. data/spec/dummy/app/mailers/.gitkeep +0 -0
  80. data/spec/dummy/app/models/.gitkeep +0 -0
  81. data/spec/dummy/app/models/account.rb +3 -0
  82. data/spec/dummy/app/models/plan.rb +3 -0
  83. data/spec/dummy/app/models/project.rb +3 -0
  84. data/spec/dummy/app/models/user.rb +4 -0
  85. data/spec/dummy/app/views/homes/show.html.erb +1 -0
  86. data/spec/dummy/app/views/layouts/application.html.erb +24 -0
  87. data/spec/dummy/config.ru +4 -0
  88. data/spec/dummy/config/application.rb +48 -0
  89. data/spec/dummy/config/boot.rb +10 -0
  90. data/spec/dummy/config/database.yml +25 -0
  91. data/spec/dummy/config/environment.rb +5 -0
  92. data/spec/dummy/config/environments/development.rb +30 -0
  93. data/spec/dummy/config/environments/production.rb +60 -0
  94. data/spec/dummy/config/environments/test.rb +42 -0
  95. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  96. data/spec/dummy/config/initializers/clearance.rb +3 -0
  97. data/spec/dummy/config/initializers/inflections.rb +10 -0
  98. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  99. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  100. data/spec/dummy/config/initializers/session_store.rb +8 -0
  101. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  102. data/spec/dummy/config/locales/en.yml +5 -0
  103. data/spec/dummy/config/routes.rb +59 -0
  104. data/spec/dummy/db/migrate/20120201000751_create_diesel_clearance_users.rb +19 -0
  105. data/spec/dummy/db/migrate/20120201001546_create_saucy_tables.rb +122 -0
  106. data/spec/dummy/db/migrate/20120201001548_create_canceled_accounts.rb +14 -0
  107. data/spec/dummy/lib/assets/.gitkeep +0 -0
  108. data/spec/dummy/log/.gitkeep +0 -0
  109. data/spec/dummy/public/404.html +26 -0
  110. data/spec/dummy/public/422.html +26 -0
  111. data/spec/dummy/public/500.html +26 -0
  112. data/spec/dummy/public/favicon.ico +0 -0
  113. data/spec/dummy/script/rails +6 -0
  114. data/spec/mailers/billing_mailer_spec.rb +12 -2
  115. data/spec/models/canceled_account_spec.rb +8 -6
  116. data/spec/models/subscription_spec.rb +47 -53
  117. data/spec/spec_helper.rb +8 -11
  118. data/spec/support/braintree.rb +2 -4
  119. data/spec/support/factories.rb +1 -0
  120. metadata +447 -125
  121. data/db/migrate/20120206155222_add_subscription_token_to_canceled_accounts.rb +0 -5
  122. data/features/run_features.feature +0 -84
  123. data/lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb +0 -25
  124. data/lib/generators/saucy/features/templates/support/braintree.rb +0 -5
  125. data/lib/generators/saucy/specs/specs_generator.rb +0 -20
  126. data/lib/generators/saucy/specs/templates/support/braintree.rb +0 -5
  127. data/lib/saucy/fake_braintree.rb +0 -134
  128. data/lib/saucy/routing_extensions.rb +0 -116
  129. data/spec/dummy/db/migrate/20120206155222_add_subscription_token_to_canceled_accounts.rb +0 -5
  130. data/spec/environment.rb +0 -98
  131. data/spec/route_extensions_spec.rb +0 -51
  132. data/spec/scaffold/config/database.yml +0 -6
  133. data/spec/scaffold/config/routes.rb +0 -5
  134. data/spec/scaffold/views/layouts/application.html.erb +0 -1
data/.gitignore CHANGED
@@ -6,3 +6,5 @@ tmp
6
6
  pkg
7
7
  *.gem
8
8
  tags
9
+ *.log
10
+ *.sqlite3
@@ -1,11 +1,7 @@
1
- 0.15.2
1
+ 0.16.0
2
2
 
3
- * Re-released 0.15.1 to fix "Illformed requirement ["#<Syck::DefaultKey:0x000001046de4d0> 1.3.3"]" errors
4
- * No code changes
5
-
6
- 0.15.1
7
-
8
- * CanceledAccount now stores the subscription_token of the account it was canceled from.
3
+ * Removed routing extensions. To upgrade, replace all `through` entries in routes.rb with `resources`.
4
+ * Email the support email address whenever an account is canceled
9
5
 
10
6
  0.15.0
11
7
 
data/Gemfile CHANGED
@@ -2,13 +2,4 @@ source "http://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- # used by the rails app in cucumber
6
- gem "cucumber-rails", '~> 1.0.6', :require => false
7
- gem "capybara", :require => false
8
- gem "factory_girl_rails", :require => false
9
- gem "formtastic", '~> 1.2.4', :require => false
10
- gem "database_cleaner", :require => false
11
- gem "dynamic_form", :require => false
12
- gem "launchy", :require => false
13
- gem "jquery-rails", :require => false
14
- gem "selenium-webdriver", "~> 2.16.0"
5
+ gem "minitest", "~> 2.6.1", :platforms => :ruby_19
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- saucy (0.15.2)
4
+ saucy (0.16.0)
5
5
  airbrake (~> 3.0.4)
6
6
  braintree (>= 2.6.2)
7
7
  clearance (~> 0.14.0)
@@ -45,6 +45,7 @@ GEM
45
45
  airbrake (3.0.9)
46
46
  activesupport
47
47
  builder
48
+ ansi (1.4.2)
48
49
  arel (2.2.1)
49
50
  aruba (0.4.6)
50
51
  bcat (>= 0.6.1)
@@ -71,6 +72,13 @@ GEM
71
72
  clearance (0.14.0)
72
73
  diesel (~> 0.1.5)
73
74
  rails (>= 3.0)
75
+ coffee-rails (3.1.1)
76
+ coffee-script (>= 2.2.0)
77
+ railties (~> 3.1.0)
78
+ coffee-script (2.2.0)
79
+ coffee-script-source
80
+ execjs
81
+ coffee-script-source (1.2.0)
74
82
  cucumber (1.0.6)
75
83
  builder (>= 2.1.2)
76
84
  diff-lcs (>= 1.1.2)
@@ -81,7 +89,7 @@ GEM
81
89
  capybara (>= 1.1.1)
82
90
  cucumber (>= 1.0.6)
83
91
  nokogiri (>= 1.5.0)
84
- daemons (1.1.4)
92
+ daemons (1.0.10)
85
93
  database_cleaner (0.6.7)
86
94
  diesel (0.1.5)
87
95
  railties
@@ -89,15 +97,25 @@ GEM
89
97
  dynamic_form (1.1.4)
90
98
  erubis (2.7.0)
91
99
  eventmachine (0.12.10)
100
+ execjs (1.3.0)
101
+ multi_json (~> 1.0)
92
102
  factory_girl (2.1.0)
93
103
  factory_girl_rails (1.2.0)
94
104
  factory_girl (~> 2.1.0)
95
105
  railties (>= 3.0.0)
106
+ fake_braintree (0.2.0)
107
+ activesupport
108
+ braintree (~> 2.5)
109
+ capybara
110
+ i18n
111
+ mongrel (~> 1.2.0.pre)
112
+ sinatra
96
113
  ffi (1.0.11)
97
114
  formtastic (1.2.4)
98
115
  actionpack (>= 2.3.7)
99
116
  activesupport (>= 2.3.7)
100
117
  i18n (~> 0.4)
118
+ gem_plugin (0.2.3)
101
119
  gherkin (2.4.21)
102
120
  json (>= 1.4.6)
103
121
  hike (1.2.1)
@@ -113,8 +131,12 @@ GEM
113
131
  mime-types (~> 1.16)
114
132
  treetop (~> 1.4.8)
115
133
  mime-types (1.17.2)
134
+ minitest (2.6.2)
116
135
  mocha (0.9.8)
117
136
  rake
137
+ mongrel (1.2.0.pre2)
138
+ daemons (~> 1.0.10)
139
+ gem_plugin (~> 0.2.3)
118
140
  multi_json (1.0.4)
119
141
  nokogiri (1.5.0)
120
142
  polyglot (0.3.3)
@@ -162,6 +184,12 @@ GEM
162
184
  railties (~> 3.0)
163
185
  rspec (~> 2.6.0)
164
186
  rubyzip (0.9.5)
187
+ sass (3.1.12)
188
+ sass-rails (3.1.5)
189
+ actionpack (~> 3.1.0)
190
+ railties (~> 3.1.0)
191
+ sass (~> 3.1.10)
192
+ tilt (~> 1.3.2)
165
193
  selenium-webdriver (2.16.0)
166
194
  childprocess (>= 0.2.5)
167
195
  ffi (~> 1.0.9)
@@ -180,7 +208,7 @@ GEM
180
208
  tilt (~> 1.1, != 1.3.0)
181
209
  sqlite3 (1.3.4)
182
210
  term-ansicolor (1.0.7)
183
- thin (1.2.11)
211
+ thin (1.3.1)
184
212
  daemons (>= 1.0.9)
185
213
  eventmachine (>= 0.12.6)
186
214
  rack (>= 1.0.0)
@@ -190,7 +218,12 @@ GEM
190
218
  treetop (1.4.10)
191
219
  polyglot
192
220
  polyglot (>= 0.3.1)
221
+ turn (0.8.2)
222
+ ansi (>= 1.2.2)
193
223
  tzinfo (0.3.31)
224
+ uglifier (1.2.3)
225
+ execjs (>= 0.3.0)
226
+ multi_json (>= 1.0.2)
194
227
  xpath (0.1.4)
195
228
  nokogiri (~> 1.3)
196
229
 
@@ -201,21 +234,27 @@ DEPENDENCIES
201
234
  aruba (~> 0.4)
202
235
  bourne
203
236
  capybara
237
+ coffee-rails (~> 3.1.1)
204
238
  cucumber (~> 1.0.6)
205
239
  cucumber-rails (~> 1.0.6)
206
240
  database_cleaner
207
241
  dynamic_form
208
242
  factory_girl
209
243
  factory_girl_rails
244
+ fake_braintree (~> 0.2.0)
210
245
  formtastic (~> 1.2.4)
211
246
  jquery-rails
212
247
  launchy
248
+ minitest (~> 2.6.1)
213
249
  rails (>= 3.0.3)
214
250
  rake
215
251
  rspec-rails
252
+ sass-rails (~> 3.1.5)
216
253
  saucy!
217
254
  selenium-webdriver (~> 2.16.0)
218
255
  shoulda-matchers (~> 1.0.0)
219
256
  sqlite3
220
257
  thin
221
258
  timecop
259
+ turn (= 0.8.2)
260
+ uglifier (>= 1.0.3)
data/README.md CHANGED
@@ -133,6 +133,11 @@ You can also customize the default trial length of 30 days, and the timing of ex
133
133
  * Saucy::Configuration.unactivated_notice_on - An integer. The day of the trial in which the unactivated notice should be sent.
134
134
  * Saucy::Configuration.expiring_notice_on - An integer. The number of days remaining that the expiration warning notice should be sent on.
135
135
 
136
+ ## Development
137
+
138
+ Development for the 0.15.x series should happen in the `0.15.x-development`
139
+ branch. The master branch should be used for 0.16 development.b
140
+
136
141
  ## Gotchas
137
142
 
138
143
  Make sure you don't do this in ApplicationController:
data/Rakefile CHANGED
@@ -8,11 +8,20 @@ require 'rspec/core/rake_task'
8
8
  desc 'Default: run all tests'
9
9
  task :default => [:spec, :cucumber]
10
10
 
11
- Cucumber::Rake::Task.new(:cucumber) do |t|
12
- t.fork = true
13
- t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')]
11
+ namespace :cucumber do
12
+ Cucumber::Rake::Task.new(:engine) do |t|
13
+ t.fork = true
14
+ t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress'), 'features/engine/*.feature']
15
+ end
16
+
17
+ Cucumber::Rake::Task.new(:integration) do |t|
18
+ t.fork = true
19
+ t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress'), 'features/integration/*.feature']
20
+ end
14
21
  end
15
22
 
23
+ task :cucumber => ["cucumber:engine", "cucumber:integration"]
24
+
16
25
  RSpec::Core::RakeTask.new do |t|
17
26
  t.pattern = "spec/**/*_spec.rb"
18
27
  t.rspec_opts = "--format progress"
@@ -34,7 +34,8 @@ class AccountsController < ApplicationController
34
34
  def index
35
35
  if current_user.projects.size == 1
36
36
  flash.keep
37
- redirect_to project_path(current_user.projects.first)
37
+ project = current_user.projects.first
38
+ redirect_to account_project_path(project.account, project)
38
39
  else
39
40
  @accounts = current_user.accounts
40
41
  end
@@ -50,4 +50,12 @@ class BillingMailer < ActionMailer::Base
50
50
  :reply_to => Saucy::Configuration.support_email_address,
51
51
  :from => Saucy::Configuration.manager_email_address)
52
52
  end
53
+
54
+ def cancelation_notification(canceled_account)
55
+ @canceled_account = canceled_account
56
+ mail(:to => Saucy::Configuration.support_email_address,
57
+ :subject => "#{t("app_name")} Account Canceled",
58
+ :reply_to => Saucy::Configuration.support_email_address,
59
+ :from => Saucy::Configuration.support_email_address)
60
+ end
53
61
  end
@@ -5,15 +5,20 @@ class CanceledAccount < ActiveRecord::Base
5
5
 
6
6
  before_validation :populate_from_account, :on => :create, :if => :account
7
7
 
8
+ after_create :send_notification
9
+
8
10
  private
9
11
 
10
12
  def populate_from_account
11
- self.name = account.name
12
- self.keyword = account.keyword
13
- self.billing_email = account.customer.email
14
- self.memberships = account.memberships.to_json(:include => { :user => { :only => [:email, :name, :created_at]}}, :only => [:admin, :created_at])
15
- self.plan = account.plan
16
- self.started_at = account.created_at
17
- self.subscription_token = account.subscription_token
13
+ self.name = account.name
14
+ self.keyword = account.keyword
15
+ self.billing_email = account.customer.email
16
+ self.memberships = account.memberships.to_json(:include => { :user => { :only => [:email, :name, :created_at]}}, :only => [:admin, :created_at])
17
+ self.plan = account.plan
18
+ self.started_at = account.created_at
19
+ end
20
+
21
+ def send_notification
22
+ BillingMailer.cancelation_notification(self).deliver if account
18
23
  end
19
24
  end
@@ -4,7 +4,7 @@
4
4
  <ul class="projects">
5
5
  <% projects.each do |project| -%>
6
6
  <%= content_tag_for :li, project do -%>
7
- <%= link_to h(project.name), project_path(project) %>
7
+ <%= link_to h(project.name), account_project_path(account, project) %>
8
8
  <% end -%>
9
9
  <% end -%>
10
10
  </ul>
@@ -0,0 +1,3 @@
1
+ The <%= @canceled_account.name %> (<%= @canceled_account.plan.name %>) account was just canceled.
2
+
3
+ Billing emai: <%= @canceled_account.billing_email %>
@@ -2,5 +2,5 @@ You have been invited to join the <%= @invitation.account_name %> account.
2
2
 
3
3
  Go to the following URL to accept this invitation:
4
4
 
5
- <%= invitation_url(@invitation) %>
5
+ <%= account_invitation_url(@invitation.account, @invitation) %>
6
6
 
@@ -2,7 +2,7 @@
2
2
  <h2>Accept invitation to <%= @invitation.account_name %></h2>
3
3
  <% end -%>
4
4
 
5
- <%= semantic_form_for @invitation do |form| %>
5
+ <%= semantic_form_for [current_account, @invitation] do |form| %>
6
6
  <h5 class="legend">I am a new user</h5>
7
7
  <%= form.inputs :class => 'new_user' do -%>
8
8
  <%= form.input :new_user_email, :label => 'Email' %>
@@ -3,14 +3,14 @@
3
3
  <% end -%>
4
4
 
5
5
  <div class="actions">
6
- <%= link_to @membership, :method => :delete, :confirm => "Are you sure?" do %>
6
+ <%= link_to [current_account, @membership], :method => :delete, :confirm => "Are you sure?" do %>
7
7
  <span class="delete_item">Remove <%= @membership.user.name %> from <%= current_account.name %></span>
8
8
  <% end -%>
9
9
  </div>
10
10
 
11
11
  <%= render :partial => 'accounts/subnav' %>
12
12
 
13
- <%= semantic_form_for @membership do |form| -%>
13
+ <%= semantic_form_for [current_account, @membership] do |form| -%>
14
14
  <%= form.inputs do -%>
15
15
  <%= form.input :admin, :label => "#{@membership.user.name} is an Admin on #{current_account.name}" %>
16
16
  <%= form.input :projects, :as => :check_boxes, :collection => @projects, :label => "#{@membership.user.name} belongs to these projects:" %>
@@ -7,7 +7,7 @@
7
7
  <ul class="users">
8
8
  <% @memberships.each do |membership| -%>
9
9
  <%= content_tag_for :li, membership.user do -%>
10
- <%= link_to [:edit, membership] do %>
10
+ <%= link_to [:edit, current_account, membership] do %>
11
11
  <%= membership.name %> <span>(<%= membership.email %>)</span>
12
12
  <% end -%>
13
13
  <% end -%>
@@ -4,18 +4,18 @@
4
4
  <% else %>
5
5
  <%= form.input :account, :as => :hidden, :value => current_account.id %>
6
6
  <% end -%>
7
- <%= form.input :name, :hint => project_url(form.object).html_safe %>
7
+ <%= form.input :name, :hint => account_project_url(account, project).html_safe %>
8
8
  <%= form.input :keyword, :wrapper_html => { :style => 'display: none' } %>
9
- <% if form.object.persisted? -%>
9
+ <% if project.persisted? -%>
10
10
  <%= form.input :archived, :hint => t('project.archived.hint', :default => "Archived project don't count against your project total. You cannot create or edit content.") %>
11
11
  <% end -%>
12
12
  <%= form.input :users, :label => "Admins",
13
13
  :as => :check_boxes,
14
- :collection => form.object.account.admins,
14
+ :collection => project.account.admins,
15
15
  :wrapper_html => { :id => "project_admins_input" },
16
16
  :input_html => { :disabled => true } %>
17
- <% if form.object.account.non_admins.any? -%>
18
- <%= form.input :users, :as => :check_boxes, :collection => form.object.account.non_admins %>
17
+ <% if account.non_admins.any? -%>
18
+ <%= form.input :users, :as => :check_boxes, :collection => account.non_admins %>
19
19
  <% end -%>
20
20
  <% end %>
21
21
 
@@ -3,7 +3,7 @@
3
3
  <% end -%>
4
4
 
5
5
  <div class="actions">
6
- <%= link_to project_path(@project), :method => 'delete', :confirm => 'Are you sure you want to delete this project and all associated content?', :class => 'action' do %>
6
+ <%= link_to account_project_path(current_account, @project), :method => 'delete', :confirm => 'Are you sure you want to delete this project and all associated content?', :class => 'action' do %>
7
7
  <span class="delete_item">Remove this project</span>
8
8
  <% end -%>
9
9
  </div>
@@ -12,7 +12,7 @@
12
12
  <%= render :partial => 'accounts/subnav' %>
13
13
 
14
14
  <%= semantic_form_for @project, :url => account_project_url(current_account, @project) do |form| %>
15
- <%= render 'form', :form => form %>
15
+ <%= render 'form', :form => form, :project => @project, :account => current_account %>
16
16
 
17
17
  <%= form.buttons do %>
18
18
  <%= form.commit_button %>
@@ -8,7 +8,7 @@
8
8
  <ul class="projects active">
9
9
  <% @active_projects.each do |project| -%>
10
10
  <%= content_tag_for :li, project do -%>
11
- <%= link_to h(project.name), edit_project_path(project), :class => "edit" %>
11
+ <%= link_to h(project.name), edit_account_project_path(current_account, project), :class => "edit" %>
12
12
  <% end -%>
13
13
  <% end -%>
14
14
  </ul>
@@ -20,8 +20,8 @@
20
20
  <ul class="projects archived">
21
21
  <% @archived_projects.each do |project| -%>
22
22
  <%= content_tag_for :li, project do -%>
23
- <%= link_to h(project.name), edit_project_path(project), :class => "edit" %>
24
- <%= link_to "View Project", project_path(project), :class => "view" %>
23
+ <%= link_to h(project.name), edit_account_project_path(current_account, project), :class => "edit" %>
24
+ <%= link_to "View Project", account_project_path(current_account, project), :class => "view" %>
25
25
  <% end -%>
26
26
  <% end -%>
27
27
  </ul>
@@ -5,7 +5,7 @@
5
5
  <%= render :partial => 'accounts/subnav' %>
6
6
 
7
7
  <%= semantic_form_for(@project, :url => account_projects_url(current_account)) do |form| %>
8
- <%= render 'form', :form => form %>
8
+ <%= render 'form', :form => form, :project => @project, :account => current_account %>
9
9
  <%= form.buttons do -%>
10
10
  <%= form.commit_button %>
11
11
  <li><%= link_to 'Cancel', account_projects_path(current_account) %></li>
@@ -2,7 +2,7 @@
2
2
  <ul id="project-selection">
3
3
  <li>
4
4
  <h1>
5
- <%= link_to current_project? ? project_path(current_project) : root_url do -%>
5
+ <%= link_to current_project? ? account_project_path(current_account, current_project) : root_url do -%>
6
6
  <% if current_project? -%>
7
7
  <span><%= current_project.name %></span>
8
8
  <% else %>
@@ -15,11 +15,11 @@
15
15
  </h1>
16
16
  <ul>
17
17
  <% current_user.projects.active.each do |project| %>
18
- <li><%= link_to project.name, project_path(project) -%></li>
18
+ <li><%= link_to project.name, account_project_path(project.account, project) -%></li>
19
19
  <% end %>
20
20
  <% if current_user.memberships.admin.any? -%>
21
21
  <li>
22
- <%= link_to current_account? && current_user.admin_of?(current_account) ? new_project_path(current_account) : new_project_path(current_user.memberships.admin.first.account) do %>
22
+ <%= link_to current_account? && current_user.admin_of?(current_account) ? new_account_project_path(current_account) : new_account_project_path(current_user.memberships.admin.first.account) do %>
23
23
  &#43; Create a new project
24
24
  <% end %>
25
25
  </li>
@@ -1,9 +1,5 @@
1
- require 'saucy/routing_extensions'
2
-
3
1
  Rails.application.routes.draw do
4
- resources :accounts, :only => [:index, :edit, :update, :destroy]
5
-
6
- through :accounts do
2
+ resources :accounts, :only => [:index, :edit, :update, :destroy] do
7
3
  resource :billing
8
4
  resource :plan
9
5
  resources :projects
@@ -16,7 +12,7 @@ Rails.application.routes.draw do
16
12
  end
17
13
 
18
14
  resource :profile, :only => [:edit, :update]
19
-
15
+
20
16
  namespace :admin do
21
17
  resources :accounts, :only => [:index, :show] do
22
18
  get :search, :on => :collection
@@ -0,0 +1 @@
1
+ default: --strict features -r features