summaryrefslogtreecommitdiff
path: root/engines/billing/app/views/subscriptions
diff options
context:
space:
mode:
authorclaucece <soficeli0@gmail.com>2015-09-27 23:04:55 -0500
committerclaucece <soficeli0@gmail.com>2015-10-05 22:41:21 -0500
commit6c4f02fd2d530c28899561fac40ca76075975dc8 (patch)
tree575f0aa91e189a6894f3bd1bce7fb5e83f02a6f7 /engines/billing/app/views/subscriptions
parentb26d10fe7d87b570bd888fa2a2543f3675278f8b (diff)
update to haml, created translations, deleted files
Diffstat (limited to 'engines/billing/app/views/subscriptions')
-rw-r--r--engines/billing/app/views/subscriptions/_customer_form.html.erb13
-rw-r--r--engines/billing/app/views/subscriptions/_customer_form.html.haml10
-rw-r--r--engines/billing/app/views/subscriptions/_subscription_details.html.haml3
-rw-r--r--engines/billing/app/views/subscriptions/create.html.haml9
-rw-r--r--engines/billing/app/views/subscriptions/destroy.html.haml7
-rw-r--r--engines/billing/app/views/subscriptions/index.html.erb35
-rw-r--r--engines/billing/app/views/subscriptions/index.html.haml29
-rw-r--r--engines/billing/app/views/subscriptions/index2.html.haml8
-rw-r--r--engines/billing/app/views/subscriptions/new12.html.haml27
-rw-r--r--engines/billing/app/views/subscriptions/show.html.erb22
-rw-r--r--engines/billing/app/views/subscriptions/show.html.haml19
-rw-r--r--engines/billing/app/views/subscriptions/show2.html.haml7
12 files changed, 60 insertions, 129 deletions
diff --git a/engines/billing/app/views/subscriptions/_customer_form.html.erb b/engines/billing/app/views/subscriptions/_customer_form.html.erb
deleted file mode 100644
index 2e8a3b1..0000000
--- a/engines/billing/app/views/subscriptions/_customer_form.html.erb
+++ /dev/null
@@ -1,13 +0,0 @@
-<p>Please enter your personal info:</p>
-<div class="mb1">
- <%= text_field_tag :first_name, "",placeholder: "First Name", class: "radius" %>
-</div>
-<div class="mb1">
- <%= text_field_tag :last_name, "",placeholder: "Last Name", class: "radius" %>
-</div>
-<div class="mb1">
- <%= text_field_tag :company, "",placeholder: "Company", class: "radius" %>
-</div>
-<div class="mb1">
- <%= text_field_tag :phone, "",placeholder: "Phone", class: "radius" %>
-</div>
diff --git a/engines/billing/app/views/subscriptions/_customer_form.html.haml b/engines/billing/app/views/subscriptions/_customer_form.html.haml
new file mode 100644
index 0000000..70b9b97
--- /dev/null
+++ b/engines/billing/app/views/subscriptions/_customer_form.html.haml
@@ -0,0 +1,10 @@
+%p
+ = t(:personal_info)
+%div
+ = text_field_tag :first_name, "",placeholder: "#{t(:first_name)}", class: "radius"
+%div
+ = text_field_tag :last_name, "",placeholder: "#{t(:last_name)}", class: "radius"
+%div
+ = text_field_tag :company, "",placeholder: "#{t(:company)}", class: "radius"
+%div
+ = text_field_tag :phone, "",placeholder: "#{t(:phone)}", class: "radius"
diff --git a/engines/billing/app/views/subscriptions/_subscription_details.html.haml b/engines/billing/app/views/subscriptions/_subscription_details.html.haml
index 6145c95..e6cf87d 100644
--- a/engines/billing/app/views/subscriptions/_subscription_details.html.haml
+++ b/engines/billing/app/views/subscriptions/_subscription_details.html.haml
@@ -1,3 +1,4 @@
+/needed?
%p
- if local_assigns[:show_user]
User:
@@ -23,4 +24,4 @@
Status:
%font{:color => color}
= subscription.status
- - # would be good to get plan name but not sure if that is possible? \ No newline at end of file
+ - # would be good to get plan name but not sure if that is possible?
diff --git a/engines/billing/app/views/subscriptions/create.html.haml b/engines/billing/app/views/subscriptions/create.html.haml
deleted file mode 100644
index 2b6c5e9..0000000
--- a/engines/billing/app/views/subscriptions/create.html.haml
+++ /dev/null
@@ -1,9 +0,0 @@
-- if @result.success?
- %h1
- Subscription Status
- = @result.subscription.status
- = render :partial => "subscription_details", :locals => {:subscription => @result.subscription}
-- else
- %h1
- Error:
- = @result.message \ No newline at end of file
diff --git a/engines/billing/app/views/subscriptions/destroy.html.haml b/engines/billing/app/views/subscriptions/destroy.html.haml
deleted file mode 100644
index e6e8578..0000000
--- a/engines/billing/app/views/subscriptions/destroy.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-- if @result.success?
- Subscription destroyed
-- else
- Error:
- = @result.message
-%p
- = btn 'Customer Information', show_customer_path(@user)
diff --git a/engines/billing/app/views/subscriptions/index.html.erb b/engines/billing/app/views/subscriptions/index.html.erb
deleted file mode 100644
index 688e371..0000000
--- a/engines/billing/app/views/subscriptions/index.html.erb
+++ /dev/null
@@ -1,35 +0,0 @@
-<h2 class="mbs">Subscriptions</h2>
-<br>
-<h4><div id="last"> Lastest Subscriptions:</h4>
- <% if @user.subscription_id %>
- <ul>
- <% @subscription.transactions.each do |transaction| %>
- <li>
- Date: <%= transaction.created_at %>
- </li>
- <% end %>
- </ul>
- <ul>
- <%= link_to "Unsubscribe from #{@plan.name}", unsubscribe_subscription_path(@subscription.plan_id), method: :delete, class: "btn btn-danger" %>
- </ul>
-</div>
- <br>
- <% else %>
- <p> No subscriptions. </p>
- <br>
- <h4>Choose subcription:</h4>
- <br>
- <ul class="nav nav-tabs nav-stacked">
- <% @subscriptions.each do |subscription| %>
- <li>
- <div class="well">
- <%= subscription.name %>
- <%= subscription.price %>
- </div>
- <div>
- <%= link_to "Choose", subscription_path(subscription.id), class: "btn btn-info" %>
- </div> <br>
- </li>
- <% end %>
- <% end %>
-</ul>
diff --git a/engines/billing/app/views/subscriptions/index.html.haml b/engines/billing/app/views/subscriptions/index.html.haml
new file mode 100644
index 0000000..70fbf8d
--- /dev/null
+++ b/engines/billing/app/views/subscriptions/index.html.haml
@@ -0,0 +1,29 @@
+%h2.mbs
+ = t(:subscriptions)
+%h4{ :style => "line-height: 300%;" }
+ .last
+ = t(:lastestsubs)
+ - if @user.subscription_id
+ %ul
+ - @subscription.transactions.each do |transaction|
+ %li
+ %p{ :style => "font-size: 14px; font-weight: normal;" }
+ #{t(:date)} #{transaction.created_at}
+ %ul
+ = link_to "#{t(:unsubscribe_from)} #{@plan.name}", unsubscribe_subscription_path(@subscription.plan_id), method: :delete, class: "btn btn-danger"
+ %br
+ - else
+ %p{ :style => "font-size: 14px; font-weight: normal;"}
+ =t(:no_subs)
+ %h4
+ =t(:choose_subs)
+ %br
+ %ul.nav.nav-tabs.nav-stacked
+ - @subscriptions.each do |subscription|
+ .well
+ = subscription.name
+ = "$" + subscription.price.to_s
+ %div{ :style => "line-height: 300%;" }
+ = link_to t(:choose_button), subscription_path(subscription.id), class: "btn btn-info"
+
+
diff --git a/engines/billing/app/views/subscriptions/index2.html.haml b/engines/billing/app/views/subscriptions/index2.html.haml
deleted file mode 100644
index 1e3fb25..0000000
--- a/engines/billing/app/views/subscriptions/index2.html.haml
+++ /dev/null
@@ -1,8 +0,0 @@
-%h2=t :all_subscriptions
-- pending_active_pastdue = false
-- @subscriptions.each do |s|
- - if ['Pending', 'Active','Past Due'].include? s.status
- - pending_active_pastdue = true
- = render :partial => "subscription_details", :locals => {:subscription => s}
-- if !pending_active_pastdue and @user == current_user
- = btn 'subscribe to plan', new_subscription_path
diff --git a/engines/billing/app/views/subscriptions/new12.html.haml b/engines/billing/app/views/subscriptions/new12.html.haml
deleted file mode 100644
index 8b302f2..0000000
--- a/engines/billing/app/views/subscriptions/new12.html.haml
+++ /dev/null
@@ -1,27 +0,0 @@
-%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
diff --git a/engines/billing/app/views/subscriptions/show.html.erb b/engines/billing/app/views/subscriptions/show.html.erb
deleted file mode 100644
index 92cf863..0000000
--- a/engines/billing/app/views/subscriptions/show.html.erb
+++ /dev/null
@@ -1,22 +0,0 @@
-<script src="https://js.braintreegateway.com/v2/braintree.js"></script>
-<h2 class="mbs">New Subscription
-</h2>
-<%= simple_form_for :subscription, :url => subscribe_subscription_path(@plan.id), :id => "checkout-form" do |f| %>
- <% if current_user and !current_user.has_payment_info? %>
- <%= render 'customer_form'%>
- <% end %>
- <br/>
- <p> Please enter payment details: </p>
- <div id="payment-form"></div>
- <div id="coinbase-container-id"></div>
- <div class="form-actions">
- <%= f.submit t(:subscribe), :class => 'btn btn-primary' %>
- </div>
- <script charset="utf-8" type="text/javascript">
- var clientToken = "<%= @client_token %>";
- braintree.setup(clientToken, "dropin", {
- container: "payment-form",
- coinbase: { container: "coinbase-container-id" }
- });
- </script>
-<% end %>
diff --git a/engines/billing/app/views/subscriptions/show.html.haml b/engines/billing/app/views/subscriptions/show.html.haml
new file mode 100644
index 0000000..45c54cc
--- /dev/null
+++ b/engines/billing/app/views/subscriptions/show.html.haml
@@ -0,0 +1,19 @@
+%script{:src => "https://js.braintreegateway.com/v2/braintree.js"}
+%h2.mbs
+ = t(:new_subs)
+= simple_form_for :subscription, :url => subscribe_subscription_path(@plan.id), :id => "checkout-form" do |f|
+ - if current_user and !current_user.has_payment_info?
+ = render 'customer_form'
+ %br/
+ %p
+ =t(:pay_details)
+ #payment-form
+ #coinbase-container-id
+ .form-actions
+ = f.submit t(:subscribe), :class => 'btn btn-primary'
+ :javascript
+ var clientToken = "#{@client_token}";
+ braintree.setup(clientToken, "dropin", {
+ container: "payment-form",
+ coinbase: { container: "coinbase-container-id" }
+ });
diff --git a/engines/billing/app/views/subscriptions/show2.html.haml b/engines/billing/app/views/subscriptions/show2.html.haml
deleted file mode 100644
index 246ebf0..0000000
--- a/engines/billing/app/views/subscriptions/show2.html.haml
+++ /dev/null
@@ -1,7 +0,0 @@
-%h1
- - if @subscription.status == 'Active'
- Current
- Subscription
-= render :partial => "subscription_details", :locals => {:subscription => @subscription}
-- if allow_cancel_subscription(@subscription)
- = destroy_btn :cancel_subscription, user_subscription_path(@user, @subscription.id), type: 'danger'