spree_account_recurring 1.3.1 → 2.0.0
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.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/app/overrides/admin/view_decorator.rb +6 -13
- data/app/views/spree/admin/plans/_form.html.erb +23 -21
- data/app/views/spree/admin/plans/edit.html.erb +5 -7
- data/app/views/spree/admin/plans/index.html.erb +17 -31
- data/app/views/spree/admin/plans/new.html.erb +4 -6
- data/app/views/spree/admin/recurrings/_form.html.erb +24 -18
- data/app/views/spree/admin/recurrings/edit.html.erb +5 -7
- data/app/views/spree/admin/recurrings/index.html.erb +11 -19
- data/app/views/spree/admin/recurrings/new.html.erb +4 -6
- data/app/views/spree/admin/subscription_events/index.html.erb +24 -30
- data/app/views/spree/admin/subscriptions/index.html.erb +24 -31
- data/app/views/spree/subscriptions/new.html.erb +1 -1
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 4db1e03b477838b215b23fbe16d469db3a9da284
         | 
| 4 | 
            +
              data.tar.gz: 0bfde31df0e0eccf21116f17625ff15f50623a76
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e3595afe7d4401cb58ae0b67935feb7c63e36a8f8867b72089f8dc4f4f8f6cc8a9612e48a9591e7d857feb4f36f81f029d225e7f7477ca0439a7d9d8e0defb17
         | 
