saasy 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +114 -0
- data/Gemfile +26 -0
- data/README.md +118 -0
- data/Rakefile +38 -0
- data/app/controllers/accounts_controller.rb +68 -0
- data/app/controllers/billings_controller.rb +25 -0
- data/app/controllers/invitations_controller.rb +65 -0
- data/app/controllers/memberships_controller.rb +45 -0
- data/app/controllers/plans_controller.rb +24 -0
- data/app/controllers/profiles_controller.rb +19 -0
- data/app/helpers/limits_helper.rb +13 -0
- data/app/mailers/billing_mailer.rb +53 -0
- data/app/mailers/invitation_mailer.rb +18 -0
- data/app/models/invitation.rb +113 -0
- data/app/models/limit.rb +49 -0
- data/app/models/membership.rb +26 -0
- data/app/models/permission.rb +19 -0
- data/app/models/signup.rb +163 -0
- data/app/views/accounts/_account.html.erb +9 -0
- data/app/views/accounts/_blank_slate.html.erb +6 -0
- data/app/views/accounts/_projects.html.erb +12 -0
- data/app/views/accounts/_subnav.html.erb +10 -0
- data/app/views/accounts/edit.html.erb +34 -0
- data/app/views/accounts/index.html.erb +9 -0
- data/app/views/accounts/new.html.erb +36 -0
- data/app/views/billing_mailer/completed_trial.text.erb +13 -0
- data/app/views/billing_mailer/expiring_trial.text.erb +15 -0
- data/app/views/billing_mailer/new_unactivated.text.erb +1 -0
- data/app/views/billing_mailer/problem.html.erb +13 -0
- data/app/views/billing_mailer/problem.text.erb +14 -0
- data/app/views/billing_mailer/receipt.html.erb +41 -0
- data/app/views/billing_mailer/receipt.text.erb +25 -0
- data/app/views/billings/_form.html.erb +8 -0
- data/app/views/billings/edit.html.erb +13 -0
- data/app/views/billings/show.html.erb +29 -0
- data/app/views/invitation_mailer/invitation.text.erb +6 -0
- data/app/views/invitations/new.html.erb +17 -0
- data/app/views/invitations/show.html.erb +22 -0
- data/app/views/layouts/saucy.html.erb +36 -0
- data/app/views/limits/_meter.html.erb +13 -0
- data/app/views/memberships/edit.html.erb +21 -0
- data/app/views/memberships/index.html.erb +17 -0
- data/app/views/plans/_plan.html.erb +32 -0
- data/app/views/plans/_terms.html.erb +15 -0
- data/app/views/plans/edit.html.erb +33 -0
- data/app/views/plans/index.html.erb +12 -0
- data/app/views/profiles/_inputs.html.erb +5 -0
- data/app/views/profiles/edit.html.erb +36 -0
- data/app/views/projects/_form.html.erb +36 -0
- data/app/views/projects/edit.html.erb +22 -0
- data/app/views/projects/index.html.erb +28 -0
- data/app/views/projects/new.html.erb +13 -0
- data/app/views/projects/show.html.erb +0 -0
- data/app/views/shared/_project_dropdown.html.erb +55 -0
- data/app/views/shared/_saucy_javascript.html.erb +33 -0
- data/config/locales/en.yml +37 -0
- data/config/routes.rb +19 -0
- data/features/run_features.feature +83 -0
- data/features/step_definitions/clearance_steps.rb +45 -0
- data/features/step_definitions/rails_steps.rb +73 -0
- data/features/step_definitions/saucy_steps.rb +8 -0
- data/features/support/env.rb +4 -0
- data/features/support/file.rb +11 -0
- data/lib/generators/saucy/base.rb +18 -0
- data/lib/generators/saucy/features/features_generator.rb +91 -0
- data/lib/generators/saucy/features/templates/README +3 -0
- data/lib/generators/saucy/features/templates/factories.rb +71 -0
- data/lib/generators/saucy/features/templates/features/edit_profile.feature +9 -0
- data/lib/generators/saucy/features/templates/features/edit_project_permissions.feature +37 -0
- data/lib/generators/saucy/features/templates/features/edit_user_permissions.feature +47 -0
- data/lib/generators/saucy/features/templates/features/manage_account.feature +35 -0
- data/lib/generators/saucy/features/templates/features/manage_billing.feature +93 -0
- data/lib/generators/saucy/features/templates/features/manage_plan.feature +143 -0
- data/lib/generators/saucy/features/templates/features/manage_projects.feature +139 -0
- data/lib/generators/saucy/features/templates/features/manage_users.feature +142 -0
- data/lib/generators/saucy/features/templates/features/new_account.feature +33 -0
- data/lib/generators/saucy/features/templates/features/project_dropdown.feature +77 -0
- data/lib/generators/saucy/features/templates/features/sign_up.feature +32 -0
- data/lib/generators/saucy/features/templates/features/sign_up_paid.feature +65 -0
- data/lib/generators/saucy/features/templates/features/trial_plans.feature +82 -0
- data/lib/generators/saucy/features/templates/step_definitions/account_steps.rb +30 -0
- data/lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb +25 -0
- data/lib/generators/saucy/features/templates/step_definitions/cron_steps.rb +23 -0
- data/lib/generators/saucy/features/templates/step_definitions/email_steps.rb +40 -0
- data/lib/generators/saucy/features/templates/step_definitions/factory_girl_steps.rb +1 -0
- data/lib/generators/saucy/features/templates/step_definitions/html_steps.rb +51 -0
- data/lib/generators/saucy/features/templates/step_definitions/plan_steps.rb +16 -0
- data/lib/generators/saucy/features/templates/step_definitions/project_steps.rb +4 -0
- data/lib/generators/saucy/features/templates/step_definitions/session_steps.rb +37 -0
- data/lib/generators/saucy/features/templates/step_definitions/user_steps.rb +100 -0
- data/lib/generators/saucy/features/templates/support/braintree.rb +5 -0
- data/lib/generators/saucy/install/install_generator.rb +40 -0
- data/lib/generators/saucy/install/templates/controllers/projects_controller.rb +3 -0
- data/lib/generators/saucy/install/templates/create_saucy_tables.rb +115 -0
- data/lib/generators/saucy/install/templates/models/account.rb +3 -0
- data/lib/generators/saucy/install/templates/models/plan.rb +3 -0
- data/lib/generators/saucy/install/templates/models/project.rb +3 -0
- data/lib/generators/saucy/specs/specs_generator.rb +20 -0
- data/lib/generators/saucy/specs/templates/support/braintree.rb +5 -0
- data/lib/generators/saucy/views/views_generator.rb +23 -0
- data/lib/saucy.rb +10 -0
- data/lib/saucy/account.rb +132 -0
- data/lib/saucy/account_authorization.rb +67 -0
- data/lib/saucy/configuration.rb +29 -0
- data/lib/saucy/engine.rb +35 -0
- data/lib/saucy/fake_braintree.rb +134 -0
- data/lib/saucy/layouts.rb +36 -0
- data/lib/saucy/plan.rb +54 -0
- data/lib/saucy/project.rb +125 -0
- data/lib/saucy/projects_controller.rb +94 -0
- data/lib/saucy/railties/tasks.rake +28 -0
- data/lib/saucy/routing_extensions.rb +121 -0
- data/lib/saucy/subscription.rb +237 -0
- data/lib/saucy/user.rb +30 -0
- data/spec/controllers/accounts_controller_spec.rb +228 -0
- data/spec/controllers/application_controller_spec.rb +32 -0
- data/spec/controllers/invitations_controller_spec.rb +215 -0
- data/spec/controllers/memberships_controller_spec.rb +117 -0
- data/spec/controllers/plans_controller_spec.rb +13 -0
- data/spec/controllers/profiles_controller_spec.rb +48 -0
- data/spec/controllers/projects_controller_spec.rb +216 -0
- data/spec/environment.rb +95 -0
- data/spec/layouts_spec.rb +21 -0
- data/spec/mailers/billing_mailer_spec.rb +68 -0
- data/spec/mailers/invitiation_mailer_spec.rb +19 -0
- data/spec/models/account_spec.rb +218 -0
- data/spec/models/invitation_spec.rb +320 -0
- data/spec/models/limit_spec.rb +70 -0
- data/spec/models/membership_spec.rb +37 -0
- data/spec/models/permission_spec.rb +30 -0
- data/spec/models/plan_spec.rb +81 -0
- data/spec/models/project_spec.rb +223 -0
- data/spec/models/signup_spec.rb +177 -0
- data/spec/models/subscription_spec.rb +481 -0
- data/spec/models/user_spec.rb +72 -0
- data/spec/route_extensions_spec.rb +51 -0
- data/spec/saucy_spec.rb +62 -0
- data/spec/scaffold/config/routes.rb +5 -0
- data/spec/spec_helper.rb +39 -0
- data/spec/support/authentication_helpers.rb +81 -0
- data/spec/support/authorization_helpers.rb +56 -0
- data/spec/support/braintree.rb +7 -0
- data/spec/support/clearance_matchers.rb +55 -0
- data/spec/support/notifications.rb +57 -0
- data/spec/views/accounts/_account.html.erb_spec.rb +37 -0
- metadata +325 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
<% if projects.empty? -%>
|
2
|
+
<%= render 'accounts/blank_slate', :account => account %>
|
3
|
+
<% else -%>
|
4
|
+
<ul class="projects">
|
5
|
+
<% projects.each do |project| -%>
|
6
|
+
<%= content_tag_for :li, project do -%>
|
7
|
+
<%= link_to h(project.name), project_path(project) %>
|
8
|
+
<% end -%>
|
9
|
+
<% end -%>
|
10
|
+
</ul>
|
11
|
+
<% end -%>
|
12
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<% content_for :subnav do -%>
|
2
|
+
<ul class="subnav">
|
3
|
+
<li class="accounts"><%= link_to "Account Info", edit_account_url(current_account) %></li>
|
4
|
+
<li class="projects"><%= link_to "Projects", account_projects_url(current_account) %></li>
|
5
|
+
<li class="users"><%= link_to "Users", account_memberships_url(current_account) %></li>
|
6
|
+
<% if current_account.plan.billed? %>
|
7
|
+
<li class="billing"><%= link_to "Billing", account_billing_path(current_account) %></li>
|
8
|
+
<% end -%>
|
9
|
+
</ul>
|
10
|
+
<% end -%>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<% content_for :header do -%>
|
2
|
+
<h2>Account Settings</h2>
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%= render :partial => 'subnav' %>
|
6
|
+
|
7
|
+
<div class="plan current">
|
8
|
+
<h3>Your Plan</h3>
|
9
|
+
<%= render @account.plan %>
|
10
|
+
<%= link_to "Upgrade", edit_account_plan_path(current_account), :id => "upgrade-account" %>
|
11
|
+
|
12
|
+
<% @account.plan.limits.numbered.each do |limit| -%>
|
13
|
+
<%= render_limit_meter(limit) %>
|
14
|
+
<% end -%>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<%= content_tag_for :div, @account do -%>
|
18
|
+
<%= semantic_form_for @account do |form| %>
|
19
|
+
<%= form.inputs do %>
|
20
|
+
<%= form.input :name, :label => "Account name" %>
|
21
|
+
<%= form.input :keyword %>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<%= form.buttons do %>
|
25
|
+
<%= form.commit_button "Update" %>
|
26
|
+
<li>
|
27
|
+
<%= link_to t(".delete", :default => "Delete my account"),
|
28
|
+
@account,
|
29
|
+
:method => :delete,
|
30
|
+
:confirm => "Are you sure? All data will be irreversibly deleted." %>
|
31
|
+
</li>
|
32
|
+
<% end %>
|
33
|
+
<% end %>
|
34
|
+
<% end -%>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<% content_for :header do -%>
|
2
|
+
<h2>Sign up</h2>
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%= semantic_form_for @signup, :url => plan_accounts_path(@plan) do |form| %>
|
6
|
+
<div class="plan chosen">
|
7
|
+
<h3>You're signing up for:</h3>
|
8
|
+
<%= render @plan %>
|
9
|
+
<%= link_to "Change this plan", plans_path %>
|
10
|
+
</div>
|
11
|
+
|
12
|
+
<% unless signed_in? -%>
|
13
|
+
<h5 class="legend">User Information</h5>
|
14
|
+
<%= form.inputs do %>
|
15
|
+
<%= form.input :email, :required => true %>
|
16
|
+
<%= form.input :password, :required => true %>
|
17
|
+
<% end -%>
|
18
|
+
<% else -%>
|
19
|
+
<p id="existing-user-text">Your existing user, <strong><%= current_user.name %></strong>, will be added as the first administrator on this new account.</p>
|
20
|
+
<% end -%>
|
21
|
+
|
22
|
+
<% if @plan.billed? -%>
|
23
|
+
<h5 class="legend">Billing Information</h5>
|
24
|
+
<%= render :partial => 'billings/form', :locals => { :form => form } %>
|
25
|
+
<% end -%>
|
26
|
+
|
27
|
+
<p id="terms-text">By clicking <strong>Sign up</strong> you agree to our <%= link_to "Terms of Service", "/pages/terms" %>.</p>
|
28
|
+
|
29
|
+
<%= form.buttons do %>
|
30
|
+
<%= form.commit_button "Sign up" %>
|
31
|
+
<% end %>
|
32
|
+
<% end %>
|
33
|
+
|
34
|
+
<%= render "plans/terms" %>
|
35
|
+
|
36
|
+
<%= render :partial => "shared/saucy_javascript" %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= t(".greeting") %>
|
2
|
+
|
3
|
+
<%= t(".notice", :account_name => @account.name, :app_name => t("app_name")) %>
|
4
|
+
|
5
|
+
<%= edit_account_plan_url(@account) %>
|
6
|
+
|
7
|
+
<%= t(".contact", :app_name => t("app_name")) %>
|
8
|
+
|
9
|
+
============================================================
|
10
|
+
|
11
|
+
Thanks for your business,
|
12
|
+
The <%= t("app_name") %> Team
|
13
|
+
<%= t("app_url") %>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<%= t(".greeting") %>
|
2
|
+
|
3
|
+
<%= t(".expiration_notice",
|
4
|
+
:account_name => @account.name,
|
5
|
+
:app_name => t("app_name")) %>
|
6
|
+
|
7
|
+
<%= edit_account_plan_url(@account) %>
|
8
|
+
|
9
|
+
<%= t(".contact", :app_name => t("app_name")) %>
|
10
|
+
|
11
|
+
============================================================
|
12
|
+
|
13
|
+
Thanks for your business,
|
14
|
+
The <%= t("app_name") %> Team
|
15
|
+
<%= t("app_url") %>
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= t(".body", :app_name => t("app_name"), :new_project_url => new_account_project_url(@account)) %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<p>Unfortunately there was a problem processing your latest payment for your <%= @account.name -%> account on <%= t("app_name") %>.</p>
|
2
|
+
|
3
|
+
<p>Some functionality of your <%= @account.name -%> account on <%= t("app_name") %> is now disabled.</p>
|
4
|
+
|
5
|
+
<p>Please verify and fix the credit card details <%= link_to "here", account_billing_url(@account) %> to restore full access to the account.</p>
|
6
|
+
|
7
|
+
<p>If you have any questions, please contact us anytime at <%= mail_to t("support_email"), t("support_email") %>.</p>
|
8
|
+
|
9
|
+
<hr/>
|
10
|
+
|
11
|
+
<p>Thanks for your business,<br/>
|
12
|
+
The <%= t("app_name") %> Team<br/>
|
13
|
+
<%= t("app_url") %></p>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Unfortunately there was a problem processing your latest payment for your <%= @account.name -%> account on <%= t("app_name") %>.
|
2
|
+
|
3
|
+
Some functionality of your <%= @account.name -%> account on <%= t("app_name") %> is now disabled.
|
4
|
+
|
5
|
+
Please verify and fix the credit card details at the following url to restore full access to the account:
|
6
|
+
<%= account_billing_url(@account) %>
|
7
|
+
|
8
|
+
If you have any questions, please contact us anytime at <%= t("support_email") %>.
|
9
|
+
|
10
|
+
============================================================
|
11
|
+
|
12
|
+
Thanks for your business,
|
13
|
+
The <%= t("app_name") %> Team
|
14
|
+
<%= t("app_url") %>
|
@@ -0,0 +1,41 @@
|
|
1
|
+
<p><strong>Thanks for your business!</strong></p>
|
2
|
+
|
3
|
+
<p>The latest payment for your <strong><%= @account.name -%> account on <%= t("app_name") %></strong> has been approved. This is only a receipt, no payment is due. If you have any questions, please contact us anytime at <%= mail_to t("support_email"), t("support_email") %></p>
|
4
|
+
|
5
|
+
<hr/>
|
6
|
+
|
7
|
+
<table>
|
8
|
+
<tr>
|
9
|
+
<td>
|
10
|
+
RECEIPT
|
11
|
+
</td>
|
12
|
+
<td>
|
13
|
+
<%= @transaction.created_at.to_s(:short_date) -%>
|
14
|
+
</td>
|
15
|
+
</tr>
|
16
|
+
<tr>
|
17
|
+
<td colspan="2">
|
18
|
+
Plan: <%= @account.plan.name -%></br>
|
19
|
+
Charge: USD <%= number_to_currency @account.plan.price -%>*<br/>
|
20
|
+
Credit card: XXXX-XXXX-XXXX-<%= @account.credit_card.last_4 %>
|
21
|
+
|
22
|
+
<p><small>* EU customers: prices exclude VAT</small></p>
|
23
|
+
</td>
|
24
|
+
</tr>
|
25
|
+
<tr>
|
26
|
+
<td>
|
27
|
+
<%= t("saucy.billing_address") %>
|
28
|
+
</td>
|
29
|
+
<td>
|
30
|
+
<strong>Bill to:</strong><br/>
|
31
|
+
<%= @account.name %><br/>
|
32
|
+
<%= @account.credit_card.cardholder_name %>
|
33
|
+
</td>
|
34
|
+
</tr>
|
35
|
+
</table>
|
36
|
+
|
37
|
+
<hr/>
|
38
|
+
|
39
|
+
<p>Thanks for your business,<br/>
|
40
|
+
The <%= t("app_name") %> Team<br/>
|
41
|
+
<%= link_to t("app_url"), t("app_url") %></p>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Thanks for your business!
|
2
|
+
|
3
|
+
The latest payment for your <%= @account.name -%> account on <%= t("app_name") %> has been approved. This is only a receipt, no payment is due. If you have any questions, please contact us anytime at <%= t("support_email") %>.
|
4
|
+
|
5
|
+
============================================================
|
6
|
+
RECEIPT <%= @transaction.created_at.to_s(:short_date) -%>
|
7
|
+
|
8
|
+
|
9
|
+
Plan: <%= @account.plan.name -%>
|
10
|
+
Charge: USD <%= number_to_currency @account.plan.price -%>*
|
11
|
+
Credit card: XXXX-XXXX-XXXX-<%= @account.credit_card.last_4 %>
|
12
|
+
|
13
|
+
<%= t("saucy.billing_address") %>
|
14
|
+
|
15
|
+
Bill to:
|
16
|
+
<%= @account.name %>
|
17
|
+
<%= @account.credit_card.cardholder_name %>
|
18
|
+
|
19
|
+
* EU customers: prices exclude VAT
|
20
|
+
|
21
|
+
============================================================
|
22
|
+
|
23
|
+
Thanks for your business,
|
24
|
+
The <%= t("app_name") %> Team
|
25
|
+
<%= t("app_url") %>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<%= form.inputs do %>
|
2
|
+
<%= form.input :cardholder_name, :required => true %>
|
3
|
+
<%= form.input :billing_email, :required => true, :hint => "We'll send receipts and billing issues to this address." %>
|
4
|
+
<%= form.input :card_number, :required => true, :input_html => { :autocomplete => "off" } %>
|
5
|
+
<%= form.input :verification_code, :required => true, :input_html => { :autocomplete => "off" } %>
|
6
|
+
<%= form.input :expiration_month, :collection => [['January', '01'], ['February', '02'], ['March', '03'], ['April', '04'], ['May', '05'], ['June', '06'], ['July', '07'], ['August', '08'], ['September', '09'], ['October', '10'], ['November', '11'], ['December', '12']], :required => true %>
|
7
|
+
<%= form.input :expiration_year, :collection => (Date.today.year..(Date.today.year+10)).to_a, :required => true %>
|
8
|
+
<% end -%>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= content_for :header do -%>
|
2
|
+
<h2>Billing Information</h2>
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%= render :partial => 'accounts/subnav' %>
|
6
|
+
|
7
|
+
<%= semantic_form_for @account, :url => account_billing_path(@account) do |form| %>
|
8
|
+
<%= render :partial => 'billings/form', :locals => { :form => form } %>
|
9
|
+
|
10
|
+
<%= form.buttons do %>
|
11
|
+
<%= form.commit_button "Update" %>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<% if current_user.admin_of?(current_account) -%>
|
2
|
+
<% content_for :header do -%>
|
3
|
+
<h2>Billing Information</h2>
|
4
|
+
<% end -%>
|
5
|
+
|
6
|
+
<%= render :partial => 'accounts/subnav' %>
|
7
|
+
|
8
|
+
<div class="current_credit_card">
|
9
|
+
<p>We're currently charging the credit card ending in <%= current_account.credit_card.last_4 %>. <%= link_to "Change", edit_account_billing_path(current_account) %></p>
|
10
|
+
</div>
|
11
|
+
<div class="billing_history">
|
12
|
+
<h3>Your Invoices</h3>
|
13
|
+
<% if current_account.subscription.transactions.any? -%>
|
14
|
+
<table>
|
15
|
+
<tr>
|
16
|
+
<th>Date</th>
|
17
|
+
<th>Amount</th>
|
18
|
+
</tr>
|
19
|
+
<% current_account.subscription.transactions.each do |transaction| -%>
|
20
|
+
<tr>
|
21
|
+
<td><%= transaction.created_at.to_s(:short_date) %></td> <td><%= number_to_currency transaction.amount %></td>
|
22
|
+
</tr>
|
23
|
+
<% end -%>
|
24
|
+
</table>
|
25
|
+
<% else -%>
|
26
|
+
<p>There have been no invoices yet.</p>
|
27
|
+
<% end -%>
|
28
|
+
</div>
|
29
|
+
<% end -%>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% content_for :header do -%>
|
2
|
+
<h2>Invite a new User</h2>
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%= render :partial => 'accounts/subnav' %>
|
6
|
+
|
7
|
+
<%= semantic_form_for [current_account, @invitation] do |form| -%>
|
8
|
+
<%= form.inputs do -%>
|
9
|
+
<%= form.input :email %>
|
10
|
+
<%= form.input :admin, :label => "Grant administrator privileges" %>
|
11
|
+
<%= form.input :projects, :as => :check_boxes, :collection => @projects %>
|
12
|
+
<% end -%>
|
13
|
+
|
14
|
+
<%= form.buttons do -%>
|
15
|
+
<%= form.commit_button "Invite User" %>
|
16
|
+
<% end -%>
|
17
|
+
<% end -%>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% content_for :header do -%>
|
2
|
+
<h2>Accept invitation to <%= @invitation.account_name %></h2>
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%= semantic_form_for @invitation do |form| %>
|
6
|
+
<h5 class="legend">I am a new user</h5>
|
7
|
+
<%= form.inputs :class => 'new_user' do -%>
|
8
|
+
<%= form.input :new_user_email, :label => 'Email' %>
|
9
|
+
<%= form.input :new_user_name, :label => 'Name' %>
|
10
|
+
<%= form.input :new_user_password, :label => 'Password' %>
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
<h5 class="legend">I am an existing user</h5>
|
14
|
+
<%= form.inputs :class => 'existing_user' do -%>
|
15
|
+
<%= form.input :authenticating_user_email, :label => 'Email' %>
|
16
|
+
<%= form.input :authenticating_user_password, :label => 'Password' %>
|
17
|
+
<% end -%>
|
18
|
+
|
19
|
+
<%= form.buttons do %>
|
20
|
+
<%= form.commit_button "Accept Invitation" %>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
6
|
+
<%= csrf_meta_tag %>
|
7
|
+
</head>
|
8
|
+
|
9
|
+
<body class="saucy">
|
10
|
+
<% flash.each do |key, value| -%>
|
11
|
+
<%= value %>
|
12
|
+
<% end -%>
|
13
|
+
|
14
|
+
<% if signed_in? -%>
|
15
|
+
<%= render :partial => 'shared/project_dropdown' %>
|
16
|
+
<% else %>
|
17
|
+
<%= link_to root_url do %>
|
18
|
+
<h1><%= t("app_name") %></h1>
|
19
|
+
<% end %>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<% if signed_in? -%>
|
23
|
+
<%= link_to 'Sign out', sign_out_path, :method => :delete %>
|
24
|
+
<% else -%>
|
25
|
+
<%= link_to 'Sign in', sign_in_path %>
|
26
|
+
<% end -%>
|
27
|
+
|
28
|
+
<%= yield :subnav %>
|
29
|
+
<%= yield :header %>
|
30
|
+
|
31
|
+
<%= yield %>
|
32
|
+
|
33
|
+
<%= javascript_include_tag 'jquery' %>
|
34
|
+
<%= yield :javascript %>
|
35
|
+
</body>
|
36
|
+
</html>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= content_tag_for :div, limit, :class => "#{limit.name} meter" do %>
|
2
|
+
<span class="numbers">
|
3
|
+
<em><%= limit.current_count(current_account) %></em><span>/<%= limit.value %></span>
|
4
|
+
</span>
|
5
|
+
<span class="label">
|
6
|
+
<%= limit.name %>
|
7
|
+
</span>
|
8
|
+
<div class="bar">
|
9
|
+
<span style="width: <%= current_percentage(limit, current_account) %>;">
|
10
|
+
<%= current_percentage(limit, current_account) %>
|
11
|
+
</span>
|
12
|
+
</div>
|
13
|
+
<% end %>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<% content_for :header do -%>
|
2
|
+
<h2>Permissions for <span><%= @membership.name %></span> on <%= current_account.name %></h2>
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<div class="actions">
|
6
|
+
<%= link_to @membership, :method => :delete, :confirm => "Are you sure?" do %>
|
7
|
+
<span class="delete_item">Remove <%= @membership.user.name %> from <%= current_account.name %></span>
|
8
|
+
<% end -%>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<%= render :partial => 'accounts/subnav' %>
|
12
|
+
|
13
|
+
<%= semantic_form_for @membership do |form| -%>
|
14
|
+
<%= form.inputs do -%>
|
15
|
+
<%= form.input :admin, :label => "#{@membership.user.name} is an Admin on #{current_account.name}" %>
|
16
|
+
<%= form.input :projects, :as => :check_boxes, :collection => @projects, :label => "#{@membership.user.name} belongs to these projects:" %>
|
17
|
+
<% end -%>
|
18
|
+
<%= form.buttons do -%>
|
19
|
+
<%= form.commit_button "Update" %>
|
20
|
+
<% end -%>
|
21
|
+
<% end -%>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<% content_for :header do -%>
|
2
|
+
<h2>Users for <span><%= current_account.name %></span></h2>
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%= render :partial => 'accounts/subnav' %>
|
6
|
+
|
7
|
+
<ul class="users">
|
8
|
+
<% @memberships.each do |membership| -%>
|
9
|
+
<%= content_tag_for :li, membership.user do -%>
|
10
|
+
<%= link_to [:edit, membership] do %>
|
11
|
+
<%= membership.name %> <span>(<%= membership.email %>)</span>
|
12
|
+
<% end -%>
|
13
|
+
<% end -%>
|
14
|
+
<% end -%>
|
15
|
+
</ul>
|
16
|
+
|
17
|
+
<%= link_to 'Invite user', new_account_invitation_path(current_account), :class => "button"%>
|