Retire semantic_form_for

Also a buttload of form cleanups...
This commit is contained in:
Henne Vogelsang 2022-02-23 17:52:16 +01:00
parent 350b1ebbbe
commit 81853d1ef9
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
136 changed files with 1825 additions and 1441 deletions

View file

@ -5,21 +5,37 @@
%h1 Edit your profile
.row
.col-md-12
= semantic_form_for(@user, url: user_path(@user.id)) do |f|
= f.input :name, as: :string, hint: 'This is your real name.'
= f.input :nickname, as: :string, hint: 'This is how the other users see you, not your real name'
.control-label
= "Avatar"
= image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '')
= link_to 'Change your avatar here', 'https://gravatar.com'
= f.input :affiliation, as: :string,
hint: 'This could be a company, a user group, or nothing at all.'
= f.input :biography, input_html: { rows: 5, data: { provide: 'markdown' } },
hint: markdown_hint
You have used
%span#bio_length
= @user.biography ? @user.biography.split.length : 0
words. Biographies are limited to 150 words.
%br
%br
= f.action :submit, as: :button, label: 'Update', button_html: {class: 'btn btn-primary'}
= form_for(@user) do |f|
.form-group
= f.label :name
= f.text_field :name, class: 'form-control'
%span.help-block
This is your real name
.form-group
= f.label :nickname
= f.text_field :nickname, class: 'form-control'
.form-group
= f.label :avatar
%br
= image_tag(@user.gravatar_url(size: '48'), title: "Yo #{@user.name}!", alt: '', class: 'img-rounded')
%span.help-block
Change your avatar on
= link_to 'gravatar.com', 'https://gravatar.com'
.form-group
= f.label :affiliation
= f.text_field :affiliation, class: 'form-control'
%span.help-block
The company you work work, the user group you belong to, or nothing at all.
.form-group
= f.label :biography
= f.text_area :biography, rows: 5, data: { provide: 'markdown' }, class: 'form-control'
%span.help-block
You have used
%span#bio_length
= @user.biography ? @user.biography.split.length : 0
words. Biographies are limited to 150 words.
= markdown_hint
.form-group
.text-right
= f.submit nil, class: 'btn btn-primary'