summaryrefslogtreecommitdiff
path: root/engines/billing/app/views/subscriptions
diff options
context:
space:
mode:
Diffstat (limited to 'engines/billing/app/views/subscriptions')
-rw-r--r--engines/billing/app/views/subscriptions/new.html.erb52
-rw-r--r--engines/billing/app/views/subscriptions/new12.html.haml27
2 files changed, 57 insertions, 22 deletions
diff --git a/engines/billing/app/views/subscriptions/new.html.erb b/engines/billing/app/views/subscriptions/new.html.erb
index f3e143a..2336981 100644
--- a/engines/billing/app/views/subscriptions/new.html.erb
+++ b/engines/billing/app/views/subscriptions/new.html.erb
@@ -3,33 +3,41 @@
<br>
<%= form_tag subscriptions_path, id: "checkout-form" do %>
<% if current_user and !current_user.has_payment_info? %>
- <%= render 'customer_form' unless @anonymous_user%>
- <% end %>
+ <%= render 'customer_form' %>
+ <% end %>
<br>
<p>Choose subcription:</p>
-<ul>
- <% @subscriptions.each do |subscription| %>
- <li>
- <%= subscription.name %>
- -
- <%= subscription.price %>
- <%= simple_form_for :subscription, :url => :subscriptions, :id => "checkout-form-#{subscription.id}" do |f| %>
- <input type="hidden" name="plan_id" id="" value="<%= subscription.id%>" />
- <div id="payment-form-<%= subscription.id%>"></div>
- <div class="form-actions">
- <%= f.submit t(:subscribe), :class => 'btn btn-primary' %>
+<br>
+<ul class="nav nav-tabs nav-stacked">
+ <% @subscriptions.each do |subscription| %>
+ <li>
+ <div class="btn-group">
+ <button class="btn"> <%= subscription.name %>
+ <%= subscription.price %> </button>
</div>
- <script type="text/javascript" charset="utf-8">
- var clientToken = "<%= @client_token %>";
- braintree.setup(clientToken, "dropin", {
- container: "payment-form-<%= subscription.id%>",
- coinbase: { container: "coinbase-container-id" }
- });
- </script>
- <% end %>
- </li>
+ <br>
+ <br>
+ <%= simple_form_for :subscription, :url => :subscriptions, :id => "checkout-form-#{subscription.id}" do |f| %>
+ <input type="hidden" name="plan_id" id="" value="<%= subscription.id%>" />
+ <div id="payment-form-<%= subscription.id%>"></div>
+ <div class="form-actions">
+ <%= f.submit t(:subscribe), :class => 'btn btn-primary' %>
+ </div>
+ <script type="text/javascript" charset="utf-8">
+ var clientToken = "<%= @client_token %>";
+ braintree.setup(clientToken, "dropin", {
+ container: "payment-form-<%= subscription.id%>",
+ coinbase: { container: "coinbase-container-id" }
+ });
+ </script>
+ <% end %>
+ </li>
<% end %>
</ul>
<div id="payment-form"></div>
<div id='coinbase-container-id'></div>
<% end %>
+
+
+
+
diff --git a/engines/billing/app/views/subscriptions/new12.html.haml b/engines/billing/app/views/subscriptions/new12.html.haml
new file mode 100644
index 0000000..8b302f2
--- /dev/null
+++ b/engines/billing/app/views/subscriptions/new12.html.haml
@@ -0,0 +1,27 @@
+%script{:src => "https://js.braintreegateway.com/v2/braintree.js"}
+%h2.mbs Subscriptions
+%br/
+= form_tag subscriptions_path, id: "checkout-form" do
+ - if current_user and !current_user.has_payment_info?
+ = render 'customer_form'
+ %br/
+ %p Choose subcription:
+ %ul
+ - @subscriptions.each do |subscription|
+ %li
+ = subscription.name
+ = subscription.price
+ = simple_form_for :subscription, :url => :subscriptions, :id => "checkout-form-#{subscription.id}" do |f|
+ %input{:id => "", :name => "plan_id", :type => "hidden", :value => subscription.id}
+ %div{:id => "payment-form-#{subscription.id}"}
+ .form-actions
+ = f.submit t(:subscribe), :class => 'btn btn-primary'
+ %script{:charset => "utf-8", :type => "text/javascript"}
+ :cdata
+ var clientToken = "#{@client_token}";
+ braintree.setup(clientToken, "dropin", {
+ container: "payment-form-#{subscription.id}",
+ coinbase: { container: "coinbase-container-id" }
+ });
+#payment-form
+#coinbase-container-id