mirror of
https://github.com/we-promise/sure.git
synced 2026-04-07 14:31:25 +00:00
* First reporting version * Fixes for all tabs * Transactions table * Budget section re-design * FIX exports Fix transactions table aggregation * Add support for google sheets Remove pdf and xlsx for now * Multiple fixes - Trends & Insights now follows top filter - Transactions Breakdown removed filters, implemented sort by amount. - The entire section follows top filters. - Export to CSV adds per month breakdown * Linter and tests * Fix amounts - Correctly handle amounts across the views and controller. - Pass proper values to do calculation on, and not loose precision * Update Gemfile.lock * Add support for api-key on reports Also fix custom date filter * Review fixes * Move budget status calculations out of the view. * fix ensures that quarterly reports end at the quarter boundary * Fix bugdet days remaining Fix raw css style * Fix test * Implement google sheets properly with hotwire * Improve UX on period comparison * FIX csv export for non API key auth
68 lines
2.8 KiB
Plaintext
68 lines
2.8 KiB
Plaintext
<%= render DS::Dialog.new(variant: "modal", width: "md") do |dialog| %>
|
|
<% dialog.with_body do %>
|
|
<div class="space-y-4">
|
|
<div class="flex items-center justify-between gap-2">
|
|
<h3 class="font-medium text-primary">
|
|
<% if @api_key_present %>
|
|
<%= t("reports.google_sheets_instructions.title_with_key") %>
|
|
<% else %>
|
|
<%= t("reports.google_sheets_instructions.title_no_key") %>
|
|
<% end %>
|
|
</h3>
|
|
<%= icon("x", as_button: true, data: { action: "DS--dialog#close" }, class: "text-subdued hover:text-primary") %>
|
|
</div>
|
|
|
|
<div class="text-sm text-secondary space-y-3 whitespace-pre-line">
|
|
<% if @api_key_present %>
|
|
<p><%= t("reports.google_sheets_instructions.ready") %></p>
|
|
<p><%= t("reports.google_sheets_instructions.steps") %></p>
|
|
<div class="bg-surface-inset p-3 rounded-lg font-mono text-xs break-all">
|
|
=IMPORTDATA("<%= @csv_url %>")
|
|
</div>
|
|
<p class="text-warning"><%= icon("alert-triangle", class: "w-4 h-4 inline") %> <%= t("reports.google_sheets_instructions.security_warning") %></p>
|
|
<% else %>
|
|
<p><%= t("reports.google_sheets_instructions.need_key") %></p>
|
|
<ol class="list-decimal list-inside space-y-2">
|
|
<li><%= t("reports.google_sheets_instructions.step1") %></li>
|
|
<li><%= t("reports.google_sheets_instructions.step2") %></li>
|
|
<li><%= t("reports.google_sheets_instructions.step3") %></li>
|
|
<li><%= t("reports.google_sheets_instructions.step4") %></li>
|
|
</ol>
|
|
<p><strong><%= t("reports.google_sheets_instructions.example") %>:</strong></p>
|
|
<div class="bg-surface-inset p-3 rounded-lg font-mono text-xs break-all">
|
|
<%= @csv_url %>&api_key=YOUR_API_KEY_HERE
|
|
</div>
|
|
<p><%= t("reports.google_sheets_instructions.then_use") %></p>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="flex gap-2">
|
|
<% if @api_key_present %>
|
|
<%= render DS::Button.new(
|
|
text: t("reports.google_sheets_instructions.open_sheets"),
|
|
variant: "primary",
|
|
full_width: true,
|
|
href: "https://sheets.google.com/create",
|
|
target: "_blank",
|
|
data: { action: "click->DS--dialog#close" }
|
|
) %>
|
|
<% else %>
|
|
<%= render DS::Button.new(
|
|
text: t("reports.google_sheets_instructions.go_to_api_keys"),
|
|
variant: "primary",
|
|
full_width: true,
|
|
href: settings_api_key_path,
|
|
frame: "_top"
|
|
) %>
|
|
<% end %>
|
|
<%= render DS::Button.new(
|
|
text: t("reports.google_sheets_instructions.close"),
|
|
variant: "outline",
|
|
full_width: true,
|
|
data: { action: "DS--dialog#close" }
|
|
) %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|