<% content_for :page_title do %> <%= Spree.t(:loyalty_points) %> <% end %> <% content_for :page_actions do %>
  • <%= button_link_to Spree.t(:back_to_users_list), admin_users_path, :icon => 'icon-arrow-left' %>
  • <% end %> <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @loyalty_points_transaction.user } %> <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @loyalty_points_transaction } %>
    <%= form_for @loyalty_points_transaction, as: :loyalty_points_transaction, url: admin_user_loyalty_points_path(@user) do |f| %>
    <%= Spree.t(:update_loyalty_points) %>
    <%= f.field_container :loyalty_points do %> <%= f.label :loyalty_points, Spree.t(:loyalty_points) %> *
    <%= f.text_field :loyalty_points, :class => 'fullwidth title' %> <%= f.error_message_on :loyalty_points %> <% end %>
    <%= f.label :type, Spree.t(:transaction_type) %> *
    <%= f.select :type, options_for_select(Spree::LoyaltyPointsTransaction::CLASS_TO_TRANSACTION_TYPE.invert), {}, :class => 'select2 fullwidth' %> <%= f.error_message_on :type %>
    <%= label_tag nil, Spree.t(:order) %> <%= f.select :source_id, @user.orders.collect {|o| [o.number, o.id]}, {:include_blank => true}, :class => 'select2 fullwidth', :"data-transactions-link" => admin_user_loyalty_points_path(@user) %> <%= f.hidden_field :source_type, { :value => 'Spree::Order' } %>
    <%= f.field_container :comment do %> <%= f.label :comment, Spree.t(:comment) %> *
    <%= f.text_area :comment, :class => 'fullwidth' %> <%= f.error_message_on :comment %> <% end %>
    <%= button Spree.t('actions.update'), 'icon-ok' %> <%= Spree.t(:or) %> <%= link_to_with_icon 'icon-remove', Spree.t('actions.cancel'), admin_users_path, :class => 'button' %>
    <% end %>