Skip to content

Commit

Permalink
feat(accounts): update edit and new pages (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
andreybakanovsky authored Sep 4, 2023
1 parent e4566ae commit 8c158e9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
10 changes: 0 additions & 10 deletions app/views/accounts/edit.html.erb

This file was deleted.

16 changes: 16 additions & 0 deletions app/views/accounts/edit.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.columns.is-centered
.column.is-one-third
h2.title.is-4.has-text-centered Edit account
= form_with model: account do |f|
.field
= f.text_field :name, autofocus: true, class: "input",placeholder: "Name"
.field
= f.email_field :email, autofocus: true, autocomplete: "email", placeholder: "email"
.field
= f.check_box :notification, class: "checkbox"
|  
= f.label :notification, "Approve transactions"
br
div.buttons.is-flex.is-justify-content-flex-end
= link_to 'Back', account_path(account), class: 'button is-light'
= f.submit 'Save', class: 'button is-primary'
5 changes: 0 additions & 5 deletions app/views/accounts/new.html.erb

This file was deleted.

11 changes: 11 additions & 0 deletions app/views/accounts/new.html.slim
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.columns.is-centered
.column.is-one-third
h2.title.is-4.has-text-centered New account
= form_with url: accounts_path do |f|
.field
= f.text_field :name, autofocus: true, class: "input",placeholder: "Name"
br
br
div.buttons.is-flex.is-justify-content-flex-end
= link_to 'Back', my_account_path, class: 'button is-light'
= f.submit 'Save', class: "button is-primary is-fullwidth"
4 changes: 2 additions & 2 deletions app/views/devise/registrations/edit.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
= f.password_field :current_password, autocomplete: "current-password", placeholder: "current password"
p.help
| (we need your current password to confirm your changes)
.actions.is-flex.is-justify-content-flex-end
= link_to 'Back', request.referer.present? && request.referer != edit_user_registration_path ? request.referer : root_path, class: 'button is-link mr-2'
div.buttons.is-flex.is-justify-content-flex-end
= link_to 'Back', request.referer.present? && request.referer != edit_user_registration_path ? request.referer : root_path, class: 'button is-light'
= f.submit "Update", class: "button is-primary"

0 comments on commit 8c158e9

Please sign in to comment.