1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 13:35:21 +02:00

New Settings Menu, Routes and Controllers Organization (#641)

* Add new settings routes and controllers

* Add new settings view, restructure controllers and routes

* Fix lint errors
This commit is contained in:
Zach Gollwitzer 2024-04-18 07:56:51 -04:00 committed by GitHub
parent 39d57a167e
commit 9bda7efc3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
52 changed files with 771 additions and 203 deletions

View file

@ -0,0 +1,25 @@
<% content_for :sidebar do %>
<%= render "settings/nav" %>
<% end %>
<div class="space-y-4">
<h1 class="text-gray-900 text-xl font-medium mb-4">Account</h1>
<%= form_with model: Current.user, url: settings_profile_path, html: { class: "space-y-4" } do |form| %>
<%= form.fields_for :family_attributes do |family_fields| %>
<%= family_fields.text_field :name, placeholder: "Family name", value: Current.family.name, label: "Family name" %>
<%= family_fields.select :currency, options_for_select(Money::Currency.popular.map { |currency| ["#{currency.iso_code} (#{currency.name})", currency.iso_code] }, selected: Current.family.currency), { label: "Currency" } %>
<% end %>
<%= form.text_field :first_name, placeholder: "First name", value: Current.user.first_name, label: true %>
<%= form.text_field :last_name, placeholder: "Last name", value: Current.user.last_name, label: true %>
<%= form.email_field :email, placeholder: "Email", value: Current.user.email, label: true %>
<%= form.password_field :password, label: true %>
<%= form.password_field :password_confirmation, label: true %>
<div class="fixed right-5 bottom-5">
<button type="submit" class="flex items-center justify-center w-12 h-12 mb-2 bg-black rounded-full shrink-0 grow-0 hover:bg-gray-600">
<%= inline_svg_tag("icn-check.svg", class: "text-white fill-current") %>
</button>
</div>
<% end %>
<div class="flex gap-4">
<%= next_setting("Preferences", settings_preferences_path) %>
</div>
</div>