1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-08 23:15:24 +02:00

Add Property Details View (#1116)

* Add backend for property account details

* Rubocop updates

* Add property form with details

* Revert "Rubocop updates"

This reverts commit 05b0b8f3a4.

* Bump brakeman to latest version

* Add overview section to property view

* Lint fixes
This commit is contained in:
Zach Gollwitzer 2024-08-23 08:47:08 -04:00 committed by GitHub
parent 4433488562
commit e856691c86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 547 additions and 81 deletions

View file

@ -1,10 +1,16 @@
<%= turbo_stream_from @account %>
<%= tag.div id: dom_id(@account), class: "space-y-4" do %>
<div class="flex justify-between items-center">
<header class="flex justify-between items-center">
<div class="flex items-center gap-3">
<%= image_tag account_logo_url(@account), class: "w-8 h-8" %>
<h2 class="font-medium text-xl"><%= @account.name %></h2>
<div>
<h2 class="font-medium text-xl"><%= @account.name %></h2>
<% if @account.property? && @account.property.address %>
<p class="text-gray-500"><%= @account.property.address %></p>
<% end %>
</div>
</div>
<div class="flex items-center gap-3">
<%= button_to sync_account_path(@account), method: :post, class: "flex items-center gap-2", title: "Sync Account" do %>
@ -43,7 +49,7 @@
</div>
<% end %>
</div>
</div>
</header>
<% if @account.highest_priority_issue %>
<%= render partial: "issues/issue", locals: { issue: @account.highest_priority_issue } %>
@ -79,7 +85,10 @@
</div>
</div>
<% selected_tab_key, selected_tab_content_path = selected_account_tab(@account).values_at(:key, :content_path) %>
<% selected_tab = selected_account_tab(@account) %>
<% selected_tab_key = selected_tab[:key] %>
<% selected_tab_partial_path = selected_tab[:partial_path] %>
<% selected_tab_route = selected_tab[:route] %>
<div class="flex gap-2 text-sm text-gray-900 font-medium mb-4">
<% account_tabs(@account).each do |tab| %>
@ -88,8 +97,12 @@
</div>
<div class="min-h-[800px]">
<%= turbo_frame_tag dom_id(@account, selected_tab_key), src: selected_tab_content_path do %>
<%= render "account/entries/loading" %>
<% if selected_tab_route.present? %>
<%= turbo_frame_tag dom_id(@account, selected_tab_key), src: selected_tab_route do %>
<%= render "account/entries/loading" %>
<% end %>
<% else %>
<%= render selected_tab_partial_path, account: @account %>
<% end %>
</div>
<% end %>