- content_for :title do I18n.t("iugu.profile_settings") end %h1 Perfil - if current_user.guest = simple_form_for @user, :url => become_user_path, :method => :post do |f| = render partial: "iugu/shared/notices", role: "form", locals: { group: :profile_update, resource: @user } .form-group = f.email_field :email, input_html: { class: "form-control" } .form-group = f.password_field :password, input_html: { class: "form-control" } .form-group = f.password_field :password_confirmation, input_html: { class: "form-control" } = f.submit I18n.t("iugu.become_user"), input_html: { class: "btn btn-lg btn-block btn-default" } - 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 } .row - if AvailableLanguage.all.count > 1 .col-md-4 .form-group = f.select :locale, AvailableLanguage.all, {}, :class => "form-control" .col-md-8 .form-group{ class: "form-group #{@user.errors.include?(:name) ? 'has-error':@input_success}" } = f.text_field :name, :placeholder => I18n.t("activerecord.attributes.name"), class: "form-control" .row .col-md-4 .form-group{ class: "form-group #{@user.errors.include?(:birthplace) ? 'has-error':@input_success}" } = f.input :birthdate, as: :string, label: false, :placeholder => I18n.t("activerecord.attributes.birthdate"), input_html: { class: "form-control", type: "date" } .col-md-8 .form-group{ class: "form-group #{@user.errors.include?(:email) ? 'has-error':@input_success}" } = f.email_field :email, :placeholder => "E-mail", class: "form-control" = f.submit I18n.t("iugu.save"), :class => "btn-block btn btn-lg btn-primary" = simple_form_for @user, :url => profile_update_path + "#password", role: "form", :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 } .row .col-md-6 .form-group{ class: "form-group #{@user.errors.include?(:password) ? 'has-error':@input_success}" } = f.password_field :password, :placeholder => I18n.t("activerecord.attributes.password"), class: "form-control" .col-md-6 .form-group{ class: "form-group #{@user.errors.include?(:password) ? 'has-error':@input_success}" } = f.password_field :password_confirmation, :placeholder => I18n.t("activerecord.attributes.password_confirmation"), class: "form-control" = hidden_field_tag "form_group", :password = f.submit I18n.t("iugu.save"), :id => "new_password_submit", :class => "btn btn-lg btn-primary btn-block" - 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 } .panel.panel-default %div{ class: "panel-body", style: "text-align: center;" } = @user.token.token = link_to I18n.t("iugu.api_renew"), renew_user_token_path + "#api", :class => "btn btn-lg btn-primary btn-block" - 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"