show.html.haml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. - content_for :page_title do
  2. = t('settings.edit_profile')
  3. - content_for :heading do
  4. %h2= t('settings.profile')
  5. = render partial: 'settings/shared/profile_navigation'
  6. = simple_form_for @account, url: settings_profile_path, html: { method: :put, id: 'edit_profile' } do |f|
  7. = render 'shared/error_messages', object: @account
  8. %p.lead= t('edit_profile.hint_html')
  9. %h4= t('edit_profile.basic_information')
  10. .fields-row
  11. .fields-row__column.fields-row__column-6
  12. .fields-group
  13. = f.input :display_name, wrapper: :with_block_label, input_html: { maxlength: 30, data: { default: @account.username } }
  14. .fields-group
  15. = f.input :note, wrapper: :with_block_label, input_html: { maxlength: 500 }
  16. .fields-row__column.fields-group.fields-row__column-6
  17. .input.with_block_label
  18. %label= t('simple_form.labels.defaults.fields')
  19. %span.hint= t('simple_form.hints.account.fields')
  20. = f.simple_fields_for :fields do |fields_f|
  21. .row
  22. = fields_f.input :name, placeholder: t('simple_form.labels.account.fields.name'), input_html: { maxlength: 255 }
  23. = fields_f.input :value, placeholder: t('simple_form.labels.account.fields.value'), input_html: { maxlength: 255 }
  24. .fields-row
  25. .fields-row__column.fields-row__column-6
  26. .fields-group
  27. = f.input :avatar, wrapper: :with_block_label, input_html: { accept: AccountAvatar::IMAGE_MIME_TYPES.join(',') }, hint: t('simple_form.hints.defaults.avatar', dimensions: '400x400', size: number_to_human_size(AccountAvatar::LIMIT))
  28. .fields-row__column.fields-row__column-6
  29. .fields-group
  30. = image_tag @account.avatar.url, class: 'fields-group__thumbnail', id: 'account_avatar-preview'
  31. - if @account.avatar.present?
  32. = link_to settings_profile_picture_path('avatar'), data: { method: :delete }, class: 'link-button link-button--destructive' do
  33. = fa_icon 'trash fw'
  34. = t('generic.delete')
  35. .fields-row
  36. .fields-row__column.fields-row__column-6
  37. .fields-group
  38. = f.input :header, wrapper: :with_block_label, input_html: { accept: AccountHeader::IMAGE_MIME_TYPES.join(',') }, hint: t('simple_form.hints.defaults.header', dimensions: '1500x500', size: number_to_human_size(AccountHeader::LIMIT))
  39. .fields-row__column.fields-row__column-6
  40. .fields-group
  41. = image_tag @account.header.url, class: 'fields-group__thumbnail', id: 'account_header-preview'
  42. - if @account.header.present?
  43. = link_to settings_profile_picture_path('header'), data: { method: :delete }, class: 'link-button link-button--destructive' do
  44. = fa_icon 'trash fw'
  45. = t('generic.delete')
  46. %h4= t('edit_profile.other')
  47. .fields-group
  48. = f.input :bot, as: :boolean, wrapper: :with_label, hint: t('simple_form.hints.defaults.bot')
  49. .actions
  50. = f.button :button, t('generic.save_changes'), type: :submit