mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Initial commit
This commit is contained in:
commit
99de24ac70
147 changed files with 3519 additions and 0 deletions
4
app/views/accounts/index.html.erb
Normal file
4
app/views/accounts/index.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<div>
|
||||
<h1 class="font-bold text-4xl">Accounts#index</h1>
|
||||
<p>Find me in app/views/accounts/index.html.erb</p>
|
||||
</div>
|
43
app/views/accounts/new.html.erb
Normal file
43
app/views/accounts/new.html.erb
Normal file
|
@ -0,0 +1,43 @@
|
|||
<h1 class="text-3xl font-semibold font-display">Add an account</h1>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4 mt-8 text-sm sm:grid-cols-3 md:grid-cols-4">
|
||||
<div class="relative flex-col items-center px-5 py-4 space-x-3 text-center bg-white border border-gray-100 shadow-sm rounded-xl hover:border-gray-200">
|
||||
<%= link_to "new_bank_path", class: "flex flex-col items-center justify-center w-full text-center focus:outline-none" do %>
|
||||
<span class="absolute inset-0" aria-hidden="true"></span>
|
||||
<span class="flex w-10 h-10 shrink-0 grow-0 items-center justify-center rounded-xl bg-[#EAF4FF] mb-2">
|
||||
<%= inline_svg_tag('icon-bank-accounts.svg', class: 'text-[#3492FB] stroke-current') %>
|
||||
</span>
|
||||
Bank accounts
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="relative flex-col items-center px-5 py-4 space-x-3 text-center bg-white border border-gray-100 shadow-sm rounded-xl hover:border-gray-200">
|
||||
<%= link_to "new_investment_path", class: "flex flex-col items-center justify-center w-full text-center focus:outline-none" do %>
|
||||
<span class="absolute inset-0" aria-hidden="true"></span>
|
||||
<span class="flex w-10 h-10 shrink-0 grow-0 items-center justify-center rounded-xl bg-[#EDF7F4] mb-2">
|
||||
<%= inline_svg_tag('icon-investments.svg', class: 'text-[#1BD5A1] stroke-current') %>
|
||||
</span>
|
||||
Investments
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="relative flex-col items-center px-5 py-4 space-x-3 text-center bg-white border border-gray-100 shadow-sm rounded-xl hover:border-gray-200">
|
||||
<%= link_to "new_credit_path", class: "flex flex-col items-center justify-center w-full text-center focus:outline-none" do %>
|
||||
<span class="absolute inset-0" aria-hidden="true"></span>
|
||||
<span class="flex w-10 h-10 shrink-0 grow-0 items-center justify-center rounded-xl bg-[#E6F6FA] mb-2">
|
||||
<%= inline_svg_tag('icon-credit-card.svg', class: 'text-[#189FC7] stroke-current') %>
|
||||
</span>
|
||||
Credit cards
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="relative flex-col items-center px-5 py-4 space-x-3 text-center bg-white border border-gray-100 shadow-sm rounded-xl hover:border-gray-200">
|
||||
<%= link_to "new_real_estate_path", class: "flex flex-col items-center justify-center w-full text-center focus:outline-none" do %>
|
||||
<span class="absolute inset-0" aria-hidden="true"></span>
|
||||
<span class="flex w-10 h-10 shrink-0 grow-0 items-center justify-center rounded-xl bg-[#FEF0F7] mb-2">
|
||||
<%= inline_svg_tag('icon-real-estate.svg', class: 'text-[#F03695] stroke-current') %>
|
||||
</span>
|
||||
Real estate
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
4
app/views/accounts/show.html.erb
Normal file
4
app/views/accounts/show.html.erb
Normal file
|
@ -0,0 +1,4 @@
|
|||
<div>
|
||||
<h1 class="font-bold text-4xl">Accounts#show</h1>
|
||||
<p>Find me in app/views/accounts/show.html.erb</p>
|
||||
</div>
|
69
app/views/layouts/application.html.erb
Normal file
69
app/views/layouts/application.html.erb
Normal file
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="bg-offwhite">
|
||||
<head>
|
||||
<title><%= content_for(:title) || "Maybe" %></title>
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="apple-mobile-web-app-title" content="Maybe">
|
||||
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
|
||||
<%= yield :head %>
|
||||
|
||||
<link rel="manifest" href="/manifest.json">
|
||||
<link rel="icon" href="/icon.png" type="image/png">
|
||||
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
||||
<link rel="apple-touch-icon" href="/icon.png">
|
||||
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
|
||||
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
||||
<%= javascript_importmap_tags %>
|
||||
<%= hotwire_livereload_tags if Rails.env.development? %>
|
||||
</head>
|
||||
|
||||
<body class="h-full">
|
||||
<div class="flex">
|
||||
<div class="flex-col p-5 min-w-80">
|
||||
<div class="flex items-center justify-between">
|
||||
<%= link_to root_path do %>
|
||||
<%= image_tag 'logo.svg', alt: 'Maybe' %>
|
||||
<% end %>
|
||||
<div class="relative" data-controller="dropdown">
|
||||
<div class="flex" data-action="click->dropdown#toggleMenu">
|
||||
<div class="mr-1.5 text-white w-8 h-8 bg-gray-400 rounded-full flex items-center justify-center text-lg uppercase"><%= current_user.email.first %></div>
|
||||
</div>
|
||||
|
||||
<div class="absolute z-10 hidden w-screen px-2 mt-2 -translate-x-1/2 left-1/2 max-w-min" data-dropdown-target="menu">
|
||||
<div class="w-48 px-3 text-sm font-semibold leading-6 text-gray-900 bg-white shadow-lg shrink rounded-xl ring-1 ring-gray-900/5">
|
||||
<%= button_to "Log Out", session_path, method: :delete, class: 'block p-2 hover:text-gray-600' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<nav>
|
||||
<ul class="mt-6 space-y-2">
|
||||
<li>
|
||||
<%= link_to root_path, class: 'block hover:bg-gray-100 -ml-2 p-2 text-sm font-semibold text-gray-900 flex items-center rounded' do %>
|
||||
<%= inline_svg_tag('icon-dashboard.svg', class: 'text-black stroke-current mr-2') %>
|
||||
Dashboard
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="mt-6">
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs">Accounts</span>
|
||||
<%= link_to new_account_path, class: 'block hover:bg-gray-100 p-2 text-sm font-semibold text-gray-900 flex items-center rounded' do %>
|
||||
<%= inline_svg_tag('icon-add.svg', class: 'text-gray-500 fill-current') %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<main class="flex-grow py-5 pr-5">
|
||||
<%= yield %>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
52
app/views/layouts/auth.html.erb
Normal file
52
app/views/layouts/auth.html.erb
Normal file
|
@ -0,0 +1,52 @@
|
|||
<!DOCTYPE html>
|
||||
<html class="h-full bg-white">
|
||||
<head>
|
||||
<title>Maybe</title>
|
||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||
<meta name="apple-mobile-web-app-title" content="Maybe">
|
||||
|
||||
<%= csrf_meta_tags %>
|
||||
<%= csp_meta_tag %>
|
||||
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
|
||||
|
||||
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
||||
<%= javascript_importmap_tags %>
|
||||
|
||||
<%= hotwire_livereload_tags if Rails.env.development? %>
|
||||
</head>
|
||||
|
||||
<body class="h-full">
|
||||
<div class="flex flex-col justify-center min-h-full px-6 py-12">
|
||||
|
||||
<div class="sm:mx-auto sm:w-full sm:max-w-md">
|
||||
<%= render "shared/logo" %>
|
||||
|
||||
<h2 class="mt-6 text-3xl font-semibold tracking-tight text-center font-display">
|
||||
<%= content_for?(:header_title) ? yield(:header_title).html_safe : "Your account" %>
|
||||
</h2>
|
||||
|
||||
<% if params[:controller] == "devise/sessions" && params[:action] == "new" %>
|
||||
<p class="mt-2 text-sm text-center text-gray-600">
|
||||
or <%= link_to "create an account", new_user_registration_path, class: 'font-medium text-candlelight-600 hover:text-candlelight-500' %>
|
||||
</p>
|
||||
<% elsif params[:controller] == "devise/registrations" && params[:action] == "new" %>
|
||||
<p class="mt-2 text-sm text-center text-gray-600">
|
||||
or <%= link_to "sign in to your account", new_user_session_path, class: 'font-medium text-candlelight-600 hover:text-candlelight-500' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-8 sm:mx-auto sm:w-full sm:max-w-lg">
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
||||
<div class="p-8 mt-2 text-center">
|
||||
<p class="mt-6 text-sm text-black"><a href="/privacy" class="text-black opacity-90">Privacy Policy</a> • <a href="/terms" class="text-black opacity-90">Terms of Service</a></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
13
app/views/layouts/mailer.html.erb
Normal file
13
app/views/layouts/mailer.html.erb
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<style>
|
||||
/* Email styles need to be inline */
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%= yield %>
|
||||
</body>
|
||||
</html>
|
1
app/views/layouts/mailer.text.erb
Normal file
1
app/views/layouts/mailer.text.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<%= yield %>
|
1
app/views/pages/dashboard.html.erb
Normal file
1
app/views/pages/dashboard.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<h1 class="text-3xl font-semibold font-display">Dashboard</h1>
|
1
app/views/password_mailer/password_reset.html.erb
Normal file
1
app/views/password_mailer/password_reset.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<%= link_to "Reset your password", edit_password_reset_url(token: params[:token]) %>
|
20
app/views/password_resets/edit.html.erb
Normal file
20
app/views/password_resets/edit.html.erb
Normal file
|
@ -0,0 +1,20 @@
|
|||
<%
|
||||
header_title "Reset password"
|
||||
%>
|
||||
|
||||
<%= form_with url: password_reset_path(token: params[:token]), html: {class: 'space-y-6'} do |form| %>
|
||||
|
||||
<div class="relative p-4 border border-gray-100 bg-offwhite rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
|
||||
<%= form.label :password, class: 'block text-sm font-medium text-gray-700' %>
|
||||
<%= form.password_field :password, required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
|
||||
</div>
|
||||
|
||||
<div class="relative p-4 border border-gray-100 bg-offwhite rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
|
||||
<%= form.label :password_confirmation, class: 'block text-sm font-medium text-gray-700' %>
|
||||
<%= form.password_field :password_confirmation, required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit "Reset Password", class: 'flex justify-center w-full px-4 py-3 text-sm font-medium text-white bg-black rounded-xl hover:bg-black focus:outline-none focus:ring-2 focus:ring-gray-200 shadow' %>
|
||||
</div>
|
||||
<% end %>
|
14
app/views/password_resets/new.html.erb
Normal file
14
app/views/password_resets/new.html.erb
Normal file
|
@ -0,0 +1,14 @@
|
|||
<%
|
||||
header_title "Reset password"
|
||||
%>
|
||||
|
||||
<%= form_with url: password_reset_path, html: {class: 'space-y-6'} do |form| %>
|
||||
<div class="relative p-4 border border-gray-100 bg-offwhite rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
|
||||
<%= form.label :email, class: 'block text-sm font-medium text-gray-700' %>
|
||||
<%= form.email_field :email, autofocus: false, autocomplete: "email", required: 'required', placeholder: 'you@example.com', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit "Reset password", class: 'flex justify-center w-full px-4 py-3 text-sm font-medium text-white bg-black rounded-xl hover:bg-black focus:outline-none focus:ring-2 focus:ring-gray-200 shadow' %>
|
||||
</div>
|
||||
<% end %>
|
29
app/views/passwords/edit.html.erb
Normal file
29
app/views/passwords/edit.html.erb
Normal file
|
@ -0,0 +1,29 @@
|
|||
<h1>Update Password</h1>
|
||||
|
||||
<%= form_with model: current_user, url: password_path do |form| %>
|
||||
<% if form.object.errors.any? %>
|
||||
<% form.object.errors.full_messages.each do |message| %>
|
||||
<div><%= message %></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div>
|
||||
<%= form.label :password_challenge, "Current Password" %>
|
||||
<%= form.password_field :password_challenge %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :password, "New Password" %>
|
||||
<%= form.password_field :password %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.label :password_confirmation %>
|
||||
<%= form.password_field :password_confirmation %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit 'Update Password' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
22
app/views/pwa/manifest.json.erb
Normal file
22
app/views/pwa/manifest.json.erb
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "Maybe",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/icon.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
},
|
||||
{
|
||||
"src": "/icon.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
],
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"scope": "/",
|
||||
"description": "Maybe.",
|
||||
"theme_color": "red",
|
||||
"background_color": "red"
|
||||
}
|
26
app/views/pwa/service-worker.js
Normal file
26
app/views/pwa/service-worker.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Add a service worker for processing Web Push notifications:
|
||||
//
|
||||
// self.addEventListener("push", async (event) => {
|
||||
// const { title, options } = await event.data.json()
|
||||
// event.waitUntil(self.registration.showNotification(title, options))
|
||||
// })
|
||||
//
|
||||
// self.addEventListener("notificationclick", function(event) {
|
||||
// event.notification.close()
|
||||
// event.waitUntil(
|
||||
// clients.matchAll({ type: "window" }).then((clientList) => {
|
||||
// for (let i = 0; i < clientList.length; i++) {
|
||||
// let client = clientList[i]
|
||||
// let clientPath = (new URL(client.url)).pathname
|
||||
//
|
||||
// if (clientPath == event.notification.data.path && "focus" in client) {
|
||||
// return client.focus()
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (clients.openWindow) {
|
||||
// return clients.openWindow(event.notification.data.path)
|
||||
// }
|
||||
// })
|
||||
// )
|
||||
// })
|
34
app/views/registrations/new.html.erb
Normal file
34
app/views/registrations/new.html.erb
Normal file
|
@ -0,0 +1,34 @@
|
|||
<%
|
||||
header_title "Create an account"
|
||||
%>
|
||||
|
||||
<%= form_with model: @user, url: registration_path, html: {class: 'space-y-6'} do |form| %>
|
||||
<% if form.object.errors.any? %>
|
||||
<% form.object.errors.full_messages.each do |message| %>
|
||||
<div><%= message %></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<div class="relative p-4 border border-gray-100 bg-offwhite rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
|
||||
<%= form.label :email, class: 'block text-sm font-medium text-gray-700' %>
|
||||
<%= form.email_field :email, autofocus: false, autocomplete: "email", required: 'required', placeholder: 'you@example.com', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
|
||||
</div>
|
||||
|
||||
<div class="relative p-4 border border-gray-100 bg-offwhite rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
|
||||
<%= form.label :password, "Password", class: 'block text-sm font-medium text-gray-700' %>
|
||||
<%= form.password_field :password, autocomplete: "new-password", required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
|
||||
</div>
|
||||
|
||||
<div class="relative p-4 border border-gray-100 bg-offwhite rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
|
||||
<%= form.label :password_confirmation, "Password confirmation", class: 'block text-sm font-medium text-gray-700' %>
|
||||
<%= form.password_field :password_confirmation, autocomplete: "new-password", required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit "Continue", class: 'flex justify-center w-full px-4 py-3 text-sm font-medium text-white bg-black rounded-xl hover:bg-black focus:outline-none focus:ring-2 focus:ring-gray-200 shadow' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="mt-6 text-center">
|
||||
<p class="text-sm text-gray-600">Already have an account? <%= link_to "Sign in", new_session_path, class: 'font-medium text-candlelight-600 hover:text-candlelight-500' %></p>
|
||||
</div>
|
28
app/views/sessions/new.html.erb
Normal file
28
app/views/sessions/new.html.erb
Normal file
|
@ -0,0 +1,28 @@
|
|||
<%
|
||||
header_title "Sign in to your account"
|
||||
%>
|
||||
|
||||
<div class="mt-0 text-center">
|
||||
<p class="text-sm text-gray-600">Don't have an account? <%= link_to "Create one", new_registration_path, class: 'font-medium text-candlelight-600 hover:text-candlelight-500' %></p>
|
||||
</div>
|
||||
|
||||
|
||||
<%= form_with url: session_path, html: {class: 'space-y-6'} do |form| %>
|
||||
<div class="relative p-4 border border-gray-100 bg-offwhite rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
|
||||
<%= form.label :email, "Email address", class: 'block text-sm font-medium text-gray-700' %>
|
||||
<%= form.email_field :email, autofocus: false, autocomplete: "email", required: 'required', placeholder: 'you@example.com', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
|
||||
</div>
|
||||
|
||||
<div class="relative p-4 border border-gray-100 bg-offwhite rounded-xl focus-within:bg-white focus-within:shadow focus-within:opacity-100">
|
||||
<%= form.label :password, "Password", class: 'block text-sm font-medium text-gray-700' %>
|
||||
<%= form.password_field :password, required: 'required', class: 'p-0 mt-1 bg-transparent border-none opacity-50 focus:outline-none focus:ring-0 focus-within:opacity-100 w-full' %>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<%= form.submit "Log in", class: 'flex justify-center w-full px-4 py-3 text-sm font-medium text-white bg-black rounded-xl hover:bg-black focus:outline-none focus:ring-2 focus:ring-gray-200 shadow' %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="mt-6 text-center">
|
||||
<p class="text-sm text-gray-600">Forgot your password? <%= link_to "Reset it", new_password_reset_path, class: 'font-medium text-candlelight-600 hover:text-candlelight-500' %></p>
|
||||
</div>
|
1
app/views/shared/_logo.html.erb
Normal file
1
app/views/shared/_logo.html.erb
Normal file
|
@ -0,0 +1 @@
|
|||
<%= link_to image_tag("logomark.svg", class: 'w-auto h-12 mx-auto'), root_path, data: { turbo: false} %>
|
Loading…
Add table
Add a link
Reference in a new issue