| 7 | 
            +
              data.tar.gz: 2022cbf3d05b8759e725138edde5e49972777f292d5f133e7d7b1146225f47b900178f06ea07a5c65a1126a02f92e3dcb6518982cc47ba8fda6b86d8a224e010
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            Spree Account Recurring [](https://codeclimate.com/github/vinsol/spree-account-recurring) [](https://codeclimate.com/github/vinsol/spree-account-recurring) [](https://travis-ci.org/vinsol/spree-account-recurring)
         | 
| 2 2 | 
             
            =========================
         | 
| 3 3 |  | 
| 4 4 | 
             
            Spree extension to manage recurring payments/subscriptions using [Stripe Payment Gateway](https://stripe.com/).
         | 
| @@ -10,6 +10,11 @@ Installation | |
| 10 10 |  | 
| 11 11 | 
             
            Install `spree_account_recurring` by adding the following to your `Gemfile`:
         | 
| 12 12 |  | 
| 13 | 
            +
            ```ruby
         | 
| 14 | 
            +
            # Spree 3.0.x
         | 
| 15 | 
            +
            gem 'spree_account_recurring', '~> 2.0'
         | 
| 16 | 
            +
            ```
         | 
| 17 | 
            +
             | 
| 13 18 | 
             
            ```ruby
         | 
| 14 19 | 
             
            # Spree 2.4.x
         | 
| 15 20 | 
             
            gem 'spree_account_recurring', '~> 1.3'
         | 
| @@ -1,5 +1,5 @@ | |
| 1 1 | 
             
            Deface::Override.new(
         | 
| 2 | 
            -
              :virtual_path => "spree/admin/shared/ | 
| 2 | 
            +
              :virtual_path => "spree/admin/shared/sub_menu/_configuration",
         | 
| 3 3 | 
             
              :name => "add_recurring_tab_to_configuration_sidebar",
         | 
| 4 4 | 
             
              :insert_bottom => "[data-hook='admin_configurations_sidebar_menu']",
         | 
| 5 5 | 
             
              :text => "<%= configurations_sidebar_menu_item Spree.t(:recurrings), admin_recurrings_path %>",
         | 
| @@ -8,20 +8,13 @@ Deface::Override.new( | |
| 8 8 | 
             
            Deface::Override.new(
         | 
| 9 9 | 
             
              :virtual_path => "spree/admin/reports/index",
         | 
| 10 10 | 
             
              :name => "add_subscriptions_reports_index",
         | 
| 11 | 
            -
              :insert_after => "table. | 
| 11 | 
            +
              :insert_after => "table.table tbody",
         | 
| 12 12 | 
             
              :text => %q{<tr data-hook='reports_row'>
         | 
| 13 | 
            -
                  <td | 
| 14 | 
            -
                  <td | 
| 13 | 
            +
                  <td><%= link_to Spree.t(:subscriptions), admin_subscriptions_url %></td>
         | 
| 14 | 
            +
                  <td>View Recurring Subscriptions</td>
         | 
| 15 15 | 
             
                </tr>
         | 
| 16 16 | 
             
                <tr data-hook='reports_row'>
         | 
| 17 | 
            -
                  <td | 
| 18 | 
            -
                  <td | 
| 17 | 
            +
                  <td><%= link_to Spree.t(:subscription_events), admin_subscription_events_url %></td>
         | 
| 18 | 
            +
                  <td>View Recurring Subscription Events</td>
         | 
| 19 19 | 
             
                </tr>},
         | 
| 20 | 
            -
              :disabled => false)
         | 
| 21 | 
            -
             | 
| 22 | 
            -
            Deface::Override.new(
         | 
| 23 | 
            -
              :virtual_path => "spree/admin/shared/_tabs",
         | 
| 24 | 
            -
              :name => "select_reports_when_subscriptions",
         | 
| 25 | 
            -
              :replace => %q{erb[loud]:contains("tab :reports, :icon => 'icon-file'")},
         | 
| 26 | 
            -
              :text => %q{<%= tab :reports, :subscriptions, :icon => 'icon-file'%>},
         | 
| 27 20 | 
             
              :disabled => false)
         | 
| @@ -1,47 +1,49 @@ | |
| 1 1 | 
             
            <div data-hook="admin_plan_form_fields">
         | 
| 2 2 |  | 
| 3 3 | 
             
              <div data-hook="plan">
         | 
| 4 | 
            -
                <div class=" | 
| 5 | 
            -
                  <div class=" | 
| 4 | 
            +
                <div class="col-md-4">
         | 
| 5 | 
            +
                  <div class="form-group">
         | 
| 6 6 | 
             
                    <%= f.label :interval, Spree.t(:interval) %>
         | 
| 7 | 
            -
                    <%= f.select :interval, @recurring.class::INTERVAL.collect{|k, v| [v, k]}, {}, {:disabled => @plan.persisted?, class: 'select2 | 
| 7 | 
            +
                    <%= f.select :interval, @recurring.class::INTERVAL.collect{|k, v| [v, k]}, {}, {:disabled => @plan.persisted?, class: 'select2'} %>
         | 
| 8 8 | 
             
                  </div>
         | 
| 9 9 |  | 
| 10 | 
            -
                  <div class=" | 
| 10 | 
            +
                  <div class="form-group">
         | 
| 11 11 | 
             
                    <%= f.label :interval_count, Spree.t(:every) %>
         | 
| 12 | 
            -
                    <%= f.select :interval_count, (1..11).collect {|i| [i, i]}, {}, {:disabled => @plan.persisted?, class: 'select2 | 
| 12 | 
            +
                    <%= f.select :interval_count, (1..11).collect {|i| [i, i]}, {}, {:disabled => @plan.persisted?, class: 'select2'} %>
         | 
| 13 13 | 
             
                  </div>
         | 
| 14 14 |  | 
| 15 | 
            -
                  <div class=" | 
| 15 | 
            +
                  <div class="form-group">
         | 
| 16 16 | 
             
                    <%= f.label :currency, Spree.t(:currency) %>
         | 
| 17 | 
            -
                    <%= f.select :currency, @recurring.class::CURRENCY.collect{|k, v| [v, k]}, {}, {:disabled => @plan.persisted?, class: 'select2 | 
| 17 | 
            +
                    <%= f.select :currency, @recurring.class::CURRENCY.collect{|k, v| [v, k]}, {}, {:disabled => @plan.persisted?, class: 'select2'} %>
         | 
| 18 18 | 
             
                  </div>
         | 
| 19 19 | 
             
                </div>
         | 
| 20 20 |  | 
| 21 | 
            -
                <div class=" | 
| 22 | 
            -
                  <div class=" | 
| 21 | 
            +
                <div class="col-md-8">
         | 
| 22 | 
            +
                  <div class="form-group">
         | 
| 23 23 | 
             
                    <%= f.label :name, Spree.t(:name) %>
         | 
| 24 | 
            -
                    <%= f.text_field :name %>
         | 
| 24 | 
            +
                    <%= f.text_field :name, :class => 'form-control' %>
         | 
| 25 25 | 
             
                  </div>
         | 
| 26 26 |  | 
| 27 | 
            -
                  <div class=" | 
| 27 | 
            +
                  <div class="form-group">
         | 
| 28 28 | 
             
                    <%= f.label :amount, Spree.t(:amount) %>
         | 
| 29 | 
            -
                    <%= f.text_field :amount, :disabled => @plan.persisted? %>
         | 
| 29 | 
            +
                    <%= f.text_field :amount, :class => 'form-control', :disabled => @plan.persisted? %>
         | 
| 30 30 | 
             
                  </div>
         | 
| 31 31 |  | 
| 32 | 
            -
                  <div class=" | 
| 32 | 
            +
                  <div class="form-group">
         | 
| 33 33 | 
             
                    <%= f.label :trial_period_days, Spree.t(:trial_period_days) %>
         | 
| 34 | 
            -
                    <%= f.text_field :trial_period_days, :disabled => @plan.persisted? %>
         | 
| 34 | 
            +
                    <%= f.text_field :trial_period_days, :class => 'form-control', :disabled => @plan.persisted? %>
         | 
| 35 35 | 
             
                  </div>
         | 
| 36 36 |  | 
| 37 | 
            -
                  <div class=" | 
| 38 | 
            -
                     | 
| 39 | 
            -
             | 
| 40 | 
            -
             | 
| 41 | 
            -
                     | 
| 37 | 
            +
                  <div class="checkbox">
         | 
| 38 | 
            +
                    <label>
         | 
| 39 | 
            +
                      <%= f.check_box :active %>
         | 
| 40 | 
            +
                      <%= Spree.t(:active) %>
         | 
| 41 | 
            +
                    </label>    
         | 
| 42 | 
            +
                    <label>
         | 
| 43 | 
            +
                      <%= f.check_box :default %>
         | 
| 44 | 
            +
                      <%= Spree.t(:default) %>
         | 
| 45 | 
            +
                    </label>
         | 
| 42 46 | 
             
                  </div>
         | 
| 43 47 | 
             
                </div>
         | 
| 44 48 | 
             
              </div>
         | 
| 45 49 | 
             
            </div>
         | 
| 46 | 
            -
             | 
| 47 | 
            -
            <div class="clear"></div>
         | 
| @@ -1,22 +1,20 @@ | |
| 1 | 
            -
            <%= render :partial => 'spree/admin/shared/ | 
| 1 | 
            +
            <%= render :partial => 'spree/admin/shared/sub_menu/configuration' %>
         | 
| 2 2 |  | 
| 3 3 | 
             
            <% content_for :page_title do %>
         | 
| 4 4 | 
             
              <%= Spree.t(:editing_plan) %> <i class="icon-arrow-right"></i> <%= @plan.name %>
         | 
| 5 5 | 
             
            <% end %>
         | 
| 6 6 |  | 
| 7 7 | 
             
            <% content_for :page_actions do %>
         | 
| 8 | 
            -
               | 
| 9 | 
            -
                <%= button_link_to Spree.t(:back_to_plans_list), admin_recurring_plans_path(@recurring), :icon => 'icon-arrow-left' %>
         | 
| 10 | 
            -
              </li>  
         | 
| 8 | 
            +
              <%= button_link_to Spree.t(:back_to_plans_list), admin_recurring_plans_path(@recurring), :icon => 'arrow-left' %>
         | 
| 11 9 | 
             
            <% end %>
         | 
| 12 10 |  | 
| 13 11 | 
             
            <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @plan } %>
         | 
| 14 12 |  | 
| 15 13 | 
             
            <%= form_for @plan, :url => admin_recurring_plan_url(@recurring, @plan) do |f| %>
         | 
| 16 | 
            -
              <fieldset | 
| 14 | 
            +
              <fieldset>
         | 
| 17 15 | 
             
                <%= render :partial => 'form', :locals => { :f => f } %>
         | 
| 18 | 
            -
                <div data-hook="buttons" class=" | 
| 19 | 
            -
                  <%= button Spree.t('actions.update'), ' | 
| 16 | 
            +
                <div data-hook="buttons" class="actions">
         | 
| 17 | 
            +
                  <%= button Spree.t('actions.update'), 'refresh' %>
         | 
| 20 18 | 
             
                </div>
         | 
| 21 19 | 
             
              </fieldset>
         | 
| 22 20 | 
             
            <% end %>
         | 
| @@ -1,29 +1,15 @@ | |
| 1 | 
            -
            <%= render :partial => 'spree/admin/shared/ | 
| 1 | 
            +
            <%= render :partial => 'spree/admin/shared/sub_menu/configuration' %>
         | 
| 2 2 |  | 
| 3 3 | 
             
            <% content_for :page_title do %>
         | 
| 4 4 | 
             
              <%= Spree.t(:editing_recurring) %> <i class="icon-arrow-right"></i> <%= @recurring.name %> <i class="icon-arrow-right"></i> <%= Spree.t(:plans) %>
         | 
| 5 5 | 
             
            <% end %>
         | 
| 6 6 |  | 
| 7 7 | 
             
            <% content_for :page_actions do %>
         | 
| 8 | 
            -
               | 
| 9 | 
            -
             | 
| 10 | 
            -
              </li>
         | 
| 11 | 
            -
            <% end %>
         | 
| 8 | 
            +
              <%= button_link_to Spree.t(:new_plan), new_admin_recurring_plan_path(@recurring), :icon => 'plus', class: "btn-success", :id => 'admin_new_recurring_plans_link' %>
         | 
| 9 | 
            +
            <% end if can? :create, Spree::Plan %>
         | 
| 12 10 |  | 
| 13 11 | 
             
            <% if @plans.present? %>
         | 
| 14 | 
            -
              <table class=" | 
| 15 | 
            -
                <colgroup>
         | 
| 16 | 
            -
                  <col style="width: 10%">
         | 
| 17 | 
            -
                  <col style="width: 15%">
         | 
| 18 | 
            -
                  <col style="width: 10%">
         | 
| 19 | 
            -
                  <col style="width: 10%">
         | 
| 20 | 
            -
                  <col style="width: 10%">
         | 
| 21 | 
            -
                  <col style="width: 10%">
         | 
| 22 | 
            -
                  <col style="width: 10%">
         | 
| 23 | 
            -
                  <col style="width: 5%">
         | 
| 24 | 
            -
                  <col style="width: 5%">
         | 
| 25 | 
            -
                  <col style="width: 15%">
         | 
| 26 | 
            -
                </colgroup>
         | 
| 12 | 
            +
              <table class="table" id='listing_recurring_plans'>
         | 
| 27 13 | 
             
                <thead>
         | 
| 28 14 | 
             
                  <tr data-hook="admin_recurring_plans_index_headers">
         | 
| 29 15 | 
             
                    <th><%= Spree.t(:api_plan_id) %></th>
         | 
| @@ -35,22 +21,22 @@ | |
| 35 21 | 
             
                    <th><%= Spree.t(:trial_period_days) %></th>
         | 
| 36 22 | 
             
                    <th><%= Spree.t(:active) %></th>
         | 
| 37 23 | 
             
                    <th><%= Spree.t(:default) %></th>
         | 
| 38 | 
            -
                    <th data-hook="admin_recurring_plans_index_header_actions" class="actions"></th>
         | 
| 24 | 
            +
                    <th data-hook="admin_recurring_plans_index_header_actions" class="actions actions-2 text-right"></th>
         | 
| 39 25 | 
             
                  </tr>
         | 
| 40 26 | 
             
                </thead>
         | 
| 41 27 | 
             
                <tbody>
         | 
| 42 28 | 
             
                  <% @plans.each do |plan|%>
         | 
| 43 29 | 
             
                    <tr id="<%= spree_dom_id plan %>" data-hook="admin_recurring_plans_index_rows" class="<%= cycle('odd', 'even')%>">
         | 
| 44 | 
            -
                      <td | 
| 45 | 
            -
                      <td | 
| 46 | 
            -
                      <td | 
| 47 | 
            -
                      <td | 
| 48 | 
            -
                      <td | 
| 49 | 
            -
                      <td | 
| 50 | 
            -
                      <td | 
| 51 | 
            -
                      <td | 
| 52 | 
            -
                      <td | 
| 53 | 
            -
                      <td data-hook="admin_recurring_plans_index_row_actions" class="actions">
         | 
| 30 | 
            +
                      <td><%= plan.api_plan_id %></td>
         | 
| 31 | 
            +
                      <td><%= plan.name %></td>
         | 
| 32 | 
            +
                      <td><%= plan.amount %></td>
         | 
| 33 | 
            +
                      <td><%= @recurring.class::INTERVAL[plan.interval.to_sym] %></td>
         | 
| 34 | 
            +
                      <td><%= plan.interval_count %></td>
         | 
| 35 | 
            +
                      <td><%= @recurring.class::CURRENCY[plan.currency.to_sym] %></td>
         | 
| 36 | 
            +
                      <td><%= plan.trial_period_days %></td>
         | 
| 37 | 
            +
                      <td><%= plan.active ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
         | 
| 38 | 
            +
                      <td><%= plan.default ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
         | 
| 39 | 
            +
                      <td data-hook="admin_recurring_plans_index_row_actions" class="actions actions-2 text-right">
         | 
| 54 40 | 
             
                        <%= link_to_edit_url edit_admin_recurring_plan_url(@recurring, plan), :no_text => true %>
         | 
| 55 41 | 
             
                        <%= link_to_delete plan, url: admin_recurring_plan_url(@recurring, plan), :no_text => true  %>
         | 
| 56 42 | 
             
                      </td>
         | 
| @@ -59,9 +45,9 @@ | |
| 59 45 | 
             
                </tbody>
         | 
| 60 46 | 
             
              </table>
         | 
| 61 47 | 
             
            <% else %>
         | 
| 62 | 
            -
              <div class=" | 
| 48 | 
            +
              <div class="alert alert-info no-objects-found">
         | 
| 63 49 | 
             
                <%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/plan')) %>,
         | 
| 64 | 
            -
                <%= link_to Spree.t(:add_one), spree.new_admin_recurring_plan_path(@recurring) %>!
         | 
| 50 | 
            +
                <%= link_to Spree.t(:add_one), spree.new_admin_recurring_plan_path(@recurring) if can? :create, Spree::Plan %>!
         | 
| 65 51 | 
             
              </div>
         | 
| 66 52 | 
             
            <% end %>
         | 
| 67 53 |  | 
| @@ -1,13 +1,11 @@ | |
| 1 | 
            -
            <%= render :partial => 'spree/admin/shared/ | 
| 1 | 
            +
            <%= render :partial => 'spree/admin/shared/sub_menu/configuration' %>
         | 
| 2 2 |  | 
| 3 3 | 
             
            <% content_for :page_title do %>
         | 
| 4 4 | 
             
              <%= Spree.t(:new_plan) %>
         | 
| 5 5 | 
             
            <% end %>
         | 
| 6 6 |  | 
| 7 7 | 
             
            <% content_for :page_actions do %>
         | 
| 8 | 
            -
               | 
| 9 | 
            -
                <%= button_link_to Spree.t(:back_to_plans_list), admin_recurring_plans_path(@recurring), :icon => 'icon-arrow-left' %>
         | 
| 10 | 
            -
              </li>  
         | 
| 8 | 
            +
              <%= button_link_to Spree.t(:back_to_plans_list), admin_recurring_plans_path(@recurring), :icon => 'arrow-left' %>
         | 
| 11 9 | 
             
            <% end %>
         | 
| 12 10 |  | 
| 13 11 | 
             
            <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @plan } %>
         | 
| @@ -15,8 +13,8 @@ | |
| 15 13 | 
             
            <%= form_for @plan, :url => admin_recurring_plans_path(@recurring) do |f| %>
         | 
| 16 14 | 
             
              <fieldset class="no-border-top">
         | 
| 17 15 | 
             
                <%= render :partial => 'form', :locals => { :f => f } %>
         | 
| 18 | 
            -
                <div data-hook="buttons" class=" | 
| 19 | 
            -
                  <%= button Spree.t(:create), ' | 
| 16 | 
            +
                <div data-hook="buttons" class="form-actions">
         | 
| 17 | 
            +
                  <%= button Spree.t(:create), 'ok', {class: 'btn-success'} %>
         | 
| 20 18 | 
             
                </div>
         | 
| 21 19 | 
             
              </fieldset>
         | 
| 22 20 | 
             
            <% end %>
         | 
| @@ -1,11 +1,11 @@ | |
| 1 1 | 
             
            <div data-hook="admin_recurring_form_fields">
         | 
| 2 2 |  | 
| 3 | 
            -
              <div data-hook="recurring">
         | 
| 3 | 
            +
              <div data-hook="recurring" class="row">
         | 
| 4 4 |  | 
| 5 | 
            -
                <div class=" | 
| 6 | 
            -
                  <div id="preference-settings" data-hook class=" | 
| 5 | 
            +
                <div class="col-md-4">
         | 
| 6 | 
            +
                  <div id="preference-settings" data-hook class="form-group">
         | 
| 7 7 | 
             
                    <%= label_tag nil, Spree.t(:provider) %>
         | 
| 8 | 
            -
                    <%= select(:recurring, :type, Rails.application.config.spree.recurring_providers.collect {|pro| [pro.display_name, pro]}, {}, {disabled: !@recurring.new_record?, class: 'select2 | 
| 8 | 
            +
                    <%= select(:recurring, :type, Rails.application.config.spree.recurring_providers.collect {|pro| [pro.display_name, pro]}, {}, {disabled: !@recurring.new_record?, class: 'select2'}) %>
         | 
| 9 9 |  | 
| 10 10 | 
             
                    <% unless @recurring.new_record? %>
         | 
| 11 11 | 
             
                      <%= preference_fields(@recurring, f) %>
         | 
| @@ -15,28 +15,34 @@ | |
| 15 15 | 
             
                      <% end %>
         | 
| 16 16 | 
             
                    <% end %>
         | 
| 17 17 | 
             
                  </div>      
         | 
| 18 | 
            -
                  <div data-hook="active" class=" | 
| 19 | 
            -
                    < | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
                        <%=  | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 18 | 
            +
                  <div data-hook="active" class="form-group">
         | 
| 19 | 
            +
                    <strong><%= Spree.t(:active) %></strong>
         | 
| 20 | 
            +
                    <div class="radio">
         | 
| 21 | 
            +
                      <%= label_tag :recurring_active_true do %>
         | 
| 22 | 
            +
                        <%= radio_button :recurring, :active, true %>
         | 
| 23 | 
            +
                        <%= Spree.t(:say_yes) %>
         | 
| 24 | 
            +
                      <% end %>
         | 
| 25 | 
            +
                    </div>
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                    <div class="radio">
         | 
| 28 | 
            +
                      <%= label_tag :recurring_active_false do %>
         | 
| 29 | 
            +
                        <%= radio_button :recurring, :active, false %>
         | 
| 30 | 
            +
                        <%= Spree.t(:say_no) %>
         | 
| 31 | 
            +
                      <% end %>
         | 
| 32 | 
            +
                    </div>
         | 
| 25 33 | 
             
                  </div>
         | 
| 26 34 | 
             
                </div>
         | 
| 27 35 |  | 
| 28 | 
            -
                <div class=" | 
| 29 | 
            -
                  <div data-hook="name" class=" | 
| 36 | 
            +
                <div class="col-md-8">
         | 
| 37 | 
            +
                  <div data-hook="name" class="form-group">
         | 
| 30 38 | 
             
                    <%= label_tag nil, Spree.t(:name) %>
         | 
| 31 | 
            -
                    <%= text_field :recurring, :name, :class => ' | 
| 39 | 
            +
                    <%= text_field :recurring, :name, :class => 'form-control' %>
         | 
| 32 40 | 
             
                  </div>
         | 
| 33 | 
            -
                  <div data-hook="description" class=" | 
| 41 | 
            +
                  <div data-hook="description" class="form-group">
         | 
| 34 42 | 
             
                    <%= label_tag nil, Spree.t(:description) %>
         | 
| 35 | 
            -
                    <%= text_area :recurring, :description, {:cols => 60, :rows => 6, :class => ' | 
| 43 | 
            +
                    <%= text_area :recurring, :description, {:cols => 60, :rows => 6, :class => 'form-control'} %>
         | 
| 36 44 | 
             
                  </div>  
         | 
| 37 45 | 
             
                </div>
         | 
| 38 46 |  | 
| 39 47 | 
             
              </div>
         | 
| 40 48 | 
             
            </div>
         | 
| 41 | 
            -
             | 
| 42 | 
            -
            <div class="clear"></div>
         | 
| @@ -1,25 +1,23 @@ | |
| 1 | 
            -
            <%= render :partial => 'spree/admin/shared/ | 
| 1 | 
            +
            <%= render :partial => 'spree/admin/shared/sub_menu/configuration' %>
         | 
| 2 2 |  | 
| 3 3 | 
             
            <% content_for :page_title do %>
         | 
| 4 4 | 
             
              <%= Spree.t(:editing_recurring) %> <i class="icon-arrow-right"></i> <%= @recurring.name %>
         | 
| 5 5 | 
             
            <% end %>
         | 
| 6 6 |  | 
| 7 7 | 
             
            <% content_for :page_actions do %>
         | 
| 8 | 
            -
               | 
| 9 | 
            -
                <%= button_link_to Spree.t(:back_to_recurrings_list), spree.admin_recurrings_path, :icon => 'icon-arrow-left' %>
         | 
| 10 | 
            -
              </li>  
         | 
| 8 | 
            +
              <%= button_link_to Spree.t(:back_to_recurrings_list), spree.admin_recurrings_path, :icon => 'arrow-left' %>
         | 
| 11 9 | 
             
            <% end %>
         | 
| 12 10 |  | 
| 13 11 | 
             
            <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @recurring } %>
         | 
| 14 12 |  | 
| 15 13 | 
             
            <%= form_for @recurring, :url => admin_recurring_path(@recurring) do |f| %>
         | 
| 16 | 
            -
              <fieldset | 
| 14 | 
            +
              <fieldset>
         | 
| 17 15 | 
             
                <%= render :partial => 'form', :locals => { :f => f } %>
         | 
| 18 | 
            -
                <div data-hook="buttons" class=" | 
| 16 | 
            +
                <div data-hook="buttons" class="actions">
         | 
| 19 17 | 
             
                  <% if @recurring.has_preferred_keys? %>
         | 
| 20 18 | 
             
                    <%= button_link_to Spree.t(:manage_plans), admin_recurring_plans_url(@recurring) %>
         | 
| 21 19 | 
             
                  <% end %>
         | 
| 22 | 
            -
                  <%= button Spree.t('actions.update'), ' | 
| 20 | 
            +
                  <%= button Spree.t('actions.update'), 'refresh' %>
         | 
| 23 21 | 
             
                </div>
         | 
| 24 22 | 
             
              </fieldset>
         | 
| 25 23 | 
             
            <% end %>
         | 
| @@ -1,38 +1,30 @@ | |
| 1 | 
            -
            <%= render 'spree/admin/shared/ | 
| 1 | 
            +
            <%= render 'spree/admin/shared/sub_menu/configuration' %>
         | 
| 2 2 |  | 
| 3 3 | 
             
            <% content_for :page_title do %>
         | 
| 4 4 | 
             
              <%= Spree.t(:recurring) %>
         | 
| 5 5 | 
             
            <% end %>
         | 
| 6 6 |  | 
| 7 7 | 
             
            <% content_for :page_actions do %>
         | 
| 8 | 
            -
               | 
| 9 | 
            -
             | 
| 10 | 
            -
              </li>
         | 
| 11 | 
            -
            <% end %>
         | 
| 8 | 
            +
              <%= button_link_to Spree.t(:new_recurring), new_admin_recurring_url, :icon => 'plus', class: "btn-success", :id => 'admin_new_recurring_link' %>
         | 
| 9 | 
            +
            <% end if can? :create, Spree::Recurring %>
         | 
| 12 10 |  | 
| 13 11 | 
             
            <% if @recurrings.any? %>
         | 
| 14 | 
            -
              <table class=" | 
| 15 | 
            -
                <colgroup>
         | 
| 16 | 
            -
                  <col style="width: 30%">
         | 
| 17 | 
            -
                  <col style="width: 25%">
         | 
| 18 | 
            -
                  <col style="width: 25%">
         | 
| 19 | 
            -
                  <col style="width: 20%">
         | 
| 20 | 
            -
                </colgroup>
         | 
| 12 | 
            +
              <table class="table" id='listing_recurrings'>
         | 
| 21 13 | 
             
                <thead>
         | 
| 22 14 | 
             
                  <tr data-hook="admin_payment_methods_index_headers">
         | 
| 23 15 | 
             
                    <th><%= Spree.t(:name) %></th>
         | 
| 24 16 | 
             
                    <th><%= Spree.t(:provider) %></th>
         | 
| 25 17 | 
             
                    <th><%= Spree.t(:active) %></th>
         | 
| 26 | 
            -
                    <th data-hook="admin_payment_methods_index_header_actions" class="actions"></th>
         | 
| 18 | 
            +
                    <th data-hook="admin_payment_methods_index_header_actions" class="actions actions-2 text-right"></th>
         | 
| 27 19 | 
             
                  </tr>
         | 
| 28 20 | 
             
                </thead>
         | 
| 29 21 | 
             
                <tbody>
         | 
| 30 22 | 
             
                  <% @recurrings.each do |recurring|%>
         | 
| 31 23 | 
             
                    <tr id="<%= spree_dom_id recurring %>" data-hook="admin_recurrings_index_rows" class="<%= cycle('odd', 'even')%>">
         | 
| 32 | 
            -
                      <td | 
| 33 | 
            -
                      <td | 
| 34 | 
            -
                      <td | 
| 35 | 
            -
                      <td data-hook="admin_recurrings_index_row_actions" class="actions">
         | 
| 24 | 
            +
                      <td><%= recurring.name %></td>
         | 
| 25 | 
            +
                      <td><%= recurring.class.display_name %></td>
         | 
| 26 | 
            +
                      <td><%= recurring.active ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
         | 
| 27 | 
            +
                      <td data-hook="admin_recurrings_index_row_actions" class="actions actions-2 text-right">
         | 
| 36 28 | 
             
                        <%= link_to_edit_url edit_admin_recurring_url(recurring), :no_text => true %>
         | 
| 37 29 | 
             
                        <%= link_to_delete recurring, url: admin_recurring_url(recurring), :no_text => true  %>
         | 
| 38 30 | 
             
                      </td>
         | 
| @@ -41,8 +33,8 @@ | |
| 41 33 | 
             
                </tbody>
         | 
| 42 34 | 
             
              </table>
         | 
| 43 35 | 
             
            <% else %>
         | 
| 44 | 
            -
              <div class=" | 
| 36 | 
            +
              <div class="alert alert-info no-objects-found">
         | 
| 45 37 | 
             
                <%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/recurring')) %>,
         | 
| 46 | 
            -
                <%= link_to Spree.t(:add_one), spree.new_admin_recurring_url %>!
         | 
| 38 | 
            +
                <%= link_to Spree.t(:add_one), spree.new_admin_recurring_url if can? :create, Spree::Recurring %>!
         | 
| 47 39 | 
             
              </div>
         | 
| 48 40 | 
             
            <% end %>
         | 
| @@ -1,13 +1,11 @@ | |
| 1 | 
            -
            <%= render :partial => 'spree/admin/shared/ | 
| 1 | 
            +
            <%= render :partial => 'spree/admin/shared/sub_menu/configuration' %>
         | 
| 2 2 |  | 
| 3 3 | 
             
            <% content_for :page_title do %>
         | 
| 4 4 | 
             
              <%= Spree.t(:new_recurring) %>
         | 
| 5 5 | 
             
            <% end %>
         | 
| 6 6 |  | 
| 7 7 | 
             
            <% content_for :page_actions do %>
         | 
| 8 | 
            -
               | 
| 9 | 
            -
                <%= button_link_to Spree.t(:back_to_recurrings_list), admin_recurrings_url, :icon => 'icon-arrow-left' %>
         | 
| 10 | 
            -
              </li>  
         | 
| 8 | 
            +
              <%= button_link_to Spree.t(:back_to_recurrings_list), admin_recurrings_url, :icon => 'arrow-left' %>
         | 
| 11 9 | 
             
            <% end %>
         | 
| 12 10 |  | 
| 13 11 | 
             
            <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @recurring } %>
         | 
| @@ -15,8 +13,8 @@ | |
| 15 13 | 
             
            <%= form_for @recurring, :url => admin_recurrings_url do |f| %>
         | 
| 16 14 | 
             
              <fieldset class="no-border-top">
         | 
| 17 15 | 
             
                <%= render :partial => 'form', :locals => { :f => f } %>
         | 
| 18 | 
            -
                <div data-hook="buttons" class=" | 
| 19 | 
            -
                  <%= button Spree.t(:create), ' | 
| 16 | 
            +
                <div data-hook="buttons" class="form-actions">
         | 
| 17 | 
            +
                  <%= button Spree.t(:create), 'ok', {class: 'btn-success'} %>
         | 
| 20 18 | 
             
                </div>
         | 
| 21 19 | 
             
              </fieldset>
         | 
| 22 20 | 
             
            <% end %>
         | 
| @@ -3,46 +3,40 @@ | |
| 3 3 | 
             
            <% end %>
         | 
| 4 4 |  | 
| 5 5 | 
             
            <% content_for :page_actions do %>
         | 
| 6 | 
            -
               | 
| 6 | 
            +
              <%= link_to_with_icon 'arrow-left', Spree.t(:back_to_reports_list), spree.admin_reports_url, :class => 'btn btn-default' %>
         | 
| 7 7 | 
             
            <% end %>
         | 
| 8 8 |  | 
| 9 9 | 
             
            <% content_for :table_filter_title do %>
         | 
| 10 10 | 
             
              <%= Spree.t(:subscription_event_search) %>
         | 
| 11 11 | 
             
            <% end %>
         | 
| 12 12 |  | 
| 13 | 
            -
             | 
| 13 | 
            +
            <div class="well">
         | 
| 14 14 | 
             
              <%= search_form_for @search, :url => spree.admin_subscription_events_url  do |s| %>
         | 
| 15 | 
            -
                <div class="date-range-filter  | 
| 16 | 
            -
                  <%= label_tag nil, Spree.t(: | 
| 17 | 
            -
                   | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
                     | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
             | 
| 24 | 
            -
                   | 
| 15 | 
            +
                <div class="date-range-filter form-group">
         | 
| 16 | 
            +
                  <%= label_tag nil, Spree.t(:date_range) %>
         | 
| 17 | 
            +
                  <div class="date-range-filter row">
         | 
| 18 | 
            +
                    <div class="col-md-6">
         | 
| 19 | 
            +
                      <%= s.text_field :created_at_gt, :class => 'datepicker datepicker-from form-control', :value => datepicker_field_value(params[:q][:created_at_gt]) %>
         | 
| 20 | 
            +
                    </div>
         | 
| 21 | 
            +
                    <div class="col-md-6">
         | 
| 22 | 
            +
                      <%= s.text_field :created_at_lt, :class => 'datepicker datepicker-to form-control', :value => datepicker_field_value(params[:q][:created_at_lt]) %>
         | 
| 23 | 
            +
                    </div>
         | 
| 24 | 
            +
                  </div>
         | 
| 25 25 | 
             
                </div>
         | 
| 26 26 |  | 
| 27 | 
            -
                <div class="date-range-filter  | 
| 28 | 
            -
                  <%= label_tag nil, Spree.t(:email) | 
| 29 | 
            -
                  <%= s.text_field :subscription_email_eq,  | 
| 27 | 
            +
                <div class="date-range-filter form-group">
         | 
| 28 | 
            +
                  <%= label_tag nil, Spree.t(:email) %>
         | 
| 29 | 
            +
                  <%= s.text_field :subscription_email_eq, class: "form-control" %>
         | 
| 30 30 | 
             
                </div>
         | 
| 31 31 |  | 
| 32 | 
            -
                <div class=" | 
| 33 | 
            -
                  <%= button Spree.t(:search), ' | 
| 32 | 
            +
                <div class="form-actions">
         | 
| 33 | 
            +
                  <%= button Spree.t(:search), 'search'  %>
         | 
| 34 34 | 
             
                </div>
         | 
| 35 35 | 
             
              <% end %>
         | 
| 36 | 
            -
             | 
| 36 | 
            +
            </div>
         | 
| 37 37 |  | 
| 38 38 | 
             
            <% if @subscription_events.any? %>
         | 
| 39 | 
            -
              <table class=" | 
| 40 | 
            -
                <colgroup>
         | 
| 41 | 
            -
                  <col style="width: 30%">
         | 
| 42 | 
            -
                  <col style="width: 25%">
         | 
| 43 | 
            -
                  <col style="width: 25%">
         | 
| 44 | 
            -
                  <col style="width: 20%">
         | 
| 45 | 
            -
                </colgroup>
         | 
| 39 | 
            +
              <table class="table table-bordered admin-report" id='listing_subscription_events'>
         | 
| 46 40 | 
             
                <thead>
         | 
| 47 41 | 
             
                  <tr data-hook="admin_subscription_events_index_headers">
         | 
| 48 42 | 
             
                    <th><%= Spree.t(:email) %></th>
         | 
| @@ -55,10 +49,10 @@ | |
| 55 49 | 
             
                  <% @subscription_events.each do |subscription_event|%>
         | 
| 56 50 | 
             
                    <% plan = subscription_event.subscription.plan %>
         | 
| 57 51 | 
             
                    <tr data-hook="admin_subscription_events_index_rows" class="<%= cycle('odd', 'even')%>">
         | 
| 58 | 
            -
                      <td | 
| 59 | 
            -
                      <td | 
| 60 | 
            -
                      <td | 
| 61 | 
            -
                      <td | 
| 52 | 
            +
                      <td><%= subscription_event.subscription.email %></td>
         | 
| 53 | 
            +
                      <td><%= link_to plan.api_plan_id, edit_admin_recurring_plan_url(plan.recurring, plan) %></td>
         | 
| 54 | 
            +
                      <td><%= subscription_event.request_type %></td>
         | 
| 55 | 
            +
                      <td><%= subscription_event.created_at.try(:strftime, '%d-%h-%Y') %></td>
         | 
| 62 56 | 
             
                    </tr>
         | 
| 63 57 | 
             
                  <% end %>
         | 
| 64 58 | 
             
                </tbody>
         | 
| @@ -66,7 +60,7 @@ | |
| 66 60 |  | 
| 67 61 | 
             
              <%= paginate @subscription_events %>
         | 
| 68 62 | 
             
            <% else %>
         | 
| 69 | 
            -
              <div class=" | 
| 63 | 
            +
              <div class="col-md-12 no-objects-found alert alert-info">
         | 
| 70 64 | 
             
                <%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/subscription_event')) %>
         | 
| 71 65 | 
             
              </div>
         | 
| 72 66 | 
             
            <% end %>
         | 
| @@ -3,47 +3,40 @@ | |
| 3 3 | 
             
            <% end %>
         | 
| 4 4 |  | 
| 5 5 | 
             
            <% content_for :page_actions do %>
         | 
| 6 | 
            -
               | 
| 6 | 
            +
              <%= link_to_with_icon 'arrow-left', Spree.t(:back_to_reports_list), spree.admin_reports_url, :class => 'btn btn-default' %>
         | 
| 7 7 | 
             
            <% end %>
         | 
| 8 8 |  | 
| 9 9 | 
             
            <% content_for :table_filter_title do %>
         | 
| 10 10 | 
             
              <%= Spree.t(:subscription_date_search) %>
         | 
| 11 11 | 
             
            <% end %>
         | 
| 12 12 |  | 
| 13 | 
            -
             | 
| 13 | 
            +
            <div class="well">
         | 
| 14 14 | 
             
              <%= search_form_for @search, :url => spree.admin_subscriptions_url  do |s| %>
         | 
| 15 | 
            -
                <div class="date-range-filter  | 
| 16 | 
            -
                  <%= label_tag nil, Spree.t(: | 
| 17 | 
            -
                   | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
                     | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
             | 
| 24 | 
            -
                   | 
| 15 | 
            +
                <div class="date-range-filter form-group">
         | 
| 16 | 
            +
                  <%= label_tag nil, Spree.t(:date_range) %>
         | 
| 17 | 
            +
                  <div class="date-range-filter row">
         | 
| 18 | 
            +
                    <div class="col-md-6">
         | 
| 19 | 
            +
                      <%= s.text_field :subscribed_at_gt, :class => 'datepicker datepicker-from form-control', :value => datepicker_field_value(params[:q][:subscribed_at_gt]) %>
         | 
| 20 | 
            +
                    </div>
         | 
| 21 | 
            +
                    <div class="col-md-6">
         | 
| 22 | 
            +
                      <%= s.text_field :subscribed_at_lt, :class => 'datepicker datepicker-to form-control', :value => datepicker_field_value(params[:q][:subscribed_at_lt]) %>
         | 
| 23 | 
            +
                    </div>
         | 
| 24 | 
            +
                  </div>
         | 
| 25 25 | 
             
                </div>
         | 
| 26 26 |  | 
| 27 | 
            -
                <div class="date-range-filter  | 
| 28 | 
            -
                  <%= label_tag nil, Spree.t(:email) | 
| 29 | 
            -
                  <%= s.text_field :email_eq,  | 
| 27 | 
            +
                <div class="date-range-filter form-group">
         | 
| 28 | 
            +
                  <%= label_tag nil, Spree.t(:email) %>
         | 
| 29 | 
            +
                  <%= s.text_field :email_eq, class: "form-control" %>
         | 
| 30 30 | 
             
                </div>
         | 
| 31 31 |  | 
| 32 | 
            -
                <div class=" | 
| 33 | 
            -
                  <%= button Spree.t(:search), ' | 
| 32 | 
            +
                <div class="form-actions">
         | 
| 33 | 
            +
                  <%= button Spree.t(:search), 'search'  %>
         | 
| 34 34 | 
             
                </div>
         | 
| 35 35 | 
             
              <% end %>
         | 
| 36 | 
            -
             | 
| 36 | 
            +
            </div>
         | 
| 37 37 |  | 
| 38 38 | 
             
            <% if @subscriptions.any? %>
         | 
| 39 | 
            -
              <table class=" | 
| 40 | 
            -
                <colgroup>
         | 
| 41 | 
            -
                  <col style="width: 30%">
         | 
| 42 | 
            -
                  <col style="width: 20%">
         | 
| 43 | 
            -
                  <col style="width: 15%">
         | 
| 44 | 
            -
                  <col style="width: 15%">
         | 
| 45 | 
            -
                  <col style="width: 20%">
         | 
| 46 | 
            -
                </colgroup>
         | 
| 39 | 
            +
              <table class="table table-bordered admin-report" id='listing_subscriptions'>
         | 
| 47 40 | 
             
                <thead>
         | 
| 48 41 | 
             
                  <tr data-hook="admin_subscriptions_index_headers">
         | 
| 49 42 | 
             
                    <th><%= Spree.t(:email) %></th>
         | 
| @@ -56,10 +49,10 @@ | |
| 56 49 | 
             
                <tbody>
         | 
| 57 50 | 
             
                  <% @subscriptions.each do |subscription|%>
         | 
| 58 51 | 
             
                    <tr data-hook="admin_subscriptions_index_rows" class="<%= cycle('odd', 'even')%>">
         | 
| 59 | 
            -
                      <td | 
| 60 | 
            -
                      <td | 
| 61 | 
            -
                      <td | 
| 62 | 
            -
                      <td | 
| 52 | 
            +
                      <td><%= subscription.email %></td>
         | 
| 53 | 
            +
                      <td><%= link_to subscription.plan.api_plan_id, edit_admin_recurring_plan_url(subscription.plan.recurring, subscription.plan) %></td>
         | 
| 54 | 
            +
                      <td><%= subscription.subscribed_at.try(:strftime, '%d-%h-%Y') %></td>
         | 
| 55 | 
            +
                      <td><%= subscription.unsubscribed_at.try(:strftime, '%d-%h-%Y') || 'N/A' %></td>
         | 
| 63 56 | 
             
                      <td data-hook="admin_recurring_plans_index_row_actions" class="actions">
         | 
| 64 57 | 
             
                        <%= link_to Spree.t(:view_events), admin_subscription_events_url(q: {subscription_email_eq: subscription.email}) %>
         | 
| 65 58 | 
             
                      </td>
         | 
| @@ -70,7 +63,7 @@ | |
| 70 63 |  | 
| 71 64 | 
             
              <%= paginate @subscriptions %>
         | 
| 72 65 | 
             
            <% else %>
         | 
| 73 | 
            -
              <div class=" | 
| 66 | 
            +
              <div class="col-md-12 no-objects-found alert alert-info">
         | 
| 74 67 | 
             
                <%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/subscription')) %>
         | 
| 75 68 | 
             
              </div>
         | 
| 76 69 | 
             
            <% end %>
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: spree_account_recurring
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version:  | 
| 4 | 
            +
              version: 2.0.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Priyank Gupta
         | 
| @@ -16,14 +16,14 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - "~>"
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version:  | 
| 19 | 
            +
                    version: 3.0.0
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 24 | 
             
                - - "~>"
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version:  | 
| 26 | 
            +
                    version: 3.0.0
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: stripe
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -148,7 +148,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 148 148 | 
             
              requirements:
         | 
| 149 149 | 
             
              - - ">="
         | 
| 150 150 | 
             
                - !ruby/object:Gem::Version
         | 
| 151 | 
            -
                  version:  | 
| 151 | 
            +
                  version: 2.0.0
         | 
| 152 152 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 153 153 | 
             
              requirements:
         | 
| 154 154 | 
             
              - - ">="
         |