This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::User.class_eval do | |
scope :distributor, -> { includes(:spree_roles).where("#{Role.table_name}.name" => "distributor") } | |
def distributor? | |
has_spree_role?('distributor') | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Spree::DistributorRegistrationsController < Devise::RegistrationsController | |
helper 'spree/base', 'spree/store' | |
if Spree::Auth::Engine.dash_available? | |
helper 'spree/analytics' | |
end | |
include Spree::Core::ControllerHelpers::Auth | |
include Spree::Core::ControllerHelpers::Common | |
include Spree::Core::ControllerHelpers::Order |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% @body_id = 'signup' %> | |
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %> | |
<div class="col-md-6 col-md-offset-3"> | |
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<h3 class="panel-title"><%= Spree.t(:new_distributor) %></h3> | |
</div> | |
<div id="new-customer" class="panel-body" data-hook="login"> | |
<%= form_for resource, :as => :spree_user, :url => "/afiliarse" do |f| %> |
OlderNewer