<% content_for :page_title do %> <%= link_to "#{Spree.t(:editing_affiliate)} #{@affiliate.name}", edit_admin_affiliate_url(@affiliate) %> <% end %> <% content_for :page_actions do %>
  • <%= button_link_to Spree.t(:back_to_affiliates_list), spree.admin_affiliates_path, :icon => 'arrow-left' %>
  • <% end %>
    <%= Spree.t(:general_settings) %>
    <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @affiliate } %>
    <%= form_for [:admin, @affiliate], as: :affiliate, url: admin_affiliate_url(@affiliate), method: :put do |f| %> <%= render :partial => 'form', :locals => { :f => f } %>
    <%= render :partial => 'spree/admin/shared/edit_resource_links', :locals => { :collection_url => admin_affiliates_url } %>
    <% end %>
    <%= Spree.t(:statistics) %> <% if @affiliate.partial.blank? or !affiliate_partial_exists?(@affiliate.partial) %> <% elsif affiliate_partial_exists?(@affiliate.partial) %> <% end %>
    Affiliate hyperlink <%= text_field_tag nil, affiliate_url(@affiliate.path), onclick: 'this.select();' %>
    Partial StatusNot foundFound
    Referred users count <%= @affiliate.referred_count %>
    Referred orders count <%= @affiliate.referred_orders.count %>
    Orders referred <%= "No referred orders" if @affiliate.referred_orders.count == 0 %>
      <% @affiliate.referred_orders.each do |user| %>
    1. <%= link_to user.email, edit_admin_user_url(user) %>
    2. <% end %>
    Users referred <%= "No referred users" if @affiliate.referred_count == 0 %>
      <% @affiliate.referred_users.each do |user| %>
    1. <%= link_to user.email, edit_admin_user_url(user) %>
    2. <% end %>