Skip to content

Commit

Permalink
Added calcualtor image to show page and style image
Browse files Browse the repository at this point in the history
  • Loading branch information
olexandervanzuriak committed Jan 18, 2025
1 parent d5550b4 commit 66b8d20
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
19 changes: 19 additions & 0 deletions app/assets/stylesheets/pages/calculator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,17 @@
max-width: 428px;
}

.constructor-calculator-scales {
align-self: center;
width: 50%;
max-width: 428px;
padding: 10px 0;
}

.calcualtor-margin-left {
margin-left: 1.25rem;
}

.simple_form_calculator {
width: 40%;
margin-top: 32px;
Expand Down Expand Up @@ -400,4 +411,12 @@ select.custom-select {
.scales_img {
width: 100%;
}

.constructor-calculator-scales {
width: 100%;
}

.calcualtor-margin-left {
margin-left: 0;
}
}
13 changes: 8 additions & 5 deletions app/views/calculators/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<%# TODO: Delete this and use user provided value %>
<% calculator_image = "scales.png" %>

<div style="--calculator-color: <%= @calculator.color %>">
<div class="rounded jumbotron jumbotron-fluid position-relative">
<h1 class="pt-6 text-2xl font-semibold text-center font-sans dynamic-text-color">Calculator <%= @calculator.name %> <%= @text %></h1>
<div class="flex-wrap d-flex justify-content-around calculator_wrap ms-5">
<div class="flex-wrap d-flex justify-content-around calculator_wrap calcualtor-margin-left">

<%= form_with html: { class: "simple_form_calculator"}, url: calculate_calculator_path(@calculator) do |form| %>
<div class="flex-item flex-column">
Expand All @@ -27,7 +24,13 @@
<%= form.submit "Calculate", class: "btn-nonito result-btn dynamic-background-color" %>
</div>
<% end %>
<%= image_tag calculator_image, class: "scales_img", alt: t(".image_alt") %>

<% if @calculator.logo_picture.attached? %>
<%= image_tag @calculator.logo_picture, class: "constructor-calculator-scales", alt: t(".image_alt") %>
<% else %>
<%# Default image %>
<%= image_tag "scales.png", class: "constructor-calculator-scales", alt: t(".image_alt") %>
<% end %>
</div>
</div>

Expand Down
6 changes: 2 additions & 4 deletions config/initializers/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
require "sidekiq/web"

Sidekiq.configure_client do |config|
config.redis = { size: 1, url: ENV.fetch("REDIS_URL", nil),
namespace: ENV.fetch("SIDEKIQ_NAMESPACE", nil) }
config.redis = { size: 1, url: ENV.fetch("REDIS_URL", nil) }
end

Sidekiq.configure_server do |config|
config.redis = { size: 7, url: ENV.fetch("REDIS_URL", nil),
namespace: ENV.fetch("SIDEKIQ_NAMESPACE", nil) }
config.redis = { size: 7, url: ENV.fetch("REDIS_URL", nil) }
end

Sidekiq::Web.use(Rack::Auth::Basic) do |username, password|
Expand Down

0 comments on commit 66b8d20

Please sign in to comment.