Skip to content

Commit

Permalink
Changed show page
Browse files Browse the repository at this point in the history
  • Loading branch information
KseniaGovorun committed Dec 1, 2024
1 parent 4f47f52 commit e4b6ed9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
32 changes: 31 additions & 1 deletion app/views/account/calculators/show.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
<%= render "calculators/partials/logo_picture", calculator: @calculator %>
<div class="main-show-container">
<%= link_to account_calculators_path, class: "back-arrow" do %>
<%= inline_svg "icons/arrow-left.svg", class: "z-1 mr-2 mb-0.5" %>
<span class="text-sm"><%= t('buttons.back') %></span>
<% end %>

<div class="calc-details mb-4">
<span class="showpage-text"><%= t('.name') %>:</span>
<p class="text-2xl font-extrabold"> <%= @calculator.name %> </p>
</div>

<div class="calc-details mb-6">
<span class="showpage-text"><%= t('.slug') %>:</span>
<p class="font-bold"> <%= @calculator.slug %> </p>
</div>

<%= render "calculators/partials/logo_picture", calculator: @calculator %>

<div class="showpage-buttons">
<%= 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 %>
</div>
</div>
6 changes: 5 additions & 1 deletion app/views/calculators/partials/_logo_picture.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<%= image_tag(@calculator.logo_picture.variant(resize_to_fill: [428, 307])) if @calculator.logo_picture.attached? %>
<% if @calculator.logo_picture.attached? %>
<%= image_tag(@calculator.logo_picture.variant(resize_to_fill: [428, 307]))%>
<% else %>
<%= image_tag "scales.png", alt: "Default image" %>
<% end %>

0 comments on commit e4b6ed9

Please sign in to comment.