diff --git a/app/controllers/account/calculators_controller.rb b/app/controllers/account/calculators_controller.rb
index 9a14436cf..beb21c3f4 100644
--- a/app/controllers/account/calculators_controller.rb
+++ b/app/controllers/account/calculators_controller.rb
@@ -10,7 +10,7 @@ def index
end
def show
- # TODO: fill it
+ @calculator = resource
end
def new
diff --git a/app/views/account/calculators/show.html.erb b/app/views/account/calculators/show.html.erb
index 553e9b798..4ba438cfc 100644
--- a/app/views/account/calculators/show.html.erb
+++ b/app/views/account/calculators/show.html.erb
@@ -1 +1,57 @@
-<%= render "shared/under_construction" %>
+
+ <%= link_to account_calculators_path, class: "back-arrow" do %>
+ <%= inline_svg "icons/arrow-left.svg", class: "z-1 mr-2 mb-0.5" %>
+
<%= t('buttons.back') %>
+ <% end %>
+
+
+ <%= t('.name') %>:
+
+
+
+
+
<%= t('.slug') %>:
+
<%= @calculator.slug %>
+
+
+
+
+
<%= t('.fields') %>:
+ <% @calculator.fields.each do |field| %>
+
+
+ <%= field.label %>
+ (<%= field.var_name %>)
+
+
+ <% end %>
+
+
+
+
+
<%= t('.formulas') %>:
+ <% @calculator.formulas.each do |formula| %>
+
+ <% end %>
+
+
+
+ <%= link_to t('.edit'),
+ edit_account_calculator_path(@calculator.slug, locale: I18n.locale),
+ class: "btn btn-green" %>
+
+ <%= button_to account_calculator_path(@calculator.slug, locale: I18n.locale),
+ method: :delete,
+ data: { turbo_confirm: t('.confirm_delete') },
+ class: "btn btn-danger" do %>
+ <%= t('.delete') %>
+ <% end %>
+
+
\ No newline at end of file
diff --git a/spec/requests/account/calculators_spec.rb b/spec/requests/account/calculators_spec.rb
index c4f45a524..95f57150b 100644
--- a/spec/requests/account/calculators_spec.rb
+++ b/spec/requests/account/calculators_spec.rb
@@ -88,4 +88,15 @@
end
end
end
+
+ describe "GET /account/calculators/:slug" do
+ it "renders the calculator's show page correctly" do
+ get account_calculator_path(calculator.slug, locale: locale)
+
+ expect(response).to have_http_status(:ok)
+ expect(response).to render_template(:show)
+ expect(response.body).to include(calculator.en_name)
+ expect(response.body).to include(calculator.slug)
+ end
+ end
end