- content_for :title do I18n.t("iugu.profile_settings") end - if current_user.guest = simple_form_for @user, :url => become_user_path, :method => :post do |f| = render partial: "iugu/shared/notices", locals: { group: :profile_update, resource: @user } %div = f.label :email = f.email_field :email %div = f.label :password, I18n.t("activerecord.attributes.password") = f.password_field :password %div = f.label :password_confirmation, I18n.t("activerecord.attributes.password_confirmation") = f.password_field :password_confirmation %div = f.submit I18n.t("iugu.become_user") - else = simple_form_for @user, :url => profile_update_path, :method => :post, :html => { :class => "no-bottom-margin" } do |f| // I18n.locale - @input_success = '' = render partial: "iugu/shared/notices", locals: { group: :profile_update, resource: @user } = f.text_field :name, :placeholder => I18n.t("activerecord.attributes.name"), :class => "full-width string #{@user.errors.include?(:name) ? 'failure':@input_success }" = f.email_field :email, :placeholder => "E-mail", :class => "full-width string #{@user.errors.include?(:email) ? 'failure':@input_success }" %div = f.text_field :birthdate, :placeholder => I18n.t("activerecord.attributes.birthdate"), :class => "full-width string #{@user.errors.include?(:birthdate) ? 'failure':@input_success }" - if AvailableLanguage.all.count > 1 %div = f.input :locale, :collection => AvailableLanguage.all, :label => false, :include_blank => false, :input_html => { :"data-type" => "iux.form.combobox", :class => "full-width" } %div = f.submit I18n.t("iugu.save"), :class => "button default" - if IuguSDK::enable_signup_form = simple_form_for @user, :url => profile_update_path + "#password", :method => :post do |f| .element-spacing %h3.no-bottom-margin = I18n.t "activerecord.attributes.password" - @input_success = '' = render partial: "iugu/shared/notices", locals: { group: :password, resource: @user } = f.password_field :password, :placeholder => I18n.t("activerecord.attributes.password"), :class => "full-width string #{@user.errors.include?(:password) ? 'failure':@input_success }" = f.password_field :password_confirmation, :placeholder => I18n.t("activerecord.attributes.password_confirmation"), :class => "full-width string #{@user.errors.include?(:password) ? 'failure':@input_success }" = hidden_field_tag "form_group", :password = f.submit I18n.t("iugu.save"), :id => "new_password_submit", :class => "button no-bottom-margin" - if IuguSDK::enable_social_linking %div %h3 = I18n.t "iugu.social_account" = render partial: "iugu/shared/notices", locals: { group: :social } .element-spacing .social %table - SOCIAL_ACCOUNTS.keys.each do |provider| %tr %td %span = provider.capitalize %td - social_account = @social_accounts.where(:provider => provider).first - unless social_account %a.button.default.no-bottom-margin{ :href => user_omniauth_authorize_path(provider) + "?origin=#{profile_settings_path}"} = I18n.t "iugu.link_social" - else = link_to I18n.t("iugu.unlink_social"), social_destroy_path(:id => social_account.id) + "#social", :class => "button warning no-bottom-margin" - if IuguSDK::enable_user_api %h3 = I18n.t("iugu.user_api_access") = render partial: "iugu/shared/notices", locals: { group: :api } .container %div{ :style => 'text-align:center' } = @user.token.token = link_to I18n.t("iugu.api_renew"), renew_user_token_path + "#api", :class => "button no-bottom-margin" - if IuguSDK::enable_user_cancel %hr .container.no-bottom-margin{ :style => "background-color:#FFF5F5" } = render partial: "iugu/shared/notices", locals: { group: :remove_user } - if @user.destroying? .element-spacing = I18n.t("iugu.user_destruction_in") %div %strong = I18n.l( @user.destruction_job.run_at, :format => :default ) - unless @user.destruction_job.locked_at = link_to I18n.t("iugu.undo"), profile_cancel_destruction_path + "#remove_user", :confirm => I18n.t("iugu.are_you_sure?"), :class => "button warning no-bottom-margin" - else %h3 = I18n.t("iugu.remove_user") %p = I18n.t("iugu.remove_user_warning") = link_to I18n.t("iugu.remove_user"), profile_destroy_path + "#remove_user", :confirm => I18n.t("iugu.are_you_sure?"), :class => "button warning no-bottom-margin"