rokumatsumoto/boyutluseyler

View on GitHub
app/views/profiles/show.html.haml

Summary

Maintainability
Test Coverage
- content_for :head do
  = javascript_pack_tag 'profile/show'

-# .pl-lg-4 use padding left

= render 'layout' do
  .card-2.mt-4
    .card-header-2.bg-white
      .row.align-items-center
        .col-8
          -# TODO: i18n
          %h5.text-10625.font-weight-bold.mb-0 Profili Düzenle
    .card-body.pt-2
      .mt-2
        = render 'layouts/flash'
      = simple_form_for(@user, validate: true, url: profile_path,
      html: { method: :put }) do |f|
        -# TODO: i18n
        %h6.heading-small.text-muted.mb-4 Profil Resmi
        - if policy(:direct_upload).new?
          .js-avatar-uploader{ data: { behavior: 'vue' } }
            %avatar-uploader{ 'input-name' => 'user[avatar_url]', 'src' => @user.avatar_url,
              'direct-url' => Boyutluseyler.config[:direct_upload_endpoint],
              'uploader-url' => '/uploads/new?policy_name=user_avatar' }
        - else
          %p.description.font-weight-400.mt-3= t('pundit.errors.design.direct_upload')
        %hr.my-4
        %h6.heading-small.text-muted.mb-4 Kullanıcı Bilgisi
        .row
          .col-lg-6
            .form-group-2
              -# TODO: i18n
              %label.form-control-label Kullanıcı adı
              .username{ data: { behavior: 'vue' } }
                = f.input_field :username, required: true, validate: true,
                class: 'form-control', data_username: current_user.username
                .validation-error.hide= t('activerecord.errors.models.user.attributes.username.taken')
                .validation-success.hide= t('activerecord.errors.models.user.attributes.username.available')
                .validation-pending.hide= t('activerecord.errors.models.user.attributes.username.checking_availability')
                .validation-yours.hide= t('activerecord.errors.models.user.attributes.username.yours')
          .col-lg-6
            .form-group-2
              -# TODO: i18n
              %label.form-control-label E-posta
              = f.input_field :email, required: true, validate: true,
              class: 'form-control'
              - if devise_mapping.confirmable? && @user.pending_reconfirmation?
                %small= t('devise.registrations.edit.currently_waiting_confirmation_for_email',email: @user.unconfirmed_email)
        = f.button :submit, t('devise.registrations.edit.update'), class: 'btn btn-primary', id: 'btn_edit_profile